/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// FORCE GET ELEMENT BY ID

if(!document.getElementById) {
	if(document.all) {
		document.getElementById = function() {
			if(typeof document.all[arguments[0]] != "undefined") {
				return document.all[arguments[0]];
			} else { return null; }
		}
	} else if(document.layers) {
		document.getElementById = function() {
			if(typeof document[arguments[0]] != "undefined") {
				return document[arguments[0]];
			} else { return null; }
		}
	}
}

/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////

function showElement(id){
	document.getElementById(id).style.display = "block";
}

function hideElement(id){
	document.getElementById(id).style.display = "none";
}

/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////

function printPage() {
	window.print();  
}

function CheckMaxLength(Object, MaxLen){
	if(Object.value.length > MaxLen){
		Object.value = Object.value.substring(0, MaxLen);
	}
}

function alertCONFIRM(URL){
	var r=confirm("Are you sure you would like to leave CBH?")
	if (r==true){
		window.location=URL;
	}
}

function hiliteDIV(div){
	div.style.backgroundColor = '#ed145a';
}

function getABOUT(){
	try{
		window.document.CBH.SetVariable("loadingNow", "1"); 
	} catch(err){
		//alert(err);
	}
	new Ajax.Updater('mainDIV', 'ajaxABOUT.php', {onComplete:function(){ resetPROGRESS();},asynchronous:true});
}

/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////

function hoverOn(obj, side){
	document.getElementById(side).style.borderBottom = '5px solid #000000';
	if(side == 'right'){
		document.getElementById(side).style.borderRight = '5px solid #000000';
	} else {
		document.getElementById(side).style.borderLeft = '5px solid #000000';
	}
	document.getElementById(side).style.borderTop = '5px solid #000000';
	
	//document.getElementById('rightBottom').style.backgroundColor = '#000000';
}

function hoverOff(obj, side){
	
	document.getElementById(side).style.borderBottom = '5px solid #FFFFFF';
	if(side == 'right'){
		document.getElementById(side).style.borderRight = '5px solid #FFFFFF';
	} else {
		document.getElementById(side).style.borderLeft = '5px solid #FFFFFF';
	}
	document.getElementById(side).style.borderTop = '5px solid #FFFFFF';
	
	//document.getElementById('rightBottom').style.backgroundColor = '#FFFFFF';
}






