function focusOnFirstFormField() {
	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;
			}
		}
	}
}

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();
	}
}