var highlightcolor="#C4D6DF"

var ns6=document.getElementById&&!document.all
var previous=''
var eventobj

//Regular expression to highlight only form elements
var intended=/INPUT|TEXTAREA|SELECT|OPTION/

//Function to check whether element clicked is form element
function checkel(which){
if (which.style&&intended.test(which.tagName)){
if (ns6&&eventobj.nodeType==3)
eventobj=eventobj.parentNode.parentNode
return true
}
else
return false
}

//Function to highlight form element
function highlight(e){
eventobj=ns6? e.target : event.srcElement
if (previous!=''){
if (checkel(previous))
previous.style.backgroundColor=''
previous=eventobj
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
}
else{
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
previous=eventobj
}
}

var agt = navigator.userAgent.toLowerCase();
var versInt = parseInt(navigator.appVersion);
var is_ie	= ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie3    = (is_ie && (versInt < 4));
var is_ie4    = (is_ie && (versInt == 4) && (agt.indexOf("msie 4")!=-1) );
var is_aol   = (agt.indexOf("aol") != -1);
var is_aol3  = (is_aol && is_ie3);
var is_aol4  = (is_aol && is_ie4);
var is_aol5  = (agt.indexOf("aol 5") != -1);
var is_aol6  = (agt.indexOf("aol 6") != -1);
var is_comp   = (agt.indexOf("compuserve") != -1);
var is_comp2000   = (agt.indexOf("cs") != -1);	 
var is_compie = (is_comp && is_ie);



function HFMA_goTo( url ) {
	window.location.href = url;
}

function HFMA_roofBar( tableCellRef, hoverFlag ) {
	if ( hoverFlag ) {
		if ( document.getElementsByTagName ) {
			tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#c00';
		}
	} else {
		if ( document.getElementsByTagName ) {
			tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#333';
		}
	}
}

function HFMA_roofBarClick( tableCellRef, url ) {
	HFMA_roofBar( tableCellRef, 0 );
	HFMA_goTo( url );
}

function HFMA_navBar( tableCellRef, hoverFlag, navStyle ) {
	if ( hoverFlag ) {
		switch ( navStyle ) {
			case 1:
				tableCellRef.style.backgroundColor = '#005C8A';
//				tableCellRef.style.borderColor = '#663300 #BECCDA #6699CC #663300';
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#fff';
					tableCellRef.getElementsByTagName( 'img' )[0].style.border = '1px solid #036';
				}
				break;
			case 2:
				tableCellRef.style.backgroundColor = '#005C8A';
//				tableCellRef.style.borderColor = '#663300 #BECCDA #6699CC #663300';
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#fff';
					tableCellRef.getElementsByTagName( 'span' )[0].style.border = '1px solid #036';
				}
				break;																				
			default:						
		}
	} else {
		switch ( navStyle ) {
			case 1:
				tableCellRef.style.backgroundColor = '#006699';
//				tableCellRef.style.borderColor = '#f90 #069 #069 #069';
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#C9D4E0';
					tableCellRef.getElementsByTagName( 'img' )[0].style.border = '1px solid #069';					
				}
				break;
			case 2:
				tableCellRef.style.backgroundColor = '#006699';
//				tableCellRef.style.borderColor = '#f90 #069 #069 #069';
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#C9D4E0';
					tableCellRef.getElementsByTagName( 'span' )[0].style.border = '1px solid #069';					
				}
				break;																				
			default:							
		}
	}
}

function HFMA_navBarClick( tableCellRef, navStyle, url ) {
	HFMA_navBar( tableCellRef, 0, navStyle );
	HFMA_goTo( url );
}
