// JavaScript Document

//Display menu items
menu_status = new Array(); 

function showHide(theid){
    if (document.getElementById) {
    var switch_id = document.getElementById(theid);

        if(menu_status[theid] != 'show') {
           switch_id.className = 'show';
           menu_status[theid] = 'show';
        }else{
           switch_id.className = 'hide';
           menu_status[theid] = 'hide';
        }
    }
}


//checkbox links client mod1
 function link1()
 {if (document.srch.reqesttype)
 location='clsrchpd.php'}
 function link2()
 {if (document.srch.reqesttype)
 location='clsrchdt.php'}
 function link3()
 {if (document.srch.reqesttype)
 location='clsrchrn.php'}
 function link4()
 {if (document.srch.reqesttype)
 location='clsrchcn.php'}
 function link5()
 {if (document.srch.reqesttype)
 location='clsrchinv.php'}
 function link6()
 {if (document.srch.reqesttype)
 location='clreqev.php'}
 
 function select1()
 {if (document.clwlcm.crtreq)
 location='clrequisition.php'}
 function select2()
 {if (document.clwlcm.crtreq)
 location='clsrchac.php'}
 
 
 
 //checkbox links associate mod3
 function select1()
 {if (document.asscwlcm.asscreq)
 location='asscvald.php'}
 function select2()
 {if (document.asscwlcm.asscreq)
 location='asscresult.php'}
 function select3()
 {if (document.asscwlcm.asscreq)
 location='asscemverf.php'}
 function select4()
 {if (document.asscwlcm.asscreq)
 location='asscprdsg.php'}
 function select5()
 {if (document.asscwlcm.asscreq)
 location='asscedudsg.php'}
 function select6()
 {if (document.asscwlcm.asscreq)
 location='assc#.php'}
 function select7()
 {if (document.asscwlcm.asscreq)
 location='assc#.php'}
 function select8()
 {if (document.asscwlcm.asscreq)
 location='asscfinal.php'}
 function select9()
 {if (document.asscwlcm.asscreq)
 location='asscsrchpd.php'}
 function select10()
 {if (document.asscwlcm.asscreq)
 location='asscsrchdt.php'}
 function select11()
 {if (document.asscwlcm.asscreq)
 location='asscsrchcl.php'}
 function select12()
 {if (document.asscwlcm.asscreq)
 location='asscsrchtyp.php'}
 function select13()
 {if (document.asscwlcm.asscreq)
 location='asscsrchrn.php'}
 function select14()
 {if (document.asscwlcm.asscreq)
 location='asscsrchcn.php'}
 
 
 //checkbox links client mod4
 function select1()
 {if (document.invwlcm.invreq)
 location='invsrchdt.php'}
 function select2()
 {if (document.invwlcm.invreq)
 location='invsrchpd.php'}
 function select3()
 {if (document.invwlcm.invreq)
 location='invcrnt.php'}
 function select4()
 {if (document.invwlcm.invreq)
 location='invinvc.php'}
 
 
 //Calendar current date

function showDateTime() {
   var thisDate = new Date();
   var thisWDay=thisDate.getDay();
   var thisDay=thisDate.getDate();
   var thisMonth=thisDate.getMonth();
   var thisYear=thisDate.getFullYear();
   var mName = new Array("January", "February", "March", "April", "May", 
       "June", "July", "August", "September", "October","November", "December");
   var hours=thisDate.getHours();
   var minutes=thisDate.getMinutes();
   ampm = hours >=12 ? " pm" : " am";
   hours = hours > 12 ? hours-12 : hours;
   minutes = minutes < 10 ? "0"+minutes : minutes;
   return mName[thisMonth]+" "+thisDay+", "+thisYear;
}



//menu mod2&5 
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


//clear chek marks on load
function uncheckall() 
{
var ins = document.getElementsByTagName('input');
for (var i=0; i<ins.length; i++) 
{
if (ins[i].getAttribute('type') == 'checkbox') 
{
ins[i].checked = false;
}
}
}

