// JavaScript Document
function getobj(name) {
	if (document.getElementById) { // DOM3 = IE5, NS6
		return document.getElementById(name)
	}
	else {	
		if (document.layers) { // Netscape 4
			return document(name)
		}
		else { // IE 4
			return document.all(name)
		}
	}
}

function doDelete(p_url){
	question=confirm("You really want to delete this item ?")
	if(question !="0"){
		 window.location=p_url;
	}
		
}   	
function doGoback(){
	question=confirm("You really want to cancel ? You will lose your changes!")
	if(question !="0"){
		 history.go(-1);
	}
		
}
function navBar( tableCellRef, hoverFlag, navStyle ) {
	if ( hoverFlag ) {
		switch ( navStyle ) {
			case 1:
//This defines rollover color
				tableCellRef.style.backgroundColor = '#CCCCFF';
				break;
			default:
//tableCellRef.style.backgroundColor = '#ccc';
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#fff000';
				}
		}
	} else {
		switch ( navStyle ) {
			case 1:
//This defines return color
				tableCellRef.style.backgroundColor = '';
				break;
			default:
//tableCellRef.style.backgroundColor = '#ddd';
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#00ff89';
				}
		}
	}
}

function checkForm(theFormName) {
	theForm = getobj(theFormName);
  	for (e=0;e<theForm.elements.length- 1;e++) {			
		if (theForm.elements[e].required=='yes') {		  
			  if (theForm.elements[e].value == '') {
				  alert('One or more fields need to be set ! (' + theForm.elements[e].name + ')');
				  theForm.elements[e].focus();
				  return false;
			  }
		}
    }
	return true;
}