<!--
//[JON] Script to stop users entering info in boxes after 
function InFuture() {
	alert("Sorry, but this day is in the future, and therefore you may not fill in information. Please check that this is the timesheet that you want to fill in.");
	document.frmOnlineTS.Checkbox1.focus();
}

var msgWindow
function newWindow(file,window) {
	LeftPosition=(screen.width)?(screen.width-320)/2:100;
	TopPosition=(screen.height)?(screen.height-320)/2:100;
   if(msgWindow != null && !msgWindow.closed) {msgWindow.close();}
    msgWindow = window.open(file,window,'resizable=yes,width=750,height=550,scrollbars=yes,top='+TopPosition+',left='+LeftPosition+',location=no,directories=no,status=no,menubar=yes,toolbar=no');
    msgWindow.focus();
}

function jTimeConvert(sTime,sFlag) {
// DEON "d" Flag was commented out to force conversion otherwise flag fails and only the second
//DEON half of the function is carried out
// DEON Turns out that the "d" flag was missing from frmonlineTS_submit
	if (sFlag=="d") {
		var nTmp=parseFloat(sTime.substr(sTime.indexOf(".")+1,sTime.length-sTime.indexOf(".")));
		nTmp=nTmp/60;
		//DEON the next three lines are removed to reintroduce rounding but caused the hour portion
		//DEON of times to not be shown , so reintroduced. Note: the rounding had nothing to do with this
		
		sTime=sTime.substr(0,sTime.indexOf("."));
		
		sTime=parseFloat(sTime)+nTmp;
		return sTime;
		
	}
	else {
		var nTmp=parseFloat(sTime.substr(sTime.indexOf(".")+1,sTime.length-sTime.indexOf(".")));
		
		nTmp=nTmp*0.06;
		
		sTime=sTime.substr(0,sTime.indexOf("."));
		
		sTime=parseFloat(sTime)+nTmp;
		return sTime;
	}
}

//******************************************************
// [TOBY] - Limit textbox entries to digits, ':' and '.'
function numbersOnly2() {
	if (((event.keyCode<48)||(event.keyCode>58))&&event.keyCode!=46) {
		alert("Sorry, numbers and ':' only");
	    event.returnValue = false;
	    }
}

function numbersOnly()
{
	if ((event.keyCode < 48) || (event.keyCode > 57)) {
		alert("Sorry, numbers only");
	    event.returnValue = false;
	    }
}

var newWin = null;
function openOrderCalendar(sOrF,frmName)
{
   if(newWin != null && !newWin.closed) {newWin.close();}
   var URL = "includes/calendar.asp?type="  + sOrF + "&form=" + frmName;
   newWin = window.open(URL, frmName+sOrF, 'resizable=yes,scrollbars=yes,dependent=yes,width=300,height=360,screenX=450,screenY=160,titlebar=yes,left=450,top=160');
}

function openOrderCalendarNoHist(sOrF,frmName)
{
   if(newWin != null && !newWin.closed) {newWin.close();}
   var URL = "includes/calendarNoHist.asp?type="  + sOrF + "&form=" + frmName;
   newWin = window.open(URL, frmName+sOrF, 'resizable=yes,scrollbars=yes,dependent=yes,width=300,height=360,screenX=450,screenY=160,titlebar=yes,left=450,top=160');
}

function openOrderCalendarWeDate(sOrF,frmName)
{
   if(newWin != null && !newWin.closed) {newWin.close();}
   var URL = "includes/We_Date_calendar.asp?type="  + sOrF + "&form=" + frmName;
   newWin = window.open(URL,  frmName+sOrF, 'resizable=yes,scrollbars=yes,dependent=yes,width=300,height=360,screenX=450,screenY=160,titlebar=yes,left=450,top=160');
}

function openOrderCalendarTime(sOrF,frmName)
{
   if(newWin != null && !newWin.closed) {newWin.close();}
   var URL = "includes/timestamp.asp?type="  + sOrF + "&form=" + frmName;
   newWin = window.open(URL,  frmName+sOrF, 'resizable=yes,scrollbars=yes,dependent=yes,width=210,height=150,screenX=450,screenY=160,titlebar=yes,left=450,top=160');
}


var helpwin = null;
function helpWindow(filename, windowname)
{
   var leftPosition = (screen.width) ? (screen.width - 320) / 2 : 100;
	var topPosition = (screen.height) ? (screen.height - 320) / 2 : 100;

   if(helpwin != null && !helpwin.closed) {helpwin.close();}
    helpwin = window.open(filename, windowname, 'resizable=yes, width=400,height=300,scrollbars=yes,top=' + topPosition + ',left=' + leftPosition+',location=no,directories=no,status=no,menubar=no,toolbar=no');
    helpwin.focus();
}

var ns4=document.layers
var ns6=document.getElementById&&!document.all
var ie4=document.all
var opr=navigator.userAgent.indexOf("Opera")
var ie = document.all ? true : false;
var showmsg = 1;  //used to show or hide message

function tickinit() {
   setInterval('tick()', 6000);
}

function tick() {
if (ns6||ie4) {
   themenu=ns6? document.getElementById('ticktext'): eval(ticktext)
   //themenu = eval(document.ticktext)
   if (showmsg == 0) { 
      themenu.style.visibility = "visible"; 
      showmsg = 1;
   }
   else {
      themenu.style.visibility = "hidden"; 
      showmsg = 0;
   }
}
else {
   if (showmsg == 0) {
      document.ticktext.visibility = "show";
      showmsg = 1;
   }
   else {
      document.ticktext.visibility = "hide"; 
      showmsg = 0;
   }
}
}

function pagerefresh() {
   document.RefreshForm.submit();
}

function pagetimer() {
   setInterval('pagerefresh()', 150000);
}
//tickinit();
//pagetimer();

//-->
