var contact = {
	init: function(){
		
		var safari = $.browser.safari; /* We need to check for safari to fix the input:text problem */
		safari && $('#Contactajax').addClass('formSafari');
		
		
		var msie = $.browser.msie; /* We need to check for safari to fix the input:text problem */
		
		if( msie && $.browser.version == "7.0"){
			
			$('#Contactajax').addClass('formIE7');
		}
		
		/*Set the focus for the forms.*/
		
		$('input[type="text"]').addClass("idleField");
		$('input[type="text"]').focus(function() {
			$(this).removeClass("idleField").addClass("focusField");
	        if (this.value == this.defaultValue){
	        	this.value = '';
	    	}
	        if(this.value != this.defaultValue){
		    	this.select();
	        }
	    });
		
		
		
	    $('input[type="text"]').blur(function() {
	    	$(this).removeClass("focusField").addClass("idleField");
	        if ($.trim(this.value == '')){
	        	this.value = (this.defaultValue ? this.defaultValue : '');
	    	}
	    });
		
		
		
		$('textarea').addClass("idleField");
		$('textarea').focus(function() {
			$(this).removeClass("idleField").addClass("focusField");
	        if (this.value == this.defaultValue){
	        	this.value = '';
	    	}
	        if(this.value != this.defaultValue){
		    	this.select();
	        }
	    });
		
		
		
	    $('textarea').blur(function() {
	    	$(this).removeClass("focusField").addClass("idleField");
	        if ($.trim(this.value == '')){
	        	this.value = (this.defaultValue ? this.defaultValue : '');
	    	}
	    });
		
		
		/*End Set the focus for the forms.*/
		
		
		$('#Phone').mask("(999) 999-9999");
		$('#Contactajax')
				  
				   .validate({
			         submitHandler: function(form) {
			           $(form).ajaxSubmit({
			                success: function() {
			                    $('#Contactajax').hide();
			                    $('#contactUs').append("<div id=\"Contactajax\" class=\"thanks\"><h2>Thanks for your submission.</h2><p>We will be in touch with you shortly.</p></div>")
			                }
			           });
			         }
			        }); 
				
	}
	
	
}
