// Submit form once
function submitonce(theform){
	if (document.all||document.getElementById) {
		for (i=0;i<theform.length;i++){
			var tempobj=theform.elements[i];
			if(tempobj.type.toLowerCase()=="submit")
				tempobj.disabled=true;
		}
	}
}

// Go to URL from button
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

// Hide/show elements on a page
function toggle(srcElement) {

	if (document.getElementById(srcElement).style.display == "none") {
		document.getElementById(srcElement).style.display = "";		
	} else {
		document.getElementById(srcElement).style.display = "none"		
	}
}

// Highlight whatever we want
function highlight(oldcolor, newcolor, row, pre) {
	if (document.getElementById(pre + row).checked == false) {
		document.getElementById('row' + row).bgColor = oldcolor;
	} else {
		document.getElementById('row' + row).bgColor = newcolor;
	}
}

// Popup windows with parameter properties
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
win=window.open(mypage,myname,settings);}
