// Browser Detection code

AS_DOM = (document.getElementById) ? true : false;
AS_NS4 = (document.layers) ? true : false;
AS_IE = (document.all) ? true : false;
AS_IE4 = AS_IE && !AS_DOM;
AS_Mac = (navigator.appVersion.indexOf("Mac") != -1);
AS_IE4M = AS_IE4 && AS_Mac;
AS_IsMenu = (AS_DOM || AS_NS4 || (AS_IE4 && !AS_IE4M));

AS_BrowserString = AS_NS4 ? "NS4" : AS_DOM ? "DOM" : "IE4";

// End of Browser Detection code

if(window.event + "" == "undefined") event = null;
function AS_f_PopUp(){return false};
function AS_f_PopDown(){return false};
popUp = AS_f_PopUp;
popDown = AS_f_PopDown;


///////************** The code below is added by Praveen ************//////////
///////--------------------- For Tracking mouse movement Starts --------------------//////////
var IsNS = false;
var ClientX, ClientY
if(navigator.appName.indexOf("Netscape") != -1){
	IsNS = true;
}else{
	IsIE = true;
}

function TrackMousePos(e){
	if(IsNS){
		ClientX = e.screenX;
		ClientY = e.screenY;
	}else{
		ClientX = event.screenX;
		ClientY = event.screenY;
	}
}

if(IsNS){
	window.captureEvents(Event.MOUSEMOVE);
	window.onmousemove=TrackMousePos;
}else{
	document.onmousemove=TrackMousePos;
}
///////--------------------- For Tracking mouse movement Ends --------------------//////////

///////-------------------- For calling Calendar window Starts --------------------//////////
function CallCal(dt){
	setDateField(dt);
	newWin = window.open('calendar.html', 'cal', 'width=170,height=200')
	newWin.moveTo(ClientX, ClientY);
}
///////-------------------- For calling Calendar window Ends --------------------//////////

///////-------------------- For selecting all checkboxes Starts --------------------//////////
function SelectAllCB(frm, state){
	if(state == true){
		for(i=0; i<frm.elements.length; i++){
			if(frm.elements[i].type == "checkbox"){
				frm.elements[i].checked = true;
			}
		}
	}else{
		//uncheck all
		for(i=0; i<frm.elements.length; i++){
			if(frm.elements[i].type == "checkbox"){
				frm.elements[i].checked = false;
			}
		}
	}
}
///////-------------------- For selecting all checkboxes Ends --------------------//////////

///////--------------- For controlling Show / Hide of forms Starts ----------------//////////
function ShowHide(ID, state){
	if(IsNS){
		ShowHideNet(ID, state);
	}else{
		ShowHideIE(ID, state);
	}
}

function ShowHideNet(LayerName, state){
	if(document.layers){
		if(document.layers[LayerName])
		document.layers[LayerName].hidden=state;
	}
}

function ShowHideIE(StyleID, state){
	if(state == true){
		if(document.all){
			if(document.all[StyleID])
			document.all[StyleID].className="h";
		}
	}else{
		if(document.all){
			if(document.all[StyleID])
			document.all[StyleID].className="s";
		}
	}
}
///////--------------- For controlling Show / Hide of forms Starts ----------------//////////

///////************** The code above is added by Praveen ************//////////
