// JavaScript Document
$(
  function(){ 
  	//change the bg color of the 
  	$('#content').hide();
	$('#content').css('visibility','visible');
	$('#content').fadeIn();
	
	$('#latestNews > .linkItem').hover(
		function(){
			$(this).addClass('linkItemHover');
		},
		function(){
			$(this).removeClass('linkItemHover');
		}
  	);
	$('#nav li').hover(
		function(){
			//$(this).addClass('navHover');
		},
		function(){
			//$(this).removeClass('navHover');
		}
  	);
	$('#formResponseDiv').hide();
    $('#signupFormTag').ajaxForm({ 
        // target identifies the element(s) to update with the server response 
        target: '#formResponseDiv', 
 		beforeSubmit: checkEmailAddress,
        // success identifies the function to invoke when the server response 
        // has been received; here we apply a fade-in effect to the new content 
        success: function() { 
            $('#formResponseDiv').fadeIn('slow'); 
			$('#formContainer').hide();
        } 
    }); 
	$('#formResponseDivContactUs').hide();
    $('#contactUsForm').ajaxForm({ 
        // target identifies the element(s) to update with the server response 
        target: '#formResponseDivContactUs', 
 		beforeSubmit: validateContactUsForm,
        // success identifies the function to invoke when the server response 
        // has been received; here we apply a fade-in effect to the new content 
        success: function() { 
            $('#formResponseDivContactUs').fadeIn('slow'); 
			$('#contactUsFormContainerID').hide();
        } 
    }); 
	$('#pollResultsDiv').hide();
    $('#daPollForm').ajaxForm({ 
        // target identifies the element(s) to update with the server response 
        target: '#pollResultsDiv',
		beforeSubmit: validatePollSelected,
        // success identifies the function to invoke when the server response 
        // has been received; here we apply a fade-in effect to the new content 
        success: function() { 
            $('#pollResultsDiv').fadeIn('slow'); 
			$('#pollFormDiv').hide();
        } 
    }); 
});
