(function($){

	jQuery.validator.addMethod("firstname", function(value) {
	    if (value=='First Name') {
	        return false;
	    }else{
	        return true;
	    }
	}, "Must enter first name");
	
	jQuery.validator.addMethod("lastname", function(value) {
	    if (value=='Last Name') {
	        return false;
	    }else{
	        return true;
	    }
	}, "Must enter last name");
		
    $('#signup-form').validate({	
    	focusInvalid : false,
    	rules: {
    		2: {
    			required: true
    		},
    		3: {
    			required: true
    		},
    		18: {
    			required: false
    		},
    		12: {
    			required: true,
    			email: true
    		},
    		13: {
    			required: true,
    			email: true
    		},    		
    		15: {
    			required: false
    		}   		    		
    	},   		
    	errorPlacement: function(error, element) {
	    	$(element).find('.hide-error');  
	    	
	   },
	   
		submitHandler: function(form) {
       		$('#signup-form').hide();
       		$('.form-header > h3').html('Thank you for your interest.');
       		$('.form-header > p').html('We have received your inquiry. <br />A representative will be contacting you with more information.');
       		
   			$(form).ajaxSubmit();
   			return false;
   		}
    });
        
    $('.site-button')
    	.mouseover(function() { 
            var src = $(this).attr("src").replace("_off.gif", "_on.gif");
            $(this).attr("src", src);
        })
        .mouseout(function() {
            var src = $(this).attr("src").replace("_on.gif", "_off.gif");
            $(this).attr("src", src);
        }); 
        
    $('form').resetForm();    
	   
	$('#2').attr('value','First Name');
	$('#3').attr('value','Last Name');	  
	$('#18').attr('value','Phone');
	$('#12').attr('value','Email');
	$('#13').attr('value','Confirm Email');
	$('#15').attr('value','Comments');
	
	$('#2').click(function() {
		$(this).attr('value','');
		});
	$('#3').click(function() {
		$(this).attr('value','');
		});
	$('#18').click(function() {
		$(this).attr('value','');
		});
	$('#12').click(function() {
		$(this).attr('value','');
		});
	$('#13').click(function() {
		$(this).attr('value','');
		});		
	$('#15').click(function() {
		$(this).attr('value','');
		});						

	$('#2').focus(function() {
		$(this).attr('value','');
		});
	$('#3').focus(function() {
		$(this).attr('value','');
		});
	$('#18').focus(function() {
		$(this).attr('value','');
		});
	$('#12').focus(function() {
		$(this).attr('value','');
		});
	$('#13').focus(function() {
		$(this).attr('value','');
		});
	$('#15').focus(function() {
		$(this).attr('value','');
		});	
			
	$('#2').blur(function() {
		var test = $(this).attr('value');
		if (test==='') {
			$(this).attr('value','First Name');
			}
		});		

	$('#3').blur(function() {
		var test = $(this).attr('value');
		if (test==='') {
			$(this).attr('value','Last Name');
			}
		});	

	$('#18').blur(function() {
		var test = $(this).attr('value');
		if (test==='') {
			$(this).attr('value','Phone');
			}
		});	

	$('#12').blur(function() {
		var test = $(this).attr('value');
		if (test==='') {
			$(this).attr('value','Email');
			}
		});	
		
	$('#13').blur(function() {
		var test = $(this).attr('value');
		if (test==='') {
			$(this).attr('value','Confirm Email');
			}
		});	
		
	$('#15').blur(function() {
		var test = $(this).attr('value');
		if (test==='') {
			$(this).attr('value','Comments');
			}
		});	
															  
})(window.jQuery);
