/**
    Validates email address
    
    Parameters
    email:String - email to be validated
    
    Returns
    Boolean - false on invalid email and true on valid email address
 */
var validateEmail = function (email) {
    var emailReg = /^([\w-\.\+])+\@([\w-]+\.)+([\w]{2,4})+$/;
    return (emailReg.test(email));
};

var validatePhoneNo = function(no) {
    return new RegExp(/^[\+\d\s]{4,}$/g).test(no);
};

String.prototype.reverse = function() {
    var splitStr = this.split(""),
        tmpStr = splitStr.reverse(),
        reversedStr = tmpStr.join("");
    return reversedStr;
};

var eml = function(email) {
    var email = email.reverse();
    document.location.href = "mailto:"+email;
};

$(document).ready(function() {

    // PNG fix for IE
    if (jQuery.browser.msie && Number(jQuery.browser.version) < 7) {
        document.styleSheets[0].addRule('*', 'behavior: url(js/iepngfix.htc)');
    }

    // hook up Lightbox for galleries
    $(function() { $("a[rel='lightbox']").lightBox(); });
    
    // lose bordering from links that have images
    $("a:has(img)").css("border","0px none");
});