function get_out_of_iframe() {
	if (top.location.href != self.location.href) top.location.href = self.location.href;
}
get_out_of_iframe();

$.validator.addMethod('phone',
    function(value, element)
    {
        return (this.optional(element) || value.match(/^(\+)?[0-9]{0,4}(\-)?[0-9\s]{7,15}$/));
    }, 'Please enter a valid phone number'
);

$.validator.addMethod('zipcode',
    function(value, element)
    {
        return (this.optional(element) || value.match(/^[1-9]{1}[0-9]{3} ?[a-zA-Z]{2}$/));
    }, 'Please enter a valid zipcode'
);

$(function()
{
    $("a.iframe").fancybox({
        'width'             : 758,
        'height'            : 600,
        'autoScale'			: false,
        'transitionIn'		: 'none',
        'transitionOut'		: 'none',
        'type'				: 'iframe'
    });
    
    $("a.inline").fancybox();
        
    $("#formValidate").validate({
        rules: {
            newpwd2: { equalTo: "#newpwd1" }
        },
        success: function(label) { 
		    label.remove(); 
        },
        errorPlacement: function(error,element) {
                       return true;
                    }
    });
});
