	
	//functions.js
	
	//Create a boolean variable to check for a valid MS instance.
	var xmlhttp = false;
	
	//Check if we are using IE.
	try {
		//If the javascript version is greater than 5.
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		//If not, then use the older active x object.
		try {
			//If we are using IE.
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			//Else we must be using a non-IE browser.
			xmlhttp = false;
		}
	}
	
	//If we are using a non-IE browser, create a javascript instance of the object.
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	
	//A variable used to distinguish whether to open or close the calendar.
	var showOrHide = true;
	
	function runajax(e, objID, serverPage) {
		
		//Create a boolean variable to check for a valid Internet Explorer instance.
		var xmlhttp = false;
		
		//Check if we are using IE.
		try {
			//If the javascript version is greater than 5.
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			//If not, then use the older active x object.
			try {
				//If we are using Internet Explorer.
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
				//Else we must be using a non-IE browser.
				xmlhttp = false;
			}
		}
		//If we are using a non-IE browser, create a javascript instance of the object.
		if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
			xmlhttp = new XMLHttpRequest();
		}
		
		/* new code added for positioning*/
		theObject = document.getElementById("big");
		
		theObject.style.visibility = "visible";
		theObject.style.height = "80px";
		theObject.style.width = "175px";
		
		var posx = 0;
		var posy = 0;
		
		//i = document.getElementById("SMI");
		
		posx = e.clientX + document.body.scrollLeft - 175;
		posy = e.clientY + document.body.scrollTop;
		
		//posx = i.image.offsetLeft + 90;
		//posy  =i.image.offsetTop;
		
		theObject.style.left = posx + "px";
		theObject.style.top = posy + "px";
		/* the new code ends here */
		
		var obj = document.getElementById(objID);
		xmlhttp.open("GET", serverPage);
		obj.innerHTML = "";
		xmlhttp.onreadystatechange = function() {
			if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
				//obj.innerHTML = xmlhttp.responseText;
				obj.innerHTML = "Download Complete";
			}
		}
		xmlhttp.send(null);
	}
	
	function findPosX(obj){
		var curleft = 0;
		if (obj.offsetParent){
			while (obj.offsetParent){
				curleft += obj.offsetLeft
				obj = obj.offsetParent;
			}
		} else if (obj.x){
			curleft += obj.x;
		}
		return curleft;
	}
	
	function findPosY(obj){
		var curtop = 0;
		if (obj.offsetParent){
			while (obj.offsetParent){
				curtop += obj.offsetTop
				obj = obj.offsetParent;
			}
		} else if (obj.y){
			curtop += obj.y;
		}
		return curtop;
	}
	
	function closetask (){
		
		theObject = document.getElementById("big");
		
		theObject.style.visibility = "hidden";
		theObject.style.height = "0px";
		theObject.style.width = "0px";
		
		acObject = document.getElementById("autocompletediv");
		
		acObject.style.visibility = "hidden";
		acObject.style.height = "0px";
		acObject.style.width = "0px";
	}