<!--

/* This function is only used and overridden in attendance_summary because the dropdown lists 
/* in that page are really close to Pay Period dropdown list, so the Pay Period dropdown list
/* cannot be seen because it is transparent to other dropdown lists on that page. Thus, if the 
/* same situation happens to another page, please go to the attendance_summary.aspx 
/* to copy the function and paste it to that page.
*/	

function HideShowDropList(Obj)
{
  // This function also needs "FindPosition.js" on the page you want to use.
  // Please refer to attendance_summary page, which has an example there.
}

function showMessage()
{
 if (parent.frames['frameTop'] && parent.frames['frameTop'].messageShowed==false)
 {
	 parent.frames['frameTop'].messageShowed=true;
	 openMsg();  
 }
}

function openMsg()
{

  var WW=640, WH=450;
  if (screen.width<=800)
  { WW=760;
   WH=460;
 } 
else if (screen.width<=1024)
{ WW=760;
  WH=460;
} 
var HPos=(screen.width-WW)/2.0;
var VPos=(screen.height-WH)/2.0; 
if (MyWin) {MyWin.close(); MyWin=null; } 
 MyWin = window.open("nova3000PriMsg.aspx","Menu",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,top='+VPos+', left='+HPos+', width='+WW+',height='+WH);

}


function adjustMainTable()
{
 if (getBrowser()!="IE")
 {
   var tbl=getObj("maintable"); 
   if (tbl)
   {
		switch (screen.height.toString())
		{
			case "480" : { tbl.style.height=250; break;}
			case "576" : { tbl.style.height=280; break;}
			case "600" : { tbl.style.height=290; break;}
			case "720" : { tbl.style.height=420; break;}
			case "768" : { tbl.style.height=500; break;}
			case "864" : { tbl.style.height=650; break;}
			case "900" : { tbl.style.height=670; break;}
			case "960" : { tbl.style.height=680; break;}
			case "1024" : { tbl.style.height=730; break;}
			case "1080" : { tbl.style.height=760; break;}
			case "1200" : { tbl.style.height=910; break;}
		}
   }
 }
}


function adjustLoginScr()
{
 if (getBrowser()!="IE")
 {
   var tbl =getObj("loginScrTbl");   
   switch (screen.height.toString())
   {
	case "480" : { tbl.style.height=240; break;}
	case "576" : { tbl.style.height=320; break;}
    case "600" : { tbl.style.height=420; break;}
    case "720" : { tbl.style.height=500; break;}
	case "768" : { tbl.style.height=580; break;}
	case "864" : { tbl.style.height=660; break;}
	case "900" : { tbl.style.height=700; break;}
	case "960" : { tbl.style.height=780; break;}
	case "1024" : { tbl.style.height=820; break;}
	case "1080" : { tbl.style.height=900; break;}
	case "1200" : { tbl.style.height=1020; break;}
   }
       
 }

}

function adjustEWSLoginScr()
{

if (getBrowser()!="IE")
 {
   var tbl =getObj("loginScrTbl");   
   switch (screen.height.toString())
   {
	case "480" : { tbl.style.height=250; break;}
	case "576" : { tbl.style.height=330; break;}
    case "600" : { tbl.style.height=430; break;}
    case "720" : { tbl.style.height=510; break;}
	case "768" : { tbl.style.height=590; break;}
	case "864" : { tbl.style.height=670; break;}
	case "900" : { tbl.style.height=720; break;}
	case "960" : { tbl.style.height=780; break;}
	case "1024" : { tbl.style.height=840; break;}
	case "1080" : { tbl.style.height=900; break;}
	case "1200" : { tbl.style.height=1010; break;}
   }  

 }
}

function init()
{
   MyWin= null; 
   // WF 11/29/06 Add checks to determine if javascript function is usable in user's browser
   if(document.forms[0].attachEvent)
   {
    document.forms[0].attachEvent("onsubmit", submitForm);
   }
   else if(document.forms[0].addEventListener)
   {
    document.forms[0].addEventListener("onsubmit", submitForm, true);
   }
   // document.forms[0].attachEvent("onsubmit", submitForm);
   // EOC
   adjustMainTable();
   if(errorMessage!="")  alert(errorMessage);
   if(jsAfterLoad!='') { eval(jsAfterLoad); jsAfterLoad=''; }  
   showMessage();
}

function formValidation()
{
 return true;
}

function PromptSave()
{
  jsBeforeSubmit='promptSave();'
}

function getBrowser()
{
	if (document.all) return "IE";
	else if (document.layers) return "NN4";
	else if (document.getElementById) return "NN6";
	else  return "";
}

// this is a very powerful tools for pick up object by Name 
// Benjamin Xu   09/26/2003
 
function getObj(name)
{
  if (document.getElementById)  return document.getElementById(name);
  else if (document.all)        return document.all[name];
  else if (document.layers)     return getObjNN4(document,name);
}


function GetTabObject(childID, tagName)
{
	var ArrInput=document.getElementsByTagName(tagName);
	for (var i=0; i< ArrInput.length; i++)
		if (document.all)
		{ 
			if (ArrInput(i).id.indexOf(childID) >=0 ) return ArrInput(i);
		}
		else
		{ 
			if (ArrInput[i].id.indexOf(childID) >=0 ) return ArrInput[i];
		}

} 

function getObjNN4(obj,name)
{
	var x = obj.layers;
	var thereturn;
	for (var i=0;i<x.length;i++)
	{
		if (x[i].id == name)
		 	thereturn = x[i];
		else if (x[i].layers.length)
			var tmp = getObjNN4(x[i],name);
		if (tmp) thereturn = tmp;
	}
	return thereturn;
}


function refreshPP()    //PC - 04/14/2004 - For pay period dropdownlist (Netscape) only 
{
	if ((getBrowser()!="IE") && getObj("hPPDate")) document.forms[0].submit() ;
}


//-->
