
$(document).ready(function() {
	
	//png hack for ie6
	$('img[@src$=.png], input[@src$=.png], div#container-wrapper, div.services_activeBG, div.divGalleryInside, div.divGalleryInside a').ifixpng();
	
	//Hover effect for Header images on homepage only.
	$("#Map-travel-programs").hover(function() {
			$(".Map-travel-programs").attr("src", "images/header_travel_programs-hover.png");
			$(".Map-travel-programs").ifixpng();
		}, function() {
			$(".Map-travel-programs").attr("src", "images/header_travel_programs.png");
			$(".Map-travel-programs").ifixpng();
		});
	$("#Map-trade-shows").hover(function() {
			$(".Map-trade-shows").attr("src", "images/header_trade_shows-hover.png");
			$(".Map-trade-shows").ifixpng();
		}, function() {
			$(".Map-trade-shows").attr("src", "images/header_trade_shows.png");
			$(".Map-trade-shows").ifixpng();
		});
	
	//Submit button hover effect
	$("#inputSubmit").hover(function() {
			$("#inputSubmit").attr("src", "images/formSend_hover.png");
			$("#inputSubmit").ifixpng();
		}, function() {
			$("#inputSubmit").attr("src", "images/formSend.png");
			$("#inputSubmit").ifixpng();
		});
	
	//Email form.  These effects are used to allow the original background images to appear if nothing is entered into the form field.
	$("#inputName").blur(function () {
		if ($(this).val() == "") {
			$(this).attr("class", "inputTextName");
		}
	});
	
	$("#inputEmail").blur(function () {
		if ($(this).val() == "") {
			$(this).attr("class", "inputTextEmail");
		}
	});
	
	$("#inputMessage").blur(function () {
		if ($(this).val() == "") {
			$(this).attr("class", "inputTextMessage");
		}
	});
	
	//Close the error message box that is displayed when an email submit has an error.
	$("#errorClose a").click(function() {
			$("#errorMessage").css("display", "none");
	});
	
	$("#formCompleteClose a").click(function() {
			$("#formComplete").css("display", "none");
	});
	
	// Hover effect for main navigation.			
	$("#nav-home").hover(function() {
		if ($(this)[0].className != "active") {
			$(this)[0].src="images/nav-home-hover.gif";
		}
	}, function() {
		if ($(this)[0].className != "active") {
			$(this)[0].src="images/nav-home.gif";
		}
	});
	
	$("#nav-about").hover(function() {
		if ($(this)[0].className != "active") {
			$(this)[0].src="images/nav-about-hover.gif";
		}
	}, function() {
		if ($(this)[0].className != "active") {
			$(this)[0].src="images/nav-about.gif";
		}
	});
	
	$("#nav-services").hover(function() {
		if ($(this)[0].className != "active") {
			$(this)[0].src="images/nav-services-hover.gif";
		}
	}, function() {
		if ($(this)[0].className != "active") {
			$(this)[0].src="images/nav-services.gif";
		}
	});
	
	$("#nav-case_study").hover(function() {
		if ($(this)[0].className != "active") {
			$(this)[0].src="images/nav-case_study-hover.gif";
		}
	}, function() {
		if ($(this)[0].className != "active") {
			$(this)[0].src="images/nav-case_study.gif";
		}
	});
	
	$("#nav-contact").hover(function() {
		if ($(this)[0].className != "active") {
			$(this)[0].src="images/nav-contact-hover.gif";
		}
	}, function() {
		if ($(this)[0].className != "active") {
			$(this)[0].src="images/nav-contact.gif";
		}
	});
	
});