
/*
Submit Once form validation- 
© Dynamic Drive (www.dynamicdrive.com)
For full source code, usage terms, and 100's more DHTML scripts, 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>
*/

if(document.forms[0] !=null)
	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){
	var popWin = null;
	pageURL = "" + pageURL
	if(pageURL == 'undefined')
		pageURL = "default.htm"
	
	if(!popWin || popWin.closed){
		popWin = window.open('http://www.indianecho.com/documents/help/' +
		pageURL + "#" + anchorName,'helpWin','scrollbars=yes,width=530,height=400');
	}
	popWin.focus();
}

function openInfoWin(pageURL, anchorName){
	var popWin = null;
	pageURL = "" + pageURL
	if(pageURL == 'undefined')
		pageURL = "default.htm"
	
	if(!popWin || popWin.closed){
		popWin = window.open('http://www.indianecho.com/documents/' +
		pageURL + "#" + anchorName,'infoWin','scrollbars=yes,width=530,height=400');
	}
	popWin.focus();
}