// 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(obj) {
	var el = document.getElementById(obj);
	el.style.display = (el.style.display != 'none' ? 'none' : '' );
}
function hideOrShow(obj)
{
if (obj.style.visibility == 'visible') {
cchide(obj);
}
else {
ccshow(obj);
}
}

function ccshow(obj)
{
obj.style.visibility = 'visible';
obj.style.position = 'relative';
}

function cchide(obj)
{
obj.style.visibility = 'hidden';
obj.style.position = 'absolute';
}


// 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;
	}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// 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);}

