// JavaScript needed for the contact us page
// Back button detector
var current_hash = location.hash;
check_hash = function(){
	if (current_hash != location.hash){
		showContactPopup(location.hash.replace('#',''));
		current_hash = location.hash;
	}
}

// Popup
showContactPopup = function () {
	if (arguments[0] != "emailContact"){
		hideContactsPopup();
		return false;
	}
	$('.contact_menu').click(function(){
		location.hash = ' ';
		hideContactsPopup();
	}).css('cursor','pointer');
	$("#info_content").hide();
	$("#email_content").fadeIn(600);
}

hideContactsPopup = function () {
	$('.contact_menu').unbind().css('cursor','auto');
	$("#email_content").hide();
	$("#info_content").fadeIn(600);
}

// Init
$(function(){
	if (location.hash != ""){
		showContactPopup(location.hash.replace('#',''));
	}
	$('#sendusanemail').click(function(){
		location.hash = "emailContact";
		showContactPopup("emailContact");
	});
	$('.back_link').click(function(){
		location.hash = ' ';
		hideContactsPopup();
	});
	setInterval('check_hash()',100);
});