	function showHide(el){
		el		=	document.getElementById(el);
		el.className	=	(el.className == 'hidden')	?	''	:	'hidden';
	}
	
	function checkAll(el){
		var i;
		var arrayofInputs	= document.getElementsByTagName("INPUT");
		if(el.checked == true){
			for(i=0; i < arrayofInputs.length; i++){
				if(arrayofInputs[i].type == 'checkbox') arrayofInputs[i].checked = true;
			}
		}
		else{
			for(i=0; i < arrayofInputs.length; i++){
				if(arrayofInputs[i].type == 'checkbox') arrayofInputs[i].checked = false;
			}
		}
	}
	
	function checkAlls(el){
		var i;
		var arrayofInputs	= document.getElementsByTagName("INPUT");
		if(el.checked == true){
			for(i=0; i < arrayofInputs.length; i++){
				if(arrayofInputs[i].type == 'checkbox'){
					if(el.name=="chkA"){
						if(arrayofInputs[i].name == "approve[]")
							arrayofInputs[i].checked = true;
					}else{
						if(arrayofInputs[i].name == "reject[]")
							arrayofInputs[i].checked = true;
					}
				}
			}
		}
		else{
			for(i=0; i < arrayofInputs.length; i++){
				if(arrayofInputs[i].type == 'checkbox'){
					if(el.name=="chkA"){
						if(arrayofInputs[i].name == "approve[]")
							arrayofInputs[i].checked = false;
					}else{
						if(arrayofInputs[i].name == "reject[]")
							arrayofInputs[i].checked = false;
					}
				}
			}
		}
	}
	
	function checkEmail(field) {
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById(field).value)){
			return (true)
		}
		displayMessage("Please enter a valid email address", 'error');
		return (false)
	}
	
	// function to validate fields in form. picks error message to display from the TITLE attribute
	// does a comparison where necessary with the ALT attribute. 
	// eg. ALT: email cannot be blank. TITLE: please enter a valid email.
	//-------------------- modified aug 27, 2007 by mike ------------------------------------
	// function now accepts fields and messages as parameters (not all form fields use ALT)
	function validateForm(fields, messages, errorField)	{ 
		
		arrfields		=	fields.split("|");
		arrmessages		=	messages.split("|");
				
		for ( i=0; i < arrfields.length; i++ ){	
			thisfield	=	document.getElementById(arrfields[i]);
			fieldtype	=	thisfield.type.toLowerCase();
			if ( thisfield.value == '' ) 	{ 
					thisfield.className = 	'borderme_o';
					displayMessage(arrmessages[i], 'error');
					return false; break; 	
			}else	{	thisfield.className = ''; 	}	
		}
		
	}
	
	function displayMessage(msg,typ){
		msgBox				=	document.getElementById("statosmsg");
		msgBox.className	=	'';
		msgBox.innerHTML	=	msg;			
	}
	
	function setFocus( el ) {	document.getElementById(el).className	=	"setfocus"; }
	function luzFocus( el ) {	document.getElementById(el).className	=	"txtfield"; }
	
	//function to expand & collapse divs
	function expand(ele, linkele, collapseText, expandText){
		if(document.getElementById(ele).className=='expand'){
			document.getElementById(ele).className='collapse';
			document.getElementById(linkele).innerHTML=collapseText;
		}
		else {
			document.getElementById(ele).className="expand"; 
			document.getElementById(linkele).innerHTML=expandText;
		}
	}
	
function displayConfirmation_js(msg, url){
	if(confirm(msg)) { location.href=url; }
		else{ return false; }
}
