
function checkLogon(formobj) {

	if (formobj.username.value == '') {
		alert ('Please enter your username.');
		formobj.username.focus();
		return false;
	}
	if (formobj.password.value == '') {
		alert ('Please enter your password.');
		formobj.password.focus();		
		return false;
	}
	formobj.submit();
}

/* toggle Image via ID */
function togglePixByID(pic, t, onimg, offimg) { 
	if (document.getElementById) { 
		document.getElementById(pic).src = (t? onimg : offimg); 
	} 
}//end function


var curPopupWindow = null;

function openWindow(url, winName, width, height, center, winType) {

   var xposition = 50; // Postions the window vertically in px
   var yposition = 50; // Postions the window horizontally in px
   var location, menubar, resizable, scrollbars, status, titlebar;

   if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
       xposition = (screen.width - 800) / 2;
       yposition = (screen.height - 600) / 2;
   } 
   
   if (winType == "1") {           // winType 1 is for regular popup windows
      location=1;
      menubar=1;
      resizable=1;
      scrollbars=1;
      status=1;
      titlebar=1;
   } else if (winType == "2") {   // winType 2 is for Quick Tour like popups
      location=0;
      menubar=0;
      resizable=0;
      scrollbars=0;
      status=0;
      titlebar=1;
   } else if (winType == "3") {   // winType 3 is for footer like popups
      location=0;
      menubar=0;
      resizable=1;
      scrollbars=1;
      status=0;
      titlebar=1;
   } else if (winType == "4") { // winType 4 sforce footer - no resizing
      location=0;
      menubar=0;
      resizable=0;
      scrollbars=1;
      status=0;
      titlebar=0;
   } else if (winType == "5") {
      location=0;
      menubar=1;
      resizable=0;
      scrollbars=1;
      status=0;
      titlebar=0;
   }else {                       // if no arg is passed for winType
      location=1;
      menubar=1;
      resizable=1;
      scrollbars=1;
      status=1;
      titlebar=1;
   } 
   
   // Features to specify for a new window
   args = "width=" + width + ","
   + "height=" + height + ","
   + "location=" + location + ","
   + "menubar=" + menubar + ","
   + "resizable=" + resizable + ","
   + "scrollbars=" + scrollbars + ","
   + "status=" + status + ","
   + "titlebar=" + titlebar + ","
   + "toolbar=0,"
   + "hotkeys=0,"
   + "screenx=" + xposition + ","  //NN Only
   + "screeny=" + yposition + ","  //NN Only
   + "left=" + xposition + ","     //IE Only
   + "top=" + yposition;           //IE Only
   
	// Performs the opening of the window (and closing of a window already opened for that page).
	if (curPopupWindow != null) {
		curPopupWindow.close();
	}
	
	curPopupWindow = window.open(url, winName, args, false);
	curPopupWindow.focus();
}

/*
function openWindow(url,winName,height,width) {

	window.open(url,winName,"height=" + height + ", width=" + width + ",status=yes,toolbar=no,menubar=no, location=no, resizable=yes,scrollbars=yes");
	//return false;

}*/
function toggleLayer(whichLayer, disp)
{
//alert ("in toggle layer");
var sh_prop = "block";
var hide_prop = "none";
var bname = navigator.appName;
if (bname.search(/microsoft/i) == 0) {
		sh_prop = "block";
}
else {
		sh_prop = "table-row";
}

if (disp == "show") {
	st = sh_prop;
}
else {
	st = hide_prop;
}
//alert(st);
if (document.getElementById)
{
	//alert('in standard');
	// this is the way the standards work
	var style2 = document.getElementById(whichLayer).style;
	//style2.display = style2.display? "":"block";
	style2.display = st;
}
else if (document.all)
{
	//alert('in old');
	// this is the way old msie versions work
	var style2 = document.all[whichLayer].style;
	//style2.display = style2.display? "":"block";
	style2.display = st;
}
else if (document.layers)
{
	//alert('in other');
	// this is the way nn4 works	
	var style2 = document.layers[whichLayer].style;
	//style2.display = style2.display? "":"block";
	style2.display = st;
}
} //end function



function updateContent(d) {
	if ( document.getElementById(d).style.display == "") {
		document.getElementById(d).style.display  = "none";
	}
	else if (document.getElementById(d).style.display == "none")		 {
		document.getElementById(d).style.display = "";
	}
}
