/* Set Window Name */
window.name = "main";

function spawnPopup(pageurl,pagetitle,w,h,scroll){
	var win = null;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	parameters = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
	win = window.open(pageurl,pagetitle,parameters);
}

function bookmarkPage(){
	if (document.all){
		window.external.AddFavorite(location.href,document.title);
	}
}

function printPage(){
  window.print();
}

function my_logout() {
	if (confirm('Are you sure you wish to logout?'))
		top.location='http://www.it-director.com/?logout=true';
	return false;
}

function setShowId(element,show) {
	setShow(document.getElementById(element),show);
}

function setShow(element,show) {
	if (show) {
		element.style.display="";
		element.className="";
	} else {
		element.style.display="none";
	}
}

function submitonce(theform){
/*
	Submit Once form validation- 
	© Dynamic Drive (www.dynamicdrive.com)
	For full source code, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/
	//if IE 4+ or NS 6+
	if (document.all||document.getElementById){
		//screen thru every element in the form, and hunt down "submit" and "reset"
		for (i=0;i<theform.length;i++){
			var tempobj=theform.elements[i]
			if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
				//disable em
				tempobj.disabled=true
		}
	}
}