var myLastLI = '';
var myLastLeftLI = '';
var myLastSubLeftLI = '';

function emailpage() {
	temploc='http://www.marathon.com/About_Marathon/Contact_Us/Email_Page/?myURL=';
	temploc = temploc + window.location.href.gsub(/\&/, '%26').escapeHTML().gsub(/\?/, '%3F');
	window.location.href = temploc;
}


function clearSearchField() {
	if (document.search.search2.value == 'Search')
		{
			document.search.search2.value = '';
		}
}
		
function linkoutside(url) {
	// If you'd like to take some action before linking a user to another site, do so here
}

function eventsignup2() {
	var theForm = document.signup2;

	var temp = theForm.emma_member_name_first.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter first name.");
		theForm.emma_member_name_first.focus();
		return false;
	}
	
	var temp = theForm.emma_member_email.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter email.");
		theForm.emma_member_email.focus();
		return false;
	}
	var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
	var check=/@[\w\-]+\./;
	var checkend=/\.[a-zA-Z]{2,3}$/;

	if(((temp.search(exclude) != -1)||(temp.search(check)) == -1)||(temp.search(checkend) == -1)) {
		alert("Invalid email address.");
		theForm.emma_member_email.focus();
		return false;
	}
	
	var temp = theForm.emma_member_email.value;
	var temp2 = theForm.email2.value;
	if (temp != temp2) {
		alert("Please retype email address.");
		theForm.email2.focus();
		return false;
	}
}

function eventsignup() {
	var theForm = document.signup;

	var temp = theForm.firstname.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter first name.");
		theForm.firstname.focus();
		return false;
	}
	
	var temp = theForm.lastname.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter last name.");
		theForm.lastname.focus();
		return false;
	}
	
	var temp = theForm.email.value;
	if ((temp == '') || (temp.charAt(0) == ' ')){
		alert("Please enter email.");
		theForm.email.focus();
		return false;
	}
	var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
	var check=/@[\w\-]+\./;
	var checkend=/\.[a-zA-Z]{2,3}$/;

	if(((temp.search(exclude) != -1)||(temp.search(check)) == -1)||(temp.search(checkend) == -1)) {
		alert("Invalid email address.");
		theForm.email.focus();
		return false;
	}
	
	var temp = theForm.email.value;
	var temp2 = theForm.email2.value;
	if (temp != temp2) {
		alert("Please retype email address.");
		theForm.email2.focus();
		return false;
	}
}

var timer;
var lastTab 											= "";

function showChunk(chunkName) {
	if(lastTab != "" && $("divlayer_"+lastTab) != null) {
		$("divlayer_"+lastTab).hide();
	}
	lastTab 											= chunkName;
	if($("divlayer_"+chunkName) != null) {
		$("divlayer_"+chunkName).show();
	}
}

function resetMiningTabs() {
	//clearTimeout(timer);
}

function swapImageMining(btnName) {
	resetMiningTabs();
}

function swapMiningBack() {
	swapImageMining(lastTab);
}

function swapImageMiningBack() {
	clearTimeout(timer);
	if(lastTab!="") {
		timer											= setTimeout("swapMiningBack()", 120);
	} else {
		resetMiningTabs();	
	}
}

function callMiningDefault(btnName) {
	swapImageMining(btnName);
	showChunk(btnName);
}

	
