<!--
function openWindow(ID){
	var popup = window.open("HT_History_Pop_Up.asp#" + ID, "popup", "width=450,height=620,left=20,top=20,scrollbars=1,resizable=1,status=0");
	popup.focus();
}
function imagePopup(url) {
if(document.all)
TheNewWin = window.open(url+'&sh='+screen.height+'&sw='+screen.width,'','fullscreen=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no'); 
else
TheNewWin = window.open(url+'&sh='+window.screen.availHeight+'&sw='+window.screen.availWidth,'','titlebar=no,width=' + window.screen.availWidth+',height='+window.screen.availHeight+',screenX=0,screenY=0')
}
function VotePopup(url,pwidth,pheight) {
var leftPos = (screen.availWidth-pwidth) / 2
var topPos = (screen.availHeight-pheight) / 2 
var vpop = window.open(url,'votepop','width=' + pwidth + ',height=' + pheight + ',scrollbars=yes,resizable=no,status=no,toolbar=no,location=no,top=' + topPos + ',left=' + leftPos);
if (window.focus) vpop.window.focus();
}
function checkField(theForm) {
if (theForm.F.value == "") {
alert("Please enter a value in the provided field before proceeding!.");
theForm.F.focus();
return (false);
}
return (true);
}
function VerifyDelete(URL) {
var verify = confirm("Are you sure you want to permanently delete the selected \"Item\" from the i-Gallery database?  All information will be lost!");
if (verify == true) {
window.open(URL,"_self");
}}
function button_over(eButton){
eButton.style.backgroundColor 	= "#C1D2EE";
eButton.style.borderColor 		= "darkblue darkblue darkblue darkblue";
eButton = null; 
}
function button_out(eButton){
eButton.style.backgroundColor 	= "#EFEFEF";
eButton.style.borderColor 		= "#DDDDDD #DDDDDD #DDDDDD #DDDDDD"; 
}
function button_down(eButton){
eButton.style.backgroundColor 	= "#98B5E2";
eButton.style.borderColor 		= "darkblue darkblue darkblue darkblue";
}
function button_up(eButton){
eButton.style.backgroundColor 	= "#C1D2EE";
eButton.style.borderColor 		= "darkblue darkblue darkblue darkblue";
eButton.style.cursor 			= "hand"; 
}
i = 0;
deg2rad = Math.PI * 2 / 360;
function SetRotation(divID,deg,M11,M12,M21,M22) {
rad = deg * deg2rad;
costheta = Math.cos(rad);
sintheta = Math.sin(rad);
divID.filters.item(0).M11 = costheta;
divID.filters.item(0).M12 = -sintheta;
divID.filters.item(0).M21 = sintheta;
divID.filters.item(0).M22 = costheta;
}
function setScripts() {
self.name = 'igallery';
}
window.onload = setScripts;
//CLIENT SIDE VALIDATION VIA JAVASCRIPT
//--------------------------------------------------------------------------------------------------------------
//PAGE LOADING MODULE

//function StartPage() {
var timerID = null;
var timerRunning = false;
var timeValue = 1000;  //the time increment in mS
var count = 0;
var finish = false;
//load up the images for the progress bar
image00 = new Image(); image00.src='images/loading.gif';
image01 = new Image(); image01.src='images/loading.gif';
image02 = new Image(); image02.src='images/loading.gif';
image03 = new Image(); image03.src='images/loading.gif';
image04 = new Image(); image04.src='images/loading.gif';
image05 = new Image(); image05.src='images/loading.gif';
image06 = new Image(); image06.src='images/loading.gif';
image07 = new Image(); image07.src='images/loading.gif';
image08 = new Image(); image08.src='images/loading.gif';
image09 = new Image(); image09.src='images/loading.gif';
image10 = new Image(); image10.src='images/loading.gif';
//}
//--------------------------------------------------------------------------------------------------------------
function CalYesNo(which) {
var strYes = 0
var strNo = 0
//var strSelectedValue = which.options[which.selectedIndex].value;
var A1NotedADDCK = document.frmAccountAudit.A1NotedADDCK.options[document.frmAccountAudit.A1NotedADDCK.selectedIndex].value;
var A2NotedADDCK = document.frmAccountAudit.A2NotedADDCK.options[document.frmAccountAudit.A2NotedADDCK.selectedIndex].value;
var A3NotedADDCK = document.frmAccountAudit.A3NotedADDCK.options[document.frmAccountAudit.A3NotedADDCK.selectedIndex].value;
var A4NotedADDCK = document.frmAccountAudit.A4NotedADDCK.options[document.frmAccountAudit.A4NotedADDCK.selectedIndex].value;
var A5NotedADDCK = document.frmAccountAudit.A5NotedADDCK.options[document.frmAccountAudit.A5NotedADDCK.selectedIndex].value;
//---------------------------------------------------	
var A1WWW = document.frmAccountAudit.A1WWW.options[document.frmAccountAudit.A1WWW.selectedIndex].value;
var A2WWW = document.frmAccountAudit.A2WWW.options[document.frmAccountAudit.A2WWW.selectedIndex].value;
var A3WWW = document.frmAccountAudit.A3WWW.options[document.frmAccountAudit.A3WWW.selectedIndex].value;
var A4WWW = document.frmAccountAudit.A4WWW.options[document.frmAccountAudit.A4WWW.selectedIndex].value;
var A5WWW = document.frmAccountAudit.A5WWW.options[document.frmAccountAudit.A5WWW.selectedIndex].value;
//---------------------------------------------------	
var A1Where = document.frmAccountAudit.A1Where.options[document.frmAccountAudit.A1Where.selectedIndex].value;
var A2Where = document.frmAccountAudit.A2Where.options[document.frmAccountAudit.A2Where.selectedIndex].value;
var A3Where = document.frmAccountAudit.A3Where.options[document.frmAccountAudit.A3Where.selectedIndex].value;
var A4Where = document.frmAccountAudit.A4Where.options[document.frmAccountAudit.A4Where.selectedIndex].value;
var A5Where = document.frmAccountAudit.A5Where.options[document.frmAccountAudit.A5Where.selectedIndex].value;
//---------------------------------------------------	
var A1How = document.frmAccountAudit.A1How.options[document.frmAccountAudit.A1How.selectedIndex].value;
var A2How = document.frmAccountAudit.A2How.options[document.frmAccountAudit.A2How.selectedIndex].value;
var A3How = document.frmAccountAudit.A3How.options[document.frmAccountAudit.A3How.selectedIndex].value;
var A4How = document.frmAccountAudit.A4How.options[document.frmAccountAudit.A4How.selectedIndex].value;
var A5How = document.frmAccountAudit.A5How.options[document.frmAccountAudit.A5How.selectedIndex].value;
//---------------------------------------------------	
var A1PTPWhen = document.frmAccountAudit.A1PTPWhen.options[document.frmAccountAudit.A1PTPWhen.selectedIndex].value;
var A2PTPWhen = document.frmAccountAudit.A2PTPWhen.options[document.frmAccountAudit.A2PTPWhen.selectedIndex].value;
var A3PTPWhen = document.frmAccountAudit.A3PTPWhen.options[document.frmAccountAudit.A3PTPWhen.selectedIndex].value;
var A4PTPWhen = document.frmAccountAudit.A4PTPWhen.options[document.frmAccountAudit.A4PTPWhen.selectedIndex].value;
var A5PTPWhen = document.frmAccountAudit.A5PTPWhen.options[document.frmAccountAudit.A5PTPWhen.selectedIndex].value;
//---------------------------------------------------	
var A1PTPAmount = document.frmAccountAudit.A1PTPAmount.options[document.frmAccountAudit.A1PTPAmount.selectedIndex].value;
var A2PTPAmount = document.frmAccountAudit.A2PTPAmount.options[document.frmAccountAudit.A2PTPAmount.selectedIndex].value;
var A3PTPAmount = document.frmAccountAudit.A3PTPAmount.options[document.frmAccountAudit.A3PTPAmount.selectedIndex].value;
var A4PTPAmount = document.frmAccountAudit.A4PTPAmount.options[document.frmAccountAudit.A4PTPAmount.selectedIndex].value;
var A5PTPAmount = document.frmAccountAudit.A5PTPAmount.options[document.frmAccountAudit.A5PTPAmount.selectedIndex].value;
//---------------------------------------------------	
var A1PTPHow = document.frmAccountAudit.A1PTPHow.options[document.frmAccountAudit.A1PTPHow.selectedIndex].value;
var A2PTPHow = document.frmAccountAudit.A2PTPHow.options[document.frmAccountAudit.A2PTPHow.selectedIndex].value;
var A3PTPHow = document.frmAccountAudit.A3PTPHow.options[document.frmAccountAudit.A3PTPHow.selectedIndex].value;
var A4PTPHow = document.frmAccountAudit.A4PTPHow.options[document.frmAccountAudit.A4PTPHow.selectedIndex].value;
var A5PTPHow = document.frmAccountAudit.A5PTPHow.options[document.frmAccountAudit.A5PTPHow.selectedIndex].value;
//window.alert (strYes);
//---------------------------------------------------	
if (A1NotedADDCK == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A1NotedADDCK == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A2NotedADDCK == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A2NotedADDCK == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A3NotedADDCK == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A3NotedADDCK == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A4NotedADDCK == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A4NotedADDCK == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A5NotedADDCK == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A5NotedADDCK == "2") { 
	strNo = parseFloat(strNo + 1);
}
//----------------------------------------------------
if (A1WWW == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A1WWW == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A2WWW == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A2WWW == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A3WWW == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A3WWW == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A4WWW == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A4WWW == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A5WWW == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A5WWW == "2") { 
	strNo = parseFloat(strNo + 1);
}
//----------------------------------------------------
if (A1Where == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A1Where == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A2Where == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A2Where == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A3Where == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A3Where == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A4Where == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A4Where == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A5Where == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A5Where == "2") { 
	strNo = parseFloat(strNo + 1);
}
//----------------------------------------------------
if (A1How == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A1How == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A2How == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A2How == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A3How == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A3How == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A4How == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A4How == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A5How == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A5How == "2") { 
	strNo = parseFloat(strNo + 1);
}
//----------------------------------------------------
if (A1PTPWhen == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A1PTPWhen == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A2PTPWhen == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A2PTPWhen == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A3PTPWhen == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A3PTPWhen == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A4PTPWhen == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A4PTPWhen == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A5PTPWhen == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A5PTPWhen == "2") { 
	strNo = parseFloat(strNo + 1);
}
//----------------------------------------------------
if (A1PTPAmount == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A1PTPAmount == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A2PTPAmount == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A2PTPAmount == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A3PTPAmount == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A3PTPAmount == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A4PTPAmount == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A4PTPAmount == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A5PTPAmount == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A5PTPAmount == "2") { 
	strNo = parseFloat(strNo + 1);
}
//----------------------------------------------------
if (A1PTPHow == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A1PTPHow == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A2PTPHow == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A2PTPHow == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A3PTPHow == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A3PTPHow == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A4PTPHow == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A4PTPHow == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (A5PTPHow == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (A5PTPHow == "2") { 
	strNo = parseFloat(strNo + 1);
}
//----------------------------------------------------
TotalYes = strYes
TotalNo = strNo
Total = TotalYes + TotalNo
Score = (strYes/Total) * 100
document.frmAccountAudit.AccountYes.value = TotalYes;
document.frmAccountAudit.AccountNo.value = TotalNo;
document.frmAccountAudit.Total.value = Total;
document.frmAccountAudit.Score.value = Score.toFixed(2);
}
//--------------------------------------------------------
function CalYesNo2(which) {
var strYes = 0
var strNo = 0
//var strSelectedValue = which.options[which.selectedIndex].value;
var Q1 = document.frmCallAudit.Q1.options[document.frmCallAudit.Q1.selectedIndex].value;
var Q2 = document.frmCallAudit.Q2.options[document.frmCallAudit.Q2.selectedIndex].value;
var Q3 = document.frmCallAudit.Q3.options[document.frmCallAudit.Q3.selectedIndex].value;
var Q4 = document.frmCallAudit.Q4.options[document.frmCallAudit.Q4.selectedIndex].value;
var Q5 = document.frmCallAudit.Q5.options[document.frmCallAudit.Q5.selectedIndex].value;
var Q6 = document.frmCallAudit.Q6.options[document.frmCallAudit.Q6.selectedIndex].value;
var Q7 = document.frmCallAudit.Q7.options[document.frmCallAudit.Q7.selectedIndex].value;
var Q8 = document.frmCallAudit.Q8.options[document.frmCallAudit.Q8.selectedIndex].value;
var Q9 = document.frmCallAudit.Q9.options[document.frmCallAudit.Q9.selectedIndex].value;
var Q10 = document.frmCallAudit.Q10.options[document.frmCallAudit.Q10.selectedIndex].value;
var Q11 = document.frmCallAudit.Q11.options[document.frmCallAudit.Q11.selectedIndex].value;
var Q12 = document.frmCallAudit.Q12.options[document.frmCallAudit.Q12.selectedIndex].value;
var Q13 = document.frmCallAudit.Q13.options[document.frmCallAudit.Q13.selectedIndex].value;
var Q14 = document.frmCallAudit.Q14.options[document.frmCallAudit.Q14.selectedIndex].value;
var Q15 = document.frmCallAudit.Q15.options[document.frmCallAudit.Q15.selectedIndex].value;
var Q16 = document.frmCallAudit.Q16.options[document.frmCallAudit.Q16.selectedIndex].value;
var Q17 = document.frmCallAudit.Q17.options[document.frmCallAudit.Q17.selectedIndex].value;
var Q18 = document.frmCallAudit.Q18.options[document.frmCallAudit.Q18.selectedIndex].value;
var Q19 = document.frmCallAudit.Q19.options[document.frmCallAudit.Q19.selectedIndex].value;
var Q20 = document.frmCallAudit.Q20.options[document.frmCallAudit.Q20.selectedIndex].value;

//window.alert (strYes);
//---------------------------------------------------	
if (Q1 == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (Q1 == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (Q2 == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (Q2 == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (Q3 == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (Q3 == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (Q4 == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (Q4 == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (Q5 == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (Q5 == "2") { 
	strNo = parseFloat(strNo + 1);
}

if (Q6 == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (Q6 == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (Q7 == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (Q7 == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (Q8 == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (Q8 == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (Q9 == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (Q9 == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (Q10 == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (Q10 == "2") { 
	strNo = parseFloat(strNo + 1);
}
//----------------------------------------------------
if (Q11 == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (Q11 == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (Q12 == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (Q12 == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (Q13 == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (Q13 == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (Q14 == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (Q14 == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (Q15 == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (Q15 == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (Q16 == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (Q16 == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (Q17 == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (Q17 == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (Q18 == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (Q18 == "2") { 
	strNo = parseFloat(strNo + 1);
}
if (Q19 == "1") { 
	strYes = parseFloat(strYes + 1);
}
if (Q19 == "2") { 
	strNo = parseFloat(strNo + 1);
}

//----------------------------------------------------
TotalYes = strYes
TotalNo = strNo
Total = TotalYes + TotalNo
Score = (strYes/Total) * 100
document.frmCallAudit.CallYes.value = TotalYes;
document.frmCallAudit.CallNo.value = TotalNo;
document.frmCallAudit.Total.value = Total;
document.frmCallAudit.Score.value = Score.toFixed(2);
}
//--------------------------------------------------------
function increment() {
	count += 1;
	if (count == 0) {document.images.bar.src=image00.src;}
	if (count == 1) {document.images.bar.src=image01.src;}
	if (count == 2) {document.images.bar.src=image02.src;}
	if (count == 3) {document.images.bar.src=image03.src;}
	if (count == 4) {document.images.bar.src=image04.src;}
	if (count == 5) {document.images.bar.src=image05.src;}
	if (count == 6) {document.images.bar.src=image06.src;}
	if (count == 7) {document.images.bar.src=image07.src;}
	if (count == 8) {document.images.bar.src=image08.src;}
	if (count == 9) {document.images.bar.src=image09.src;}
	//If you want it to repeat the bar continuously then use this line:
	if (count == 10) {document.images.bar.src=image10.src; count=-1;}
	//If you want it to stop repeating the bar then use this line:
	//if (count == 10) {document.images.bar.src=image10.src; end();}
}

function stopclock() {
	if (timerRunning)
		clearInterval(timerID);
	timerRunning = false;	
}

function end() {
	if (finish == true) {
		stopclock();
		window.close();
	}
	else {
		finish = true; 
	}
}

function startclock() {		
	stopclock();
	timerID = setInterval("increment()", timeValue);
	timerRunning = true;
	document.getElementById('1').style.display = 'none';
	document.getElementById('2').style.display = '';
	document.images.bar.src=image00.src;
}

function Send_onclick(frmSubmit) {
	startclock();
	//frmSubmit.submit();			
}
function Send_onclick2(frmSubmit) {
	startclock();
	//frmSubmit.submit();			
}
//---------------------------------------------------------------------------------

//ZIP MODULE - THIS WILL
function include(lyr,url)
{
   if (document.all)
   {
      // IE version
      try {
      var xml = new ActiveXObject("Microsoft.XMLHTTP");
      xml.Open( "GET", url, false );
      xml.Send()
      document.getElementById(lyr).value=xml.responseText;
       }
      catch (e) {
      var xml = new ActiveXObject("MSXML2.XMLHTTP.4.0");
      xml.Open( "GET", url, false );
      xml.Send()
      document.getElementById(lyr).value=xml.responseText;
	  
      }
   }
   else
   {
      // Mozilla/Netscrap 6+ version
            var xml=new XMLHttpRequest();
            xml.open("GET",url,false);
            xml.send(null);
            document.getElementById(lyr).value=xml.responseText;
   }
}

//--------------------------------------------------------------------------------------------------------------
//START METER TIMER
//THERE ARE 2 TIMERS - 1ST IS JT'S 2ND IS THE USERS
//THIS IS FOR JT - IT LISTS THE USERS TIME IN SECONDS
var milisec = 0;
var seconds = 0;
function DisplayJTS_Timer(){
  if (milisec >= 9){
     milisec = 0
     seconds += 1
  }
  else
     milisec+=1
     document.form1.TheDuration.value = seconds + "." + milisec;
     setTimeout("DisplayJTS_Timer()",100);	 
}
//END JTS FUNCTION
//THIS IS FOR THE USER TO SEE HIS/HER DURATION TIME IN REAL TIME
var timerID = 0;
var tStart  = null;
function UpdateTimer() {
   if(timerID) {
      clearTimeout(timerID);
      clockID  = 0;
   }
   if(!tStart)
      tStart   = new Date();
   var   tDate = new Date();
   var   tDiff = tDate.getTime() - tStart.getTime();
   tDate.setTime(tDiff);
   	document.theTimer.theTime.value = "" + tDate.getMinutes() + ":" + tDate.getSeconds();
   timerID = setTimeout("UpdateTimer()", 1000);
}
function Start() {
   tStart   = new Date();
   document.theTimer.theTime.value = "0";
   timerID  = setTimeout("UpdateTimer()", 1000);   
}
function Stop() {
   if(timerID) {
	  document.theTimer.theTime.value = "00:00";
	  var durationtest = document.form1.TheDuration.value
	  clearTimeout(timerID);
	  clearTimeout(DisplayJTS_Timer);
      timerID  = 0;
	  //I ADDED THIS FOR JUST A TEST
	  //window.alert (durationtest);
   }
   tStart = null;
}
function Reset() {
   tStart = null;
   document.theTimer.theTime.value = "00:00";
   document.form1.TheDuration.value = "00:00";   
   Start();
   DisplayJTS_Timer()   
}
//END TIMER
//--------------------------------------------------------------------------------------------------------------
//THIS IS THE MAXIMIZE WINDOW FUNCTION
//THIS WILL MAXIMIZE THE WINDOW TO WHATEVER RESO YOU HAVE
function maximize() {
if ( !( (navigator.appName.indexOf("Netscape") != -1) && (navigator.appVersion.indexOf("Mac") != -1)))
   {
      window.moveTo(0,0);
      window.resizeTo(screen.availWidth, screen.availHeight);	  
   }
}
//END 
//--------------------------------------------------------------------------------------------------------------
//THIS IS JUST THE NORMAL WINDOW.OPEN FUCNTION
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//END 
//--------------------------------------------------------------------------------------------------------------
//THIS IS JUST A TEST ON THE BATCH ENTRY PAGES
//IF THE USER CLICKS ON ANY LINE ITEM ON THAT PAGE AND IT HAS BEEN UPLOADED THEY WILL GET THIS ALERT
function IsFileUploaded(){
window.alert ("SORRY, THAT BATCH HAS BEEN UPLOADED");
//window.history.go(-1);
}
//END 
//--------------------------------------------------------------------------------------------------------------
//MACROMEDIA FUNCTIONS - THEY DO VARIOUS THINGS BUT MAINLY FOR FORM VALIDATION
function MM_findObj(n, d) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain only numbers.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
//END 
//--------------------------------------------------------------------------------------------------------------
//BELOW IS THE NEWEST FORM OF MACROMEDIA CLIENT SIDE FORM VALIDATION FUNCTIONS
//THESE ARE THE BEST IN THE BIZ
//WE CAN VALIDATE ANYTHING AND EVERYTHING
function WAtrimIt(theString,leaveLeft,leaveRight)  {
  if (!leaveLeft)  {
    while (theString.charAt(0) == " ")
      theString = theString.substring(1);
  }
  if (!leaveRight)  {
    while (theString.charAt(theString.length-1) == " ")
      theString = theString.substring(0,theString.length-1);
  }
  return theString;
}

function WAAddError(formElement,errorMsg,focusIt,stopIt)  {
  if (document.WAFV_Error)  {
	  document.WAFV_Error += "\n" + errorMsg;
  }
  else  {
    document.WAFV_Error = errorMsg;
  }
  if (!document.WAFV_InvalidArray)  {
    document.WAFV_InvalidArray = new Array();
  }
  document.WAFV_InvalidArray[document.WAFV_InvalidArray.length] = formElement;
  if (focusIt && !document.WAFV_Focus)  {
	document.WAFV_Focus = focusIt;
  }

  if (stopIt == 1)  {
	document.WAFV_Stop = true;
  }
  else if (stopIt == 2)  {
	formElement.WAFV_Continue = true;
  }
  else if (stopIt == 3)  {
	formElement.WAFV_Stop = true;
	formElement.WAFV_Continue = false;
  }
}

function WAValidateRQ(formElement,errorMsg,focusIt,stopIt,trimWhite,inputType)  {
  var isValid = true;
  if (!document.WAFV_Stop && !formElement.WAFV_Stop)  {
    if (inputType == "select")  {
	  if (formElement.selectedIndex == -1)  {
	    isValid = false;
	  }
	  else if (!formElement.options[formElement.selectedIndex].value || formElement.options[formElement.selectedIndex].value == "") {
	    isValid = false;
	  }
	}
	else if (inputType == "checkbox")  {
	  if (formElement.length)  {
	    isValid = false;
	    for (var x=0; x<formElement.length ; x++)  {
	      if (formElement[x].checked && formElement[x].value!="")  {
		    isValid = true;
		    break;
		  }
	    }
	  }
      else if (!formElement.checked)
	    isValid = false;
	}
	else if (inputType == "radio")  {
	  isValid = false;
	  if (formElement.checked)
	    isValid = true;
	}
	else if (inputType == "radiogroup")  {
	  isValid = false;
	  for (var x=0; x<formElement.length; x++)  {
	    if (formElement[x].checked && formElement[x].value!="")  {
		  isValid = true;
		  break;
		}
	  }
	  formElement = formElement[0];
	}
	else  {
	  var value = formElement.value;
	  if (trimWhite)  {
	    value = WAtrimIt(value);
	  }
	  if (value == "")  {
	    isValid = false;
	  }
	}
  }
  if (!isValid)  {
    WAAddError(formElement,errorMsg,focusIt,stopIt);
  }
}

function WAAlertErrors(errorHead,errorFoot,setFocus,submitForm)  { 
  if (!document.WAFV_StopAlert)  { 
	  document.WAFV_StopAlert = true;
	  if (document.WAFV_InvalidArray)  {  
	    document.WAFV_Stop = true;
        var errorMsg = document.WAFV_Error;
	    if (errorHead!="")
		  errorMsg = errorHead + "\n" + errorMsg;
		if (errorFoot!="")
		  errorMsg += "\n" + errorFoot;
		document.MM_returnValue = false;
		if (document.WAFV_Error!="")
		  alert(errorMsg.replace(/&quot;/g,'"'));
		else if (submitForm)
		  submitForm.submit();
	    if (setFocus && document.WAFV_Focus)  {
		  document.tempFocus = document.WAFV_Focus;
          setTimeout("document.tempFocus.focus();setTimeout('document.WAFV_Stop = false;document.WAFV_StopAlert = false;',1)",1); 
        }
        else {
          document.WAFV_Stop = false;
          document.WAFV_StopAlert = false;
        }
        for (var x=0; x<document.WAFV_InvalidArray.length; x++)  {
	      document.WAFV_InvalidArray[x].WAFV_Stop = false;
	    }
	  }
	  else  {
        document.WAFV_Stop = false;
        document.WAFV_StopAlert = false;
	    if (submitForm)  {
	      submitForm.submit();
	    }
	    document.MM_returnValue = true;
	  }
      document.WAFV_Focus = false;
	  document.WAFV_Error = false;
	  document.WAFV_InvalidArray = false;
  }
}

function WADateFormat(format,dateVar)  { 
  var fullYear = dateVar.getYear();
  if (fullYear <= 10) fullYear += 2000;
  if (fullYear <= 200) fullYear += 1900;
    dateVar.setYear(fullYear);
  var newDate = format;
  var ampm = "A";
  var ampmReplace = "p";
  var month = dateVar.getMonth() +1;
  var monthName = "January";
  if (month == 2) monthName="February";
  if (month == 3) monthName="March";
  if (month == 4) monthName="April";
  if (month == 5) monthName="May";
  if (month == 6) monthName="June";
  if (month == 7) monthName="July";
  if (month == 8) monthName="August";
  if (month == 9) monthName="September";
  if (month == 10) monthName="October";
  if (month == 11) monthName="November";
  if (month == 12) monthName="December";
  var monthNameReplace = "Month";
  var monthReplace = "m";
  var day = dateVar.getDate();
  var dayReplace = "d";
  var year = dateVar.getYear();
  if (String(year).length > 2)
    year = String(year).substring(year.length-2,year.length);
  var yearReplace = "yy";
  var hour = dateVar.getHours();
  var hourReplace = "h";
  var minute = dateVar.getMinutes();
  if (String(minute).length == 1)
    minute = "0" + minute;
  var minuteReplace = "nn";
  var second = dateVar.getSeconds();
  if (String(second).length == 1)
    second = "0" + second;
  var secondReplace = "ss";
  var timeFormat = "";
  if (format.indexOf(":")>=0)  {
    timeFormat = format.substring(format.indexOf(":"));
	newDate = format.substring(0,format.indexOf(":"));
	timeFormat = newDate.substring(newDate.lastIndexOf(" "))+ timeFormat;
	newDate = newDate.substring(0,newDate.lastIndexOf(" "));
  }
  if (timeFormat.indexOf("h:n")>=0)  {
    if (timeFormat.indexOf("p")>=0)  {
	  if (hour >= 12)  {
	    ampm = "P"
	    if (hour>12)
		  hour = hour -12;
	  }
	  if (timeFormat.indexOf("pm")>=0)  {
	    ampm += "M"
		ampmReplace = "pm"
	  }
	}
	if (timeFormat.indexOf("hh")>=0)  {
	  if (String(hour).length == 1)
        hour = "0" + hour;
	  hourReplace = "hh";
	}
    timeFormat = timeFormat.replace(hourReplace,hour).replace(minuteReplace,minute).replace(secondReplace,second).replace(ampmReplace,ampm);
  }
  if (newDate.indexOf("yy")>=0)  {
	if (newDate.indexOf("yyyy")>=0)  {
	  year = fullYear;
	  yearReplace = "yyyy";
	}
	if (newDate.indexOf("mm")>=0)  {
	  if (String(month).length == 1)
        month = "0" + month;
	  monthReplace = "mm";
	}
	if (newDate.indexOf("dd")>=0)  {
	  if (String(day).length == 1)
        day = "0" + day;
	  dayReplace = "dd";
	}
	newDate = newDate.replace(yearReplace,year).replace(monthReplace,month).replace(dayReplace,day).replace(monthNameReplace,monthName);
  }
  return newDate + timeFormat;
}

function WAValidateDT(formElement,errorMsg,doDate,dateFormat,dateReformat,dateMin,dateMax,doTime,timeFormat,timeReformat,timeMin,timeMax,focusIt,stopIt,required)  {
  var isValid = true;
  var value = formElement.value;
  var Now = new Date();
  var Today = Now;
  Today.setHours(0);
  Today.setMinutes(0);
  Today.setSeconds(0);
  if ((!document.WAFV_Stop && !formElement.WAFV_Stop) && !(!required && value==""))  {
    if (doDate)  {
      if (dateFormat)  {
	    if (value.search(dateFormat)<0)  {
		  isValid = false;
		}
	  }
	  if (isValid)  {
	    var dateVar = new Date(value);
		if (isNaN(dateVar.valueOf()) || (dateVar.valueOf() == 0))
          isValid = false;

        if (dateMin != "")  {
	      var compareDay = new Date(dateMin);
		  if (isNaN(compareDay.valueOf()) || compareDay.valueOf() == 0)  {
		    compareDay = eval(dateMin);
		  }
	      if (dateVar < compareDay)
	        isValid = false;
        }
        if (dateMax != "")  {
	      var compareDay = new Date(dateMax);
		  if (isNaN(compareDay.valueOf()) || compareDay.valueOf() == 0)  {
		    compareDay = eval(dateMax);
		  }
	      if (dateVar > compareDay)
	      isValid = false;
        }
	  }
	}
	if (doTime)  {
      if (timeFormat)  {
	    if (value.search(timeFormat)<0)  {
		  isValid = false;
		}
	  }
	  if (value.indexOf(":")<0)  {
	    isValid = false;
	  }
	  if (isValid)  {
	    var dateVar = new Date(value);
		var fullYear = dateVar.getYear();
		if (isNaN(dateVar.valueOf()) || (dateVar.valueOf() == 0))
          dateVar = new Date("1/1/1 "+value);
        if (isNaN(dateVar.valueOf()) || (dateVar.valueOf() == 0))
          isValid = false;
        if (timeMin != "")  {
	      var Today = new Date(timeMin);
          if (isNaN(Today.valueOf()) || Today.valueOf() == 0)  {
		    Today =  new Date("1/1/1 "+timeMin);
		  }
		  if (isNaN(Today.valueOf()) || Today.valueOf() == 0)  {
		    Today = eval(timeMin);
		  }
	      if (dateVar < Today)
	        isValid = false;
        }
        if (timeMax != "")  {
	      var Today = new Date(timeMax);
		  if (isNaN(Today.valueOf()) || Today.valueOf() == 0)  {
		    Today = new Date("1/1/1 "+timeMax);
		  }
          if (isNaN(Today.valueOf()) || Today.valueOf() == 0)  {
		    Today = eval(timeMax);
		  }
	      if (dateVar > Today)
	        isValid = false;
        }
	  }
	}
    if (!isValid)  {
      WAAddError(formElement,errorMsg,focusIt,stopIt);
    }
    else  {
      var newVal = "";
      if (doDate)  {
	    if (dateReformat!="")  {
	      var newVal = dateReformat;
        }
	    else  {
	      newVal = value;
		  if (newVal.search(/\s*\d*:/)>0)
		    newVal = newVal.substring(0,newVal.search(/\s*\d*:/));
	    }
        if (doTime && timeReformat == "" && value.search(/\s*\d*:/)>0) newVal += value.substring(value.search(/\s*\d*:/));
	  }
      if (doTime)  {
	    if (newVal != "")
	      newVal += " ";
	    if (timeReformat!="")  {
	      newVal += timeReformat;
        }
	    else if (!doDate) {
	      newVal = value;
	    }
	  }
	  formElement.value = WADateFormat(newVal,dateVar);
    }
  }
}

function WAValidateNM(formElement,errorMsg,minLength,maxLength,allowDecimals,roundDecimals,reformatDecimals,punctuationMarks,focusIt,stopIt,required)  {
  var isValid = true;
  var theThousand = punctuationMarks.charAt(0);
  var theDecimal = punctuationMarks.charAt(1);
  var theCheck = 11/10;
  var trueDecimal = (String(theCheck).charAt(1));
  var value = formElement.value;
  var decimalIndex = value.length;
  if (punctuationMarks.indexOf(trueDecimal)<0 && value.indexOf(trueDecimal)>=0)  {
    isValid = false;
  }
  if (value.lastIndexOf(theDecimal)>=0) {
    decimalIndex = value.lastIndexOf(theDecimal);
  }
  while (value.indexOf(theThousand)>=0)  {
    decimalIndex = value.length;
    if (value.lastIndexOf(theDecimal)>=0) {
      decimalIndex = value.lastIndexOf(theDecimal);
    }
    if ((decimalIndex-(value.lastIndexOf(theThousand)+1))%3 != 0)
      isValid = false;
    value = value.substring(0,value.lastIndexOf(theThousand)) + value.substring(value.lastIndexOf(theThousand)+1);
  }
  if (trueDecimal != theDecimal)  {
    while (value.indexOf(theDecimal)>=0)  {
      value = value.substring(0,value.indexOf(theDecimal)) + trueDecimal + value.substring(value.indexOf(theDecimal)+1);
    }
  }
  if ((!document.WAFV_Stop && !formElement.WAFV_Stop) && !(!required && value==""))  {
    for (var x=0; x<value.length; x++)  {
      if  ((value.charAt(x)<0 || value.charAt(x) > 9) && (value.charAt(x) != " " && value.charAt(x) != "," && value.charAt(x) != "."))  {
        isValid = false;
      }
    }
    if (value == "")  {
      isValid = false;
    }
    var oldVal = String(value);
    if (oldVal.indexOf(trueDecimal)>=0)  {
      while (oldVal.charAt(oldVal.length-1)=="0" || oldVal.charAt(oldVal.length-1) == trueDecimal) {
        if (oldVal.charAt(oldVal.length-1) == trueDecimal) {
          oldVal = oldVal.substring(0,oldVal.length-1);
          break;
        }
        else oldVal = oldVal.substring(0,oldVal.length-1);
      }
      if (oldVal.indexOf(trueDecimal)==0)
        oldVal = "0" + oldVal;
    }
    if (String(allowDecimals) !="" )  {
      if (String(value).indexOf(".") > 0 && ((String(value).indexOf(".") + allowDecimals + 2 <= String(value).length) || allowDecimals == 0))  {
        isValid = false;
      }
    }
    value = parseFloat(value);
    if (isNaN(value))  {
      isValid = false;
    }
    else if (String(value).length!=String(oldVal).length) {
      isValid = false;
    }
    else if ((minLength != "" && minLength > value) || (maxLength != "" && maxLength < value)) {
      isValid = false;
    }
  }
  if (!isValid)  {
    WAAddError(formElement,errorMsg,focusIt,stopIt);
  }
  else  {
    if (value != "")  {
      if (roundDecimals != "")  {
        value = Math.round(value*roundDecimals)/roundDecimals;
      }
      if (reformatDecimals != "")  {
        value = String(value);
        if (value.indexOf(trueDecimal)<0)
          value += trueDecimal;
        if (value.indexOf(trueDecimal) < value.length - reformatDecimals)  {
          value = value.substring(0,value.indexOf(trueDecimal) + reformatDecimals + 1);
        }
        else  {
          while (value.indexOf(trueDecimal) > value.length - reformatDecimals - 1)  {
             value += "0";
          }
        }
      }
    }
    if (trueDecimal != theDecimal)  {
      value = String(value);
      while (value.indexOf(trueDecimal)>=0)  {
        value = value.substring(0,value.indexOf(trueDecimal)) + theDecimal + value.substring(value.indexOf(trueDecimal)+1);
      }
    }
    if (roundDecimals != "" || reformatDecimals != "")
      formElement.value = value;
  }
}

function checkFileUpload(form,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight) { //v2.09
  document.MM_returnValue = true;
  for (var i = 0; i<form.elements.length; i++) {
    field = form.elements[i];
    if (field.type.toUpperCase() != 'FILE') continue;
    checkOneFileUpload(field,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight);
} }

function checkOneFileUpload(field,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight) { //v2.09
  document.MM_returnValue = true;
  if (extensions != '') var re = new RegExp("\.(" + extensions.replace(/,/gi,"|").replace(/\s/gi,"") + ")$","i");
    if (field.value == '') {
      if (requireUpload) {alert('File is required!');document.MM_returnValue = false;field.focus();return;}
    } else {
      if(extensions != '' && !re.test(field.value)) {
        alert('This file type is not allowed for uploading.\nOnly the following file extensions are allowed: ' + extensions + '.\nPlease select another file and try again.');
        document.MM_returnValue = false;field.focus();return;
      }
    document.PU_uploadForm = field.form;
    re = new RegExp(".(gif|jpg|png|bmp|jpeg)$","i");
    if(re.test(field.value) && (sizeLimit != '' || minWidth != '' || minHeight != '' || maxWidth != '' || maxHeight != '' || saveWidth != '' || saveHeight != '')) {
      checkImageDimensions(field,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight);
    } }
}

function showImageDimensions(fieldImg) { //v2.09
  var isNS6 = (!document.all && document.getElementById ? true : false);
  var img = (fieldImg && !isNS6 ? fieldImg : this);
  if (img.width > 0 && img.height > 0) {
  if ((img.minWidth != '' && img.minWidth > img.width) || (img.minHeight != '' && img.minHeight > img.height)) {
    alert('Uploaded Image is too small!\nShould be at least ' + img.minWidth + ' x ' + img.minHeight); return;}
  if ((img.maxWidth != '' && img.width > img.maxWidth) || (img.maxHeight != '' && img.height > img.maxHeight)) {
    alert('Uploaded Image is too big!\nShould be max ' + img.maxWidth + ' x ' + img.maxHeight); return;}
  if (img.sizeLimit != '' && img.fileSize > img.sizeLimit) {
    alert('Uploaded Image File Size is too big!\nShould be max ' + (img.sizeLimit/1024) + ' KBytes'); return;}
  if (img.saveWidth != '') document.PU_uploadForm[img.saveWidth].value = img.width;
  if (img.saveHeight != '') document.PU_uploadForm[img.saveHeight].value = img.height;
  document.MM_returnValue = true;
} }

function checkImageDimensions(field,sizeL,minW,minH,maxW,maxH,saveW,saveH) { //v2.09
  if (!document.layers) {
    var isNS6 = (!document.all && document.getElementById ? true : false);
    document.MM_returnValue = false; var imgURL = 'file:///' + field.value.replace(/\\/gi,'/').replace(/:/gi,'|').replace(/"/gi,'').replace(/^\//,'');
    if (!field.gp_img || (field.gp_img && field.gp_img.src != imgURL) || isNS6) {field.gp_img = new Image();
		   with (field) {gp_img.sizeLimit = sizeL*1024; gp_img.minWidth = minW; gp_img.minHeight = minH; gp_img.maxWidth = maxW; gp_img.maxHeight = maxH;
  	   gp_img.saveWidth = saveW; gp_img.saveHeight = saveH; gp_img.onload = showImageDimensions; gp_img.src = imgURL; }
	 } else showImageDimensions(field.gp_img);}
}

function showProgressWindow(progressFile,popWidth,popHeight) { //v2.09
  var showProgress = false, form, field;
  for (var f = 0; f<document.forms.length; f++) {
    form = document.forms[f];
    for (var i = 0; i<form.elements.length; i++) {
      field = form.elements[i];
      if (field.type.toUpperCase() != 'FILE') continue;
      if (field.value != '') {showProgress = true;break;}
  } }
  if (showProgress && document.MM_returnValue) {
    var w = 480, h = 340;
    if (document.all || document.layers || document.getElementById) {
      w = screen.availWidth; h = screen.availHeight;}
    var leftPos = (w-popWidth)/2, topPos = (h-popHeight)/2;
    document.progressWindow = window.open(progressFile,'ProgressWindow','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=' + popWidth + ',height='+popHeight);
    document.progressWindow.moveTo(leftPos, topPos);document.progressWindow.focus();
		window.onunload = function () {document.progressWindow.close();};
} }

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}
//END 
//--------------------------------------------------------------------------------------------------------------
//THATS ALL FOLKS
// -->


