
/*
Submit Once form validation- 
For full source code, visit http://dynamicdrive.com
*/

/*
  forms need to look like the following: <form method="POST" onSubmit="submitonce(this)">
  OR we can accomplish the same thing with the line below
  Pages that want to use this script should look like the following (declared after the form):
  script src='../lib/functions.js'></script>
*/

//document.forms[0].onsubmit=submitonce;

function submitonce(){
	var theform = document.forms[0];
	//if IE 4+ or NS 6+
	if (document.all||document.getElementById){
		//screen thru every element in the form, and hunt down "submit" 
		for (i=0;i<theform.length;i++){
			var tempobj=theform.elements[i]
			if(tempobj.type.toLowerCase()=="submit")
				//disable em
				tempobj.disabled=true
		}
	}
}


function openHelpWin(pageURL, anchorName){
	pageURL = "" + pageURL
	if(pageURL == 'undefined')
		pageURL = "signup.htm"
	
	window.open('http://www.findagreek.com/documents/help/' +
	pageURL + "#" + anchorName,'','scrollbars=yes,width=530,height=400');
}


function openJSWin(pageURL, winName, winWidth, winHeight){
	var jsWin = null;

	if(!jsWin || jsWin.closed){
		jsWin = window.open(pageURL, winName,'scrollbars=yes,width='+winWidth+',height='+winHeight);
	}
	jsWin.focus();
}

