function focusOnFirstFormField() {
	try {
		var forms = document.getElementsByTagName("form");
		if(forms.length>0) {
			var inputs = forms[0].getElementsByTagName("input");
			for(i=0;i<inputs.length;i++) {
				if(inputs[i].type.toLowerCase() == "text") {
					inputs[i].focus();
					break;
				}
			}
		}
	
	}
	catch(e){}
}

var newWindow = null;
function makeWindow(url,width,height){
	//check if window already exists
	if ( !newWindow || newWindow.closed){
		//modify window variables
		var w = width;
		var h = height;
		var x = 100;
		var y = 150;
		if (document.all)
		{
			var xMax = screen.width, yMax = screen.height;
			x = ((xMax/2) - (w/2));
			y = ((yMax/2) - (h/2));
		}
		else if (document.layers) 
		{
			var xMax = window.outerWidth, yMax = window.outerHeight;
			x = ((xMax/2) - (w/2));
			y = ((yMax/2) - (h/2));
		}
		
		options = "screenX=" + x + ",screenY=" + y + ",top=" + y + ",left=" + x + ",toolbar=0,status=0,menubar=0,scrollbars=auto,resizable=0,width=" + w +",height=" + h;
	
		//store new window object in global variable
		newWindow = window.open(url,"modifyWindow",options);
		newWindow.document.close();
	} else {
			//window already exists, so bring it forward
			newWindow.document.close();
			newWindow = window.open(url,"modifyWindow",options);
			newWindow.focus();
	}
}



	function createInnerConfirm(message,title,x,y) {
		var innerWindow = document.createElement("div");
		var windowHeight = 480;
		var windowWidth = 640;
		innerWindow.style.position = "absolute";
		if(typeof window.innerHeight !== 'undefined' && typeof window.innerWidth !== 'undefined' ) {
			windowHeight = window.innerHeight;
			windowWidth = window.innerWidth;
		} else 
		if(typeof document.documentElement.clientHeight !== 'undefined' && typeof document.documentElement.clientWidth !== 'undefined' ) {
			windowHeight = document.documentElement.clientHeight;
			windowWidth = document.documentElement.clientWidth;
		} else 
		if(typeof document.body.clientHeight !== 'undefined' && typeof document.body.clientWidth !== 'undefined' ) {
			windowHeight = document.body.clientHeight;
			windowWidth = document.body.clientWidth;
		}
		
		innerWindow.style.top = parseInt((windowHeight-y)/2,10) + "px";
		innerWindow.style.left = parseInt((windowWidth-x)/2,10) + "px";
		innerWindow.style.width = x+"px";
		innerWindow.style.height = y+"px";
		innerWindow.style.zIndex = "50";
		innerWindow.style.border = "2px solid #0B52A0";
		innerWindow.style.backgroundColor= "#FFFFFF";
		innerWindow.setAttribute("title","title");
		innerWindow.setAttribute("id","innerWindow");
		
		
		var element = document.body.getElementsByTagName("table")[0];
		if(typeof element.style.filter !== 'undefined' ){
			document.body.backgroundColor="teal";
			element.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=50)";
		} else if (typeof element.style.opacity !== 'undefined' ) {
			element.style.opacity = ".5";
		}
	
		innerWindow.style.visibility = "visible";
		//alert("Website: "+location.href.replace(new RegExp("http://([^/]*)/.*"),"$1")+"\nYour Session is about to be timed out.");
		window.focus();
		document.body.appendChild(innerWindow);
		innerWindow.innerHTML += message;
		
	}