<!--

//New Function
function checkData(el)
  { var val = el.value.replace(/\D/g,'');
    if(val.length)
      { val = parseInt(val);
	    var ep=document.getElementById('errorPrompt');
	    while(ep.firstChild) ep.removeChild(ep.firstChild);
	    if(/hours/i.test(el.name) && val>=24) 
	      { val = '';
	        ep.appendChild(document.createTextNode('23 hours max'));
	      }
	    if(/minutes/i.test(el.name) && val>=60) 
	      { val = '';
	        ep.appendChild(document.createTextNode('59 minutes max'));
	      }
        val += '';
	  }
	el.value = val;
	if(/hours/i.test(el.name) && el.value.length == 2) el.form.elements['minutes'].focus();
  }
  
  //New Function
  function checkYear(el)
  { var val = el.value.replace(/\D/g,'');
    if(val.length)
      { val = parseInt(val);
	    var ep=document.getElementById('errorPrompt');
	    while(ep.firstChild) ep.removeChild(ep.firstChild);
	    if(/year/i.test(el.name) && val>=3001) 
	      { val = '';
	        //ep.appendChild(document.createTextNode('3000 hours max'));
	      }
		//else if(/year/i.test(el.name) && val<=1899) 
	    //  { val = '';
	    //    ep.appendChild(document.createTextNode('1900 hours min'));
	    //  }
	    val += '';
	  }
	el.value = val;
	//if(/hours/i.test(el.name) && el.value.length == 2) el.form.elements['minutes'].focus();
  }




function checkNumeric(el)
  { var val = el.value.replace(/\D/g,'');
    if(val.length)
      { val = parseInt(val);
	    var ep=document.getElementById('errorPrompt');
	    while(ep.firstChild) ep.removeChild(ep.firstChild);
	    if(/year/i.test(el.name) && val>=3001) 
	      { val = '';
	        //ep.appendChild(document.createTextNode('3000 hours max'));
	      }
		//else if(/year/i.test(el.name) && val<=1899) 
	    //  { val = '';
	    //    ep.appendChild(document.createTextNode('1900 hours min'));
	    //  }
	    val += '';
	  }
	el.value = val;
	//if(/hours/i.test(el.name) && el.value.length == 2) el.form.elements['minutes'].focus();
  }


function myformload(formname) {
		//eval("document."+formname+"."+hiddenformitem+".value=1");
		return eval("document."+formname+".submit();");
		//eval("document."+formname+".reset()");
	
}


	function LeaveFormat(num,max) 
	{
		num = num.toString().replace(/\$|\,/g,'');
		if(isNaN(num))
		num = "0";
		if(isNaN(max))
		max = "0";

		//max = Math.floor(max*100+0.50000000001);
		maxcents = max%100;

		if (num > max)
		num = max;
		sign = (num == (num = Math.abs(num)));
		num = Math.floor(num*100+0.50000000001);
		cents = num%100;


		num = Math.floor(num/100).toString();


		for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
		num = num.substring(0,num.length-(4*i+3))+','+
		num.substring(num.length-(4*i+3));
		//return (((sign)?'':'-') + '$' + num + '.' + cents);

		if(cents > 0 &&  num == 0 )
			cents = "5";
		else if(cents > 0 &&  num < max )
			cents = "5";
		else if(cents > 0 && cents < maxcents)
			cents = "5";
		else
			cents = "0";


		return (((sign)?'':'-') + num + '.' + cents);
		
		
		
	}

var message_window;
var mesg_window_frm;
	
	function my_delete(myurl)
	{
		if(window.confirm('Are you sure you want to DELETE this information? '))
		{
				window.location = myurl;
				//window.location = "employee_staff_ot_summary_new.php?otid=" + myurl;
			
		}
		
	}


var click = 1
var oldctr = 'image'
var oldimage = 'image1'

function flip(ctr,formname,hiddenformitem) {

	if(ctr != oldctr){

		oldctr = ctr

		if (document.images[ctr].name == ctr+'-1' || document.images[ctr].name == ctr){
		click = 1
		}else if(document.images[ctr].name == ctr+'-2'){
		click = 2
		}else{
		//window.alert(document.images[ctr].name);
		click = 3
		}
		//window.alert(document.images[ctr].name);
		//window.alert(click);


	}else{	
		
		click = click + 1
	}

	
	if(click==1){
		//window.alert(ctr);
		 if (document.images)
        		document.images[ctr].src = '../../../images/image2.gif';
			document.images[ctr].name = ctr+'-2';
			eval("document."+formname+"."+hiddenformitem+".value=2");	
		}
	else if(click==2){
		//window.alert(ctr);
		 if (document.images)
        		document.images[ctr].src = '../../../images/image3.gif';
			document.images[ctr].name = ctr+'-3';
			eval("document."+formname+"."+hiddenformitem+".value=3");			
		}
	else if(click==3){
		//window.alert(ctr);	
		click=0
		  if (document.images)
        		document.images[ctr].src = '../../../images/image1.gif';
			document.images[ctr].name = ctr+'-1';
			eval("document."+formname+"."+hiddenformitem+".value=1");		
	}
	//window.alert(document.images[ctr].name);
	//oldimage = document.images[ctr].name

	//window.alert(document.images[ctr].name);
}


	function selectcombo(what, formname, hiddenformitem,myvalue1,myvalue2) {
	selectedValue = what.options[what.selectedIndex].value;
    	//selectedText = what.options[what.selectedIndex].text;
	//window.alert(selectedText);
	//window.alert(selectedValue);
	if (selectedValue == 'Probationary'){
		return eval("document."+formname+"."+hiddenformitem+".value='"+myvalue2+"'");		
		//window.alert(selectedValue);
	}
	else{
		return eval("document."+formname+"."+hiddenformitem+".value='"+myvalue1+"'");		
		//window.alert(selectedValue);

	}
	}

function Disab(val) {
frm=document.forms[0]
frm.ButtonSubmit.disabled=true
}


-->