﻿// JScript File
 var ControlToSet;
	var CalWidth=180;
	var StartYear = "";
	var EndYear = "";
	var FormatAs;
	var NN4 = (navigator.appName.indexOf("Netscape")>=0 && !document.getElementById)? true : false;
	var NN6 = (document.getElementById && navigator.appName.indexOf("Netscape")>=0 )? true: false;
	var TOP;
	var LEFT;

	if(NN4)document.captureEvents(Event.MOUSEMOVE);

	document.onmousemove = LogPosition;

	function LogPosition(evt){

	    if (NN4||NN6){
	    LEFT=evt.screenX;
	    TOP=evt.screenY-10;
	    }
	    else{
	    LEFT=event.screenX;
	    TOP=event.screenY-10;
	    }

	}
    function ShowCalendar(CONTROL,START_YEAR,END_YEAR,FORMAT){	
	ControlToSet = eval(CONTROL+'d');
	ControlToSetm = eval(CONTROL+'m');	
	ControlToSety = eval(CONTROL+'y');
	StartYear = START_YEAR;
	EndYear = END_YEAR;
	FormatAs = FORMAT;
	var strFeatures = "width=" + CalWidth + ",height=150" + ",left=" + LEFT + ",top=" + TOP;
	var CalWindow = window.open("js/HTMLCalendar.htm","Calendar", strFeatures)
	CalWindow.focus();
	} 

	function SetDate(DATE){
	if(eval(ControlToSet)){
	var dtarr=DATE.split('/');	
	
	ControlToSet.value = parseInt(dtarr[0],10);
	ControlToSetm.value = dtarr[1];
	ControlToSety.value = dtarr[2].toString();	
	}
	ControlToSet = null;
	StartYear = null;
	EndYear = null;
	FormatAs = null;
	}
	
	function charsponly(e)
	{
		var unicode=e.charCode? e.charCode : e.keyCode
		if(unicode==32 || unicode==46)
		{
		return true;
		}
		else if (unicode!=8)
		{
			if (unicode==13 ||(unicode>64 && unicode<91) || (unicode>96 && unicode<123)|| unicode==9)
			{
			    return true;
			}
			else 
			{
		    	return false;
			}
		}
		
	}
	
	function numbersonly(e)
	{	
		var unicode=e.charCode? e.charCode : e.keyCode			
		if (unicode!=8)
		    {
			    if ((unicode>47 && unicode<58) || unicode==9) 
			    return true;
			    else return false;
		    }
	}

