//	center an object to the window
//	horizontally
//	---------------------------------------------------
	function Center_Object(objID) {
		o = document.getElementById(objID);
		var wx = document.body.clientWidth;
		var px = parseInt(((wx - 760) - 20) / 2)
		o.style.left = px;
		o.style.visibility = 'visible';
	}

//	Reset a form
//	---------------------------------------------------
	function Form_Clear(formObj) {
		formObj.reset();
	}
	
//	Submit a form
//	---------------------------------------------------
	function Form_Submit(formObj, dontcheck) {
		if (Form_Check(formObj, dontcheck)) {
			formObj.submit();
		}
		else {
			return false;
		}
	}
	
//	Check a form
//	----------------------------------------------------
	function Form_Check(formobj, dontcheck) {
		var o = formobj;
		for (i=0; i < o.elements.length; i++) {
			if (o.elements.item(i).tagName != 'BUTTON') {
				if ((dontcheck.indexOf(o.elements.item(i).name) == -1)&&(o.elements.item(i).type != 'hidden')) {
					if (o.elements.item(i).value == "") {
						f = o.elements.item(i).title;
						alert(f);
						o.elements.item(i).focus();
						return false;						
					}
				}
			}
		}
		return true;
	}
	
//	display toggle
//	----------------------------------------------------
	function Show_Hide(what) {
		var o = document.getElementById(what);
		if (o.style.display == 'none') {
			o.style.display = '';
		}
		else {
			o.style.display = 'none';
		}
	}

//	visibility toggle
//	----------------------------------------------------
	function Set_Visible(what) {
		var o = document.getElementById(what);
		if (o.style.visibility == 'hidden') {
			o.style.visibility = 'visible';
		}
		else {
			o.style.visibility = 'hidden';
		}
		return true;
	}
	
	
//	disabled / enable form
//	----------------------------------------------------
	function Form_status(formobj, status, dontchange) {
		var o = formobj;
		for (i=0; i < o.elements.length; i++) {
			if ((dontchange.indexOf(o.elements.item(i).name) <= 0)&&(o.elements.item(i).type != 'hidden')) {
					f = o.elements.item(i).disabled = status; 
			}
		}
	}
	
//	open a window
//	----------------------------------------------------
	function newWindow(url, w, h) {
		window.open(url, 'new_window', 'width=' + w + ', height=' + h + ', scrollbars=no');
	}


//	function: swop the hidden class
//	-----------------------------------------------------------------
	function set_display(objid, display) {
		var o = document.getElementById(objid);
		if (o) {
			var c = o.className;
			if (c.indexOf('hidden') >= 0) {
				o.className = c.replace(/hidden/g, display);
			} else {
				o.className = c + ' ' + display;
			}
			return true;
		}
	}
	
//	function: show the finder
//	-----------------------------------------------------------------
	function Show_Finder() {
		var w, h, x, y;
		w = screen.availWidth;
		h = screen.availHeight;
		x = (w - 570) / 2;
		y = (h - 550) / 2;
		window.open('/finder/finder.htm', 'Finder', 'width=570, height=550, top=' + y + ', left=' + x + ', menubar=0, location=0, resizeable=0, scrollbars=1');
	}


