// Default Javascript 


// This JS is a complete mess. It contains (cut and pasted) all the crap from the various subsystems. It ought to be cleaned up

// Commented from esiv1/survey/index.cfm because of error
// function ValidateForm(){
// 	<!--- 2004.12.02 Code to allow submit with no docs selected --->	
// 	<cfif not ArrayLen(Docs)>
// 		return true;
// 	</cfif>
// 		
// 	docSelected = 0;
// 	<cfloop index="i" from="1" to="#ArrayLen(Docs)#">
// 		foo = window.document.docForm.docid#i#.checked;
// 		if (foo) docSelected = 1;
// 	</cfloop>
// 	if(docSelected == 1){
// 		return true;
// 	} else {
// 		alert("Please select a document before submitting the form!");
// 		window.document.docForm.docid1.focus();
// 		return false;
// 	}
// }


function showBlock(id) 
	{ document.getElementById(id).style.display = 'block';}

function hideBlock(id) 
	{ document.getElementById(id).style.display = 'none'; }

	
function makeChild(url,name,height,width,sizeable,crap)
{
	if (sizeable == 1) {sizeable="yes";} else {sizeable="no";}
	if (crap == 1) {crap="yes";} else {crap="no";}
	var winl = (screen.width-width)/2;
	var wint = (screen.height-height)/2;
	options = "toolbar="+crap+",location="+crap+",directories=no,status="+crap+",menubar="+crap+",scrollbars="+sizeable+",resizable="+sizeable+",width="+width+",height="+height+",top="+wint+",left="+winl+"";
	var child = open(url, name, options);
	child.focus();
}


function floatThis(url,height,width)
	{
		var options = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' & width & ',height=' & height & ',top=200,left=200';
		var floatWin = open(url, 'detail', options);
       	floatWin.focus();
	}
	
	function floatThis2(url)
	{
		var smallFloat = open(url, 'detail', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=350,top=200,left=200');
       	smallFloat.focus();
	}
	
	function showDetail(userid)
	{
		var url = './Security/view_usersdetail.cfm?userid=' + userid;
		var popup = open(url, 'detail', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=570,height=380,top=200,left=200');
 	     	popup.focus();
	}
	
	function launchPop()
	{
		var url = './Security/lostpass.cfm';
		var popup = open(url, 'detail', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=300,height=200,top=200,left=200');
	    popup.focus();
	}
	
	function sendParent(x)
	{
		  url = "main.cfm?content=3&id=" + x;
          opener.location.href = url;
          setTimeout('self.close()',500);
	}
	
	function makeChild(url,name,height,width,sizeable,crap)
	{
		if (sizeable == 1) {sizeable="yes";} else {sizeable="no";}
		if (crap == 1) {crap="yes";} else {crap="no";}
		var winl = (screen.width-width)/2;
		var wint = (screen.height-height)/2;
		options = "toolbar="+crap+",location="+crap+",directories=no,status="+crap+",menubar="+crap+",scrollbars="+sizeable+",resizable="+sizeable+",width="+width+",height="+height+",top="+wint+",left="+winl+"";
		var child = open(url, name, options);
		child.focus();
	}