			$(document).ready(function() { 

       			$('input[name="return"]').attr('value', 'success');
    		
	    		jQuery.validator.addMethod("phoneIE", function(phone_number, element) {
					phone_number = phone_number.replace(/\s+/g, ""); 
					return this.optional(element) || phone_number.length > 9 &&
						phone_number.match(/^(\+353)?\s?-?\(?[0-9]{1,4}\)?\s?-?[0-9]{5,8}$/);
					}, "Please specify a valid phone number");
    		
				$('#getintouch-header').ajaxForm(  
            			{target:"#header-hiddenDIV",
            			beforeSubmit:function(){
							return $('#getintouch-header').valid();
						},
    	           		success:function(rtn){ 
							$(".msg").html("Thank you for contacting us. We will be in touch shortly.");
   							$("#getintouch-header").css({'display' : 'none'});
	        	    	},
	            	} 			
	            ); 
	            
	            $('#getintouch-footer').ajaxForm(  
            			{target:"#footer-hiddenDIV",
            			beforeSubmit:function(){
							return $('#getintouch-footer').valid();
						},
    	           		success:function(rtn){ 
        	       			if(rtn == 'already subscribed'){
								$(".msg").html("You are already subscribed to our newsletter.");
   								$("#getintouch-footer").css({'display' : 'none'});
							}else if(rtn == 'success emarketing'){
								$(".msg").html("You are now subscribed to our newsletter.");
   								$("#getintouch-footer").css({'display' : 'none'});
							}else if(rtn.substring(0, 6) == 'Error :'){
								$(".msg").html(rtn);
							}else{
							    $(".msg").html("Thank you for contacting us. We will be in touch shortly.");
   								$("#getintouch-footer").css({'display' : 'none'});
							}
	        	    	},
	            	} 			
	            );
	            
	            $("#comment_form").validate();
	            				            
    	    });
