﻿// JScript File

//this script Needs to be put below all forms on the page


function SubmitOnce(){

if(typeof(Page_IsValid) == "undefined"){
	var Page_IsValid = true;
}

if(Page_IsValid ){
	document.getElementById("__tblWait").style.visibility = "visible";
	
	if (document.all||document.getElementById){
			for(x=0; x < document.forms.length; x++){
				theform = document.forms[x];
				//screen thru every element in the form, and hunt down "submit" and "reset"
				for (i=0;i<theform.length;i++){
				
					
					var tempobj=theform.elements[i];
					
					if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset"||tempobj.type.toLowerCase()=="button"){
						//disable em
						//tempobj.disabled=true;
						tempobj.style.visibility = 'hidden';
						
						
					}
				}
			}
		}
		
	}
return Page_IsValid;


}
	
		

//if IE 4+ or NS 6+
if (document.all||document.getElementById){
	for(x=0; x < document.forms.length; x++){
		theform = document.forms[x];
		//theform.onsubmit = SubmitOnce;
		theform.onsubmit = SubmitOnce;
	}
	
/*	for(x=0; x < document.forms.length; x++){
		theform = document.forms[x];
		//screen thru every element in the form, and hunt down "submit" and "reset"
		for (i=0;i<theform.length;i++){
		
			
			var tempobj=theform.elements[i];
			
			if(tempobj.type.toLowerCase()=="submit"){
				
				//tempobj.onmousedown = showPleaseWait;
				
				
			}
		}
	}*/
}


if(typeof(waitText) == "undefined") var waitText = "Please Wait...";
document.write('<table id="__tblWait" style="visibility:hidden;text-align:center;position:absolute;left:50%;margin-left:-100px; top:50%; margin-top:-50px; border:1px solid #98C000;width:200px;height:100px; background-color:#EDF2F8;filter:progid:DXImageTransform.Microsoft.Shadow(color=#CCCCCC,direction=135,strength=3);"><tr><td style="color:#003F8A; ">'+waitText+ '</td></tr></table>');





	 
	 
