jQuery(document).ready(function () {

	jQuery('.email').click(function() {
		jQuery(".email").attr("style", "color: #505050;");
		jQuery(".email").val("");
	});
	
	jQuery('.newsletterSubmit').click(function() {
		if (jQuery(".email").val() == " Your Email Address" || jQuery(".searchBox").val() == "") {
			alert("Please enter an e-mail address.");
			return false;
		}
	});
	
	jQuery('.email').blur(function() {
		if (jQuery(".email").val() == "") {
			jQuery(".email").val(" Your Email Address");
			jQuery(".email").attr("style", "color: #d9d9d9;");
		}
	});
	
	jQuery('.searchBox').click(function() {
		jQuery(".searchBox").attr("style", "color: #505050;");
		jQuery(".searchBox").val("");
	});
	
	jQuery('.searchSubmit').click(function() {
		if (jQuery(".searchBox").val() == " Search this site" || jQuery(".searchBox").val() == "") {
			alert("Please enter a search value.");
			return false;
		}
	});
	
	jQuery('.searchBox').blur(function() {
		if (jQuery(".searchBox").val() == "") {
			jQuery(".searchBox").val(" Search this site");
			jQuery(".searchBox").attr("style", "color: #d9d9d9;");
		}
	});
	
	jQuery(".dropdown1 li:even").addClass("alt");

	jQuery('#servicesNav').hover(function () {
		jQuery('#servicesSubNav').stop(true, true).slideDown('fast');
		jQuery("#nav .services").attr("style", "background-position: -65px -28px;");
	}, function () {	
			if ( jQuery('#servicesSubNav').length )
				jQuery('#servicesSubNav').stop(true, true).slideUp('fast', function() {jQuery('#nav .services').removeAttr("style");});	
			else
				jQuery('#nav .services').removeAttr("style");
	});
	
	jQuery('#customersNav').hover(function () {
		jQuery('#customersSubNav').stop(true, true).slideDown('fast');
		jQuery("#nav .customers").attr("style", "background-position: -152px -28px");
	}, function () {
			if ( jQuery('#customersSubNav').length )
				jQuery('#customersSubNav').stop(true, true).slideUp('fast', function() {jQuery('#nav .customers').removeAttr("style");});	
			else
				jQuery('#nav .customers').removeAttr("style");
	});
	
	jQuery('#whoweareNav').hover(function () {
		jQuery('#whoweareSubNav').stop(true, true).slideDown('fast');
		jQuery("#nav .whoweare").attr("style", "background-position: -254px -28px");
	}, function () {
			if ( jQuery('#whoweareSubNav').length )
				jQuery('#whoweareSubNav').stop(true, true).slideUp('fast', function() {jQuery('#nav .whoweare').removeAttr("style");});	
			else
				jQuery('#nav .whoweare').removeAttr("style");
	});
	
	jQuery('#newsNav').hover(function () {
		jQuery('#newsSubNav').stop(true, true).slideDown('fast');
		jQuery("#nav .blog").attr("style", "background-position: -367px -28px");
	}, function () {
			if ( jQuery('#newsSubNav').length )
				jQuery('#newsSubNav').stop(true, true).slideUp('fast', function() {jQuery('#nav .news').removeAttr("style");});	
			else
				jQuery('#nav .blog').removeAttr("style");
	});
	
	jQuery('#contactNav').hover(function () {
		jQuery('#contactSubNav').stop(true, true).slideDown('fast');
		jQuery("#nav .contact").attr("style", "background-position: -504px -28px");
	}, function () {
			if ( jQuery('#contactSubNav').length )
				jQuery('#contactSubNav').stop(true, true).slideUp('fast', function() {jQuery('#nav .contact').removeAttr("style");});	
			else
				jQuery('#nav .contact').removeAttr("style");
	});
	
});
