
function openIT() {
	theURL="equipmentManager.php"
	wname ="CHROMELESSWIN"
	W=400;
	H=200;
	windowCERRARa 		= "img/close_a.gif"
	windowCERRARd 		= "img/close_d.gif"
	windowCERRARo 		= "img/close_o.gif"
	windowNONEgrf 		= "img/none.gif"
	windowCLOCK		= "img/clock.gif"
	windowREALtit		= "  Task title"
	windowTIT 	    	= "<font face=verdana size=1>  Equipment Manager</font>"
	windowBORDERCOLOR   	= "#000000"
	windowBORDERCOLORsel	= "#999999"
	windowTITBGCOLOR    	= "#999999"
	windowTITBGCOLORsel 	= "#333333"
	openchromeless(theURL, wname, W, H, windowCERRARa, windowCERRARd, windowCERRARo, windowNONEgrf, windowCLOCK, windowTIT, windowREALtit , windowBORDERCOLOR, windowBORDERCOLORsel, windowTITBGCOLOR, windowTITBGCOLORsel)
}

function popUp(mypage,w,h, name) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',toolbar=no,scrollbars=yes,menubar=no,resizable=yes'
win = window.open(mypage, name, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function popUpFullScreen(mypage) {
winprops = 'height=screen.availHeight,width=screen.availWidth,top=0,left=0,toolbar=no,scrollbars=yes,menubar=no,resizable=yes'
win = window.open(mypage, '', winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
//onLoad="javascript:window.resizeTo(screen.availWidth, screen.availHeight);window.moveTo(0, 0);window.focus()"

function resize(selectedTab) {
	
	if (navigator.appName == 'Netscape' && document.layers != null) {
		wid = window.innerWidth;
		hit = window.innerHeight;
		
	}
	if (document.all != null){
		wid = document.body.clientWidth;
		hit = document.body.clientHeight;
	}
	//alert ("tet");
	//document.write('Height '+hit+', Width '+wid);
	window.location='index.php?windowWidth='+wid+'&windowHeight='+hit+'&selectedTab=' +selectedTab;
	//document.write('<a href="index.php?windowWidth='+wid+'">another page</a>');
}

function resizeNew(path, selectedTab, dropTabId) {
	
	if (navigator.appName == 'Netscape' && document.layers != null) {
		wid = window.innerWidth;
		hit = window.innerHeight;
	}else{
	//if (document.all != null){

		wid = document.body.clientWidth;
		hit = document.body.clientHeight;
	}
	new Ajax.Updater('tabMenu', path + '/processPage.php?mode=resizeWindow&windowWidth='+wid+'&windowHeight='+hit+'&selectedTab=' + selectedTab + '&dropTabId=' + dropTabId , {asynchronous:true, evalScripts:true });

}


function resizeOuterTo(w,h) {
 if (parseInt(navigator.appVersion)>3) {
   if (navigator.appName=="Netscape") {
    top.outerWidth=w;
    top.outerHeight=h;
   }
   else top.resizeTo(w,h);
 }
}





<!--
/*
This code is from Dynamic Web Coding 
www.dyn-web.com 
Permission granted to use this code as long as this 
entire notice is included.
*/

var origWidth, origHeight;
if (document.layers) {
	//origWidth = window.innerWidth; origHeight = window.innerHeight;
	//window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

var doc_loaded = true;	// set true onload
window.onload = function () {
	doc_loaded = true;	// ready for layers to be shown
// If you want a layer to be visible when the document is loaded, 
// put its id below.	
	//loadLyr('lyr1') ; 
// other onload function calls can go here
	
}

var cur_lyr;
function loadLyr(lyr) {
	if (!doc_loaded) return;
	if (cur_lyr) hide_lyr(cur_lyr);
  cur_lyr = lyr;
	show_lyr(cur_lyr);
}

function show_lyr(lyr) {
	var theLyr = (document.layers)? getLyrRef(lyr,document) : (document.all)? document.all[lyr].style : (document.getElementById)? document.getElementById(lyr).style: null;
	if (!theLyr) return;
	theLyr.zIndex=100;
	theLyr.visibility = "visible";
}

function hide_lyr(lyr) {
	var theLyr = (document.layers)? getLyrRef(lyr,document) : (document.all)? document.all[lyr].style : (document.getElementById)? document.getElementById(lyr).style: null;
	if (!theLyr) return;
	theLyr.zIndex=1;
	theLyr.visibility = "hidden";	
}

// get reference to nested layer for ns4
// from old dhtmllib.js by Mike Hall of www.brainjar.com
function getLyrRef(lyr,doc) {
	if (document.layers) {
		var theLyr;
		for (var i=0; i<doc.layers.length; i++) {
	  	theLyr = doc.layers[i];
			if (theLyr.name == lyr) return theLyr;
			else if (theLyr.document.layers.length > 0) 
	    	if ((theLyr = getLyrRef(lyr,theLyr.document)) != null)
					return theLyr;
	  }
		return null;
  }
}

/* this function shows the hint pop-up when
 user moves the mouse over the link */
function showHint(e,objHint) {
	var posx = 0
	var poxy = 0
	if (!e) var e = window.event;
	if (e.pageX || e.pageY)	{
		posx = e.pageX;
		posy = e.pageY + 35;
	} else if (e.clientX || e.clientY) {
		posx = e.clientX + document.body.scrollLeft;
		posy = e.clientY + document.body.scrollTop + 35;
	}
	objHint.style.display="block";
	/* set the pop-up's left */
	objHint.style.left = posx;
	/* set the pop-up's top */
	objHint.style.top = posy;
}
/* this function hides the hint pop-up when
 user moves the mouse out of the link */
function hideHint(objHint)
{
	/* hide the pop-up */
	objHint.style.display="none";
}





//-->
function showLoading(elementId)
{
	
	showSpinner(elementId);

	return false;

	$(elementId).update("<div style=\"margin: 18px, padding-top: 10px; font-size: 12px;\">Please wait while we proceess your request <span id=\"dots\">.</span></div>");
	window.setTimeout('drawDots(); ', 1000);

}

function drawDots()
{
	if ($('dots'))
	{

		$('dots').innerHTML += '.';
		window.setTimeout('drawDots(); ', 1000);
	}
	return;

}



	function makeAjaxRequest(url, myContainer) {
		
		 new Ajax.Updater(myContainer, url, {asynchronous:true, evalScripts:true});

	}

	function makeAjaxPOSTRequest(action, form, container) {
				
			

	}

	function resetLinks(parent, child){
		var nodeList = $(parent).getElementsByClassName('spanLink');
		var nodes = $A(nodeList);

		nodes.each(function(node){
				node.style.fontWeight ='normal';
				
			});
		$(child).style.fontWeight = 'bold';
	}

	function deleteJobDay(form)
	{
			if(!$F('jobDate')) { alert('doh!'); return false; }

			if(confirm('Delete all jobs from ' + $F('jobDate') + '?')) { 
				$('div1').update(); 
				new Ajax.Updater('div1', 'processWo.php', {asynchronous:true, evalScripts:true, parameters:Form.serialize(form)}); 
			}
	
		
		return false;
	}



/**
 * DHTML date validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */
// Declaring valid date character, minimum year and maximum year
var dtCh= "/";
var minYear=1900;
var maxYear=2100;

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function isDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strMonth=dtStr.substring(0,pos1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert("The date format should be : mm/dd/yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("Please enter a valid date")
		return false
	}
return true
}

function ValidateForm(){
	var dt=document.frmSample.txtDate
	if (isDate(dt.value)==false){
		dt.focus()
		return false
	}
    return true
 }


function changeLocation()
{


	var left = 0;
    var top = 0;

    if (!e) var e = window.event;
    if (e.pageX || e.pageY)     {
        left = e.pageX;
        top = e.pageY;
    }
    else if (e.clientX || e.clientY)     {
        left = e.clientX + document.body.scrollLeft
            + document.documentElement.scrollLeft;
        top = e.clientY + document.body.scrollTop
            + document.documentElement.scrollTop ;
    }




}


function IsNumeric(sText)

{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }

  function showSpinner(element)
  {
		$(element).update('<img src="images/ajax-loader.gif" width="16" height="16" alt="" style="margin: 10px;"/>');	

  }


  /*

	Payroll ajax functions

  */

function showPayrollSelectors(element)
{
  resetLinks('menu' , element); 
  $('searchJobs').style.display = 'none' ; 
  $('divJobSearch').style.display = 'none' ; 
  $('div1').update(); 
  
  new Ajax.Updater('divSelectors', 'processPayroll.php', {
		onLoad: showSpinner('divSelectors'),
		asynchronous:true, 
		evalScripts:true,
		parameters: {mode: 'getPayrollSelectors'} 
	
	});

}

function showAdjustments() {

	new Ajax.Updater('div1', 'processPayroll.php', {
		onLoad: showSpinner('div1'),
		asynchronous:true, 
		evalScripts:true,
		parameters: {mode: 'showAdjustments'} 	
		
	});

}

function showRepeatingAdjustments() {

	new Ajax.Updater('div1', 'processPayroll.php', {
		onLoad: showSpinner('div1'),
		asynchronous:true, 
		evalScripts:true,
		parameters: {mode: 'showRepeatingAdjustments'} 	
		
	});

}