// JavaScript

function createWindow(cUrl,cName,cFeatures) {
var xWin = window.open(cUrl,cName,cFeatures)
}

// Alternative popup script for Postini page
var myWind = null

function popUp(path, popname, w, h) {
        if (navigator.appName == "Microsoft Internet Explorer") 
                if (myWind) {
                        myWind.close() 
                }
        myWind = window.open(path, popname, 'height='+h+',width='+w)
                if (parseInt(navigator.appVersion) >= 4) { 
                        myWind.window.focus() 
                } 
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

// Hide show script for rollover messages
function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

//function CheckKeyReturn() {
// I.E. textboxes: Submits form if captured stroke is a carriage return key
//	if(event.keyCode == 13) {
//	frmMain.submit();//mySubmit(); btnCheck
//	}
//}

//onkeydown="javascript:CheckKeyReturn();"
 
//function KeyReturnToTab() {
// I.E. textboxes: Captures carriage return key and replce with tab key to move to next form field
//	if(event.keyCode == 13){event.keyCode=9;}event.cancelBubble = true;
//}

//function mySubmit() {
//    if (document.LoginForm.username.value == '') {
//        alert('You must enter your username');
//		LoginForm.username.focus();
//        return false;
//    } else if (document.LoginForm.password.value == '') {
//        alert('You must enter a password');
//		LoginForm.password.focus();
//        return false;
//	} else {
//        document.LoginForm.submit();
//    }
//}


// Used Formless template to handle scope since JS in anchor href's in form looking for form scope
// Also, Script sensative to IDs that start with numbers - so name all ids atarting with alpha
function ToggleDisplay(oButton, oItems)
{
	if (oItems.style.display == "none")	{
		oItems.style.display = "";
		oButton.src = "/images/minus.gif";
	}	else {
		oItems.style.display = "none";
		oButton.src = "/images/plus.gif";
	}
	return;
}

function change()	{
	var coll = document.all.tags("DIV");
	if (x!=1){
	{for (i=0; i<coll.length; i++)
		if (coll[i].style.display=='none' && coll[i].id.indexOf("menu")>-1){
			coll[i].style.display='';
		}
	}
	button1.value=" Collapse All "
	x=1
	var coll2 = document.all.tags("IMG");
	{for (i=0; i<coll2.length; i++)
		if (coll2[i].id.indexOf("btns")>-1){
			coll2[i].src='/images/minus.gif';
		}
	}

	}
	else {
	{for (i=0; i<coll.length; i++)
		if (coll[i].style.display=='' && coll[i].id.indexOf("menu")>-1){
			coll[i].style.display='none';
		}
	}
	button1.value=" Expand All "
	x=0
	var coll2 = document.all.tags("IMG");
	{for (i=0; i<coll2.length; i++)
		if (coll2[i].id.indexOf("btns")>-1){
			coll2[i].src='/images/plus.gif';
		}
	}
	}
}

// Functions allow you to click once for one destination, click twice for another
// <a href="javascript:;" onClick="waitForDouble('page1.htm');" onDblClick="doubleClick('page2.htm');"><img src="images/header_admin.jpg" width="205" height="31"></a>
    var noSingle=false;
    var timeout;
    
     function waitForDouble(URL) {
         timeout=setTimeout("singleClick("+URL+")",500);
    }     

     function singleClick(URL) {
         if (noSingle==false) {
              location.href=URL;
         }
         noSingle=false;
         return false;
    }
    function doubleClick(URL) {
         noSingle=true;
         clearTimeout(timeout);
         location.href=URL;
         noSingle=false;
         return false;
    }
