//--------------------------------------------------------

	win = null;
			
	// create new window l= left, t = top
	function newWindow(url, windowName, w, h) {
		winl = (screen.width - w) / 2;
		wint = (screen.height - h) / 2;
						
		winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',';
		winprops += "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,";
		winprops += "copyhistory=no,alwaysLowered=no,alwaysRaised=no,dependent=no,hotkeys=yes,z-lock=no";
		win = window.open(url, windowName, winprops)
		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
		
	}
	

	// Change the style class
	function changeClass(htmlObj, className)
	{
		try
		{
			htmlObj.className = className;

		} catch (e) {}
	}
	
	
	function FormatExpertDate(element){
		if (element.value == ""){
			return
		}
		
		var d=parseDate(element.value);
		if(d==null){
			element.value = "";
		} else {
			element.value=formatDate(d,'MM/dd/yyyy');
		}	
	}


	// change the visibility style of an object 
	function setVisibility(objectID,state)
	{
		var object = document.getElementById(objectID);
		object.style.visibility = state;
	}
	
	// toggle the visibility style of an object
	function toggleVisibility(objectID)
	{
		var object = document.getElementById(objectID);
		state = object.style.visibility;
		
		if (state == 'hidden'){
			object.style.visibility = 'visible';
		} else {
			if (state == 'visible'){
				object.style.visibility = 'hidden';
			} else {
				object.style.visibility = 'visible';
			}
		}
	}
	
	// change the display style 
	function setDisplay(objectID,state)
	{
		var object = document.getElementById(objectID);
		object.style.display = state;
	}
	
	// toggle the display style of an object
	function toggleDisplay(objectID)
	{
		var object = document.getElementById(objectID);
		state = object.style.display;
		
		if (state == 'none'){
			object.style.display = 'block';
		} else {
			object.style.display = 'none';
		}
	}
	
