/*
* Really easy field validation with Prototype
* http://tetlaw.id.au/view/javascript/really-easy-field-validation
* Andrew Tetlaw
* Version 1.5.4.1 (2007-01-05)
* 
* Copyright (c) 2007 Andrew Tetlaw
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* 
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* 
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
function MM_jumpMenu(targ,selObj,restore){ 
//v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_confirmation(theURL,recType,record) {
var answer = confirm("Are you sure you want to delete this " + recType + " \"" + record + "\"? This action will permanently delete this " + recType + ".  Please make sure you have exported all the files you need for this event before you delete.")
if (answer){
	alert("The " + recType + " " + record + " was successfully deleted!")
	window.location = theURL;//"http://www.google.com/"
	}
else{
	alert("Deletion Cancelled.")
	}
}

function changedisplay(divid,elid){
	if(divid == 1)
		{
		document.getElementById(elid).style.display="block";
		}
	else
		{
		document.getElementById(elid).style.display="none";
		}	
}

function setValue(field,setval){
  document.getElementById(field).value = setval;
}

/************************************************************************************************************
	(C) www.dhtmlgoodies.com, October 2005
	
	This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.	
	
	Terms of use:
	You are free to use this script as long as the copyright message is kept intact. However, you may not
	redistribute, sell or repost it without our permission.
	
	Thank you!
	
	www.dhtmlgoodies.com
	Alf Magne Kalleland
	
	************************************************************************************************************/		
	var progressbar_steps = 50;	// Total number of progress bar steps.
	
	/* Don't change any of these variables */
 	var dhtmlgoodies_progressPane = false;
	var dhtmlgoodies_progressBar_bg = false;
	var dhtmlgoodies_progressBar_outer = false;
	var dhtmlgoodies_progressBar_txt = false;
	var progressbarWidth;
	var currentStep = 0;
	function moveProgressBar(steps){
		if(!dhtmlgoodies_progressBar_bg){
			dhtmlgoodies_progressPane = document.getElementById('dhtmlgoodies_progressPane');
			dhtmlgoodies_progressBar_bg = document.getElementById('dhtmlgoodies_progressBar_bg');
			dhtmlgoodies_progressBar_outer = document.getElementById('dhtmlgoodies_progressBar_outer');
			dhtmlgoodies_progressBar_txt = document.getElementById('dhtmlgoodies_progressBar_txt');
			progressbarWidth = dhtmlgoodies_progressBar_bg.clientWidth;
		}
		if(!steps){
			dhtmlgoodies_progressBar_outer.style.width = progressbarWidth + 'px';
			dhtmlgoodies_progressBar_txt.innerHTML = '100%';
			setTimeout('document.getElementById("dhtmlgoodies_progressPane").style.display="none"',50);
		}else{
			currentStep+=steps;
			if(currentStep>progressbar_steps)currentStep = progressbar_steps;
			var width = Math.ceil(progressbarWidth * (currentStep / progressbar_steps));
			dhtmlgoodies_progressBar_outer.style.width = width + 'px';
			var percent = Math.ceil((currentStep / progressbar_steps)*100);
			dhtmlgoodies_progressBar_txt.innerHTML = percent + '%';
			if(currentStep==progressbar_steps){
				setTimeout('document.getElementById("dhtmlgoodies_progressPane").style.display="none"',50);
			}
		}
		
	}
	
	/* The function below is only needed for this demo
	
	To move the progress bar , call the function moveProgressBar() 
	
	example: 
	moveProgressBar(1)
	to move it one step.
	
	*/
	function demoProgressBar()
	{
		if(currentStep<progressbar_steps){
			moveProgressBar(1);
			setTimeout('demoProgressBar()',100);
		}
	}
	
function loadXMLDoc(url,sid)
{
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
document.getElementById('content-'+sid).innerHTML=xmlhttp.responseText;
}