
function nostatus(){
	window.status = document.title;
	return true
}

document.onmouseover = nostatus
document.onmouseout = nostatus


function textCounter(area,maxlength){
	if(area.value.length >= maxlength){
		alert("You've reached the " + maxlength + " character limit.");
		area.value = area.value.substring(0, maxlength);
		event.returnValue = false;
	}
}


//Photo gallery functions
function show_big_pic(pic){
	document.getElementById("big_pic").innerHTML = "<img src='"+pic+"' border='1' style='border-color: black;'><br><br>Click to Close";
}

function move_big_pic(elem){
	document.getElementById("big_pic").style.top = elem.parentNode.parentNode.parentNode.parentNode.parentNode.offsetTop + 100 + "px";
	document.getElementById("big_pic").style.display = "";
}


//Contact & Newsletter Pages
function validate_contact_form(TheForm){
	clear_contact_form(TheForm);
	var required = "";
	if (TheForm.Name.value.length == 0) { required += "\n     - Name"; TheForm.Name.className="textBoxRequired"; }
	if (TheForm.Email.value.length == 0) { required += "\n     - Email"; TheForm.Email.className="textBoxRequired"; }
	else if (TheForm.Email.value.search(/(\w+[\w|\.|-]*\w+)(@\w+[\w|\.|-]*\w+\.\w{2,4})/) == -1) { required += "\n     - Please specify a valid email address"; TheForm.Email.className="textBoxRequired"; }
	
	if (required != "") {
		alert("Please fill in the required field(s):" + required);
		return false;
	}
	
	alert("Thanks!");
}

function reset_contact_form(TheForm){
	var x = confirm("Are you sure you want to clear all of your data and start over?");
	if(x){
		clear_contact_form(TheForm);
		TheForm.Name.focus();
		TheForm.reset();
	}
}

function clear_contact_form(TheForm){
	TheForm.Name.className = "textBox";
	TheForm.Email.className = "textBox";
}


//Shop Page
function toggle_shop(elem){
	document.getElementById("shop_1").className = "shop_off";
	document.getElementById("shop_2").className = "shop_off";
	document.getElementById("shop_3").className = "shop_off";
	document.getElementById("shop_4").className = "shop_off";
	
	document.getElementById("shop_detail_1").style.display = "none";
	document.getElementById("shop_detail_2").style.display = "none";
	document.getElementById("shop_detail_3").style.display = "none";
	document.getElementById("shop_detail_4").style.display = "none";
	
	document.getElementById("shop_"+elem).className = "shop_on";
	document.getElementById("shop_detail_"+elem).style.display = "";
}


//Community Page
function toggle_community(elem){
	document.getElementById("community_1").className = "community_off";
	document.getElementById("community_2").className = "community_off";
	document.getElementById("community_3").className = "community_off";
	
	document.getElementById("community_detail_1").style.display = "none";
	document.getElementById("community_detail_2").style.display = "none";
	document.getElementById("community_detail_3").style.display = "none";
	
	document.getElementById("community_"+elem).className = "community_on";
	document.getElementById("community_detail_"+elem).style.display = "";
}