/*
	Submit Once
	
	Add the following onclick event to a button to only allow the first pressing of the button
	to send a request to the server.
		onclick="return submitOnce()"
	If your using a cfform you should add the following line to the form itself instead.
		onsubmit="return submitOnce()"
*/
formSubmitted	= 0
function submitOnce() {
	if(!formSubmitted)
		formSubmitted	= formSubmitted + 1
	else
		return false
}

function toggleSection(i){
	var toggle = document.getElementById(i + "_toggle");
	
	if(document.getElementById(i).style.display == "block") {
		document.getElementById(i).style.display = "none";
		if (toggle != null)
			if (toggle.innerHTML.length < 5)
				toggle.innerHTML = "+";
			else
				toggle.innerHTML = "+ more";
	} else {
		document.getElementById(i).style.display = "block";
		if (toggle != null)
			if (toggle.innerHTML.length < 5)
				toggle.innerHTML = "-";
			else
				toggle.innerHTML = "- less";
	}
}

var win= null;
function OpenNewWindow(mypage,w,h,myname){
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,toolbar=no'
win=window.open(mypage,myname,settings)
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function TogglePopup(id) {
	var marker = document.getElementById(id + "_marker");
	var content = document.getElementById(id + "PopUp");
	
	if (content.style.display == "none") {
		content.style.display = "block";
		if (marker != null)
			marker.innerHTML = "[-]";
	} else {
		content.style.display = "none";
		if (marker != null)
			marker.innerHTML = "[+]";
	}
}

function ShowPopup(id) {
	var content = document.getElementById(id + "PopUp");
	content.style.display = "block";
}

function HidePopup(id) {
	var content = document.getElementById(id + "PopUp");
	content.style.display = "none";
}
