var isIE = document.all ? 1 : 0;
var isNS4 = document.layers ? 1 : 0;
var isDOM = document.getElementById ? 1 : 0;
var timer;
var strCurrentCode='';
var strSubCurrentCode='';

function TopNavOver(strNavCode)
{
	clearTimeout(timer);
	var objPointer = GetElement(strNavCode);
	var objSubPointer = GetElement('sub'+strNavCode);
	var objImgPointer = GetElement('img'+strNavCode);
	
	objSubPointer.style.top=parseInt(objPointer.style.top) + parseInt(objPointer.style.height);
	objSubPointer.style.left=parseInt(objPointer.style.left);
	objSubPointer.style.display='inline';
	/*if (!isIE)*/ {objSubPointer.style.visibility='visible';}
	//objImgPointer.src=FadePicture(objImgPointer.src);

	if (strCurrentCode!='' && strCurrentCode!=strNavCode) {HideCurrentMenu()};
	strCurrentCode=strNavCode;
}

function TopNavOut(strNavCode)
{
	var objImgPointer = GetElement('img'+strNavCode);
	objImgPointer.src=UnFadePicture(objImgPointer.src);
	timer=setTimeout("HideCurrentMenu()",1500);			
}

function MenuOver(strNavCode)
{
	clearTimeout(timer);
}

function MenuOut(strNavCode)
{
	clearTimeout(timer);
	timer=setTimeout("HideCurrentMenu()",1500);
}

function SubMenuOver(strSubNavCode)
{
	clearTimeout(timer);
	var objLinkPointer = GetElement('subLink'+strSubNavCode);
	var objSubMenuPointer = GetElement('subMenu'+strSubNavCode);
	var strClassName = objLinkPointer.className + 'highlight';	
	objLinkPointer.className = strClassName;
		
	var agt = navigator.userAgent.toLowerCase();
	objSubMenuPointer.style.top=parseInt(objLinkPointer.style.top);
	
	objSubMenuPointer.style.left=parseInt(objLinkPointer.style.left)+parseInt(objLinkPointer.style.width);
	objSubMenuPointer.style.display='inline';
	/*if (!isIE)*/ {objSubMenuPointer.style.visibility='visible';}
	if (strSubCurrentCode!='' && strSubCurrentCode!=strSubNavCode) {HideCurrentSubMenu()};
	strSubCurrentCode=strSubNavCode;
}

function SubMenuOut(strNavCode)
{
	timer=setTimeout("HideCurrentMenu()",1500);
	var objLinkPointer = GetElement('subLink'+strNavCode);
	var strClassName = objLinkPointer.className;
	var intPos = strClassName.indexOf('highlight',0); 
	objLinkPointer.className = strClassName.substr(0,intPos);
}

function LinkMouseOver(pointer)
{	
	clearTimeout(timer);
	HideCurrentSubMenu();
	var strClassName = pointer.className + 'highlight';
	pointer.className = strClassName;
}

function LinkMouseOut(pointer)
{
	var strClassName = pointer.className;
	var intPos = strClassName.indexOf('highlight',0); 
	pointer.className = strClassName.substr(0,intPos);
	clearTimeout(timer);
	HideCurrentSubMenu();
}

function SubLinkMouseOver(pointer)
{
	var strClassName = pointer.className + 'highlight';
	pointer.className=strClassName;	
}

function SubLinkMouseOut(pointer)
{
	var strClassName = pointer.className;
	var intPos = strClassName.indexOf('highlight',0);	
	pointer.className=strClassName.substr(0,intPos);
}

function HideCurrentMenu()
{
	if (strCurrentCode!='')
	{
		var objSubPointer = GetElement('sub'+strCurrentCode);
		objSubPointer.style.display='none';
		/*if (!isIE)*/ {objSubPointer.style.visibility='hidden';}
		HideCurrentSubMenu();
	}
	strCurrentCode='';
	
}
function HideCurrentSubMenu()
{
	if (strSubCurrentCode!='')
	{
		var objSubPointer = GetElement('subMenu'+strSubCurrentCode);
		objSubPointer.style.display='none';
		/*if (!isIE)*/ {objSubPointer.style.visibility='hidden';}
	}
	strSubCurrentCode='';
}

function GetElement(strObjCode)
{
	var objPointer = isIE ? document.all[strObjCode] : isDOM ? document.getElementById(strObjCode) :  document.layers[strObjCode];
	return objPointer;
}

function FadePicture(strImagePath)
{
	var strTemp=new String(strImagePath);
	if (strTemp.indexOf('fade',0)<0) {
		var intPos=strTemp.lastIndexOf("/",strTemp.length);
		return (strTemp.substr(0,intPos)+ '/fade' + strTemp.substr(intPos+1,strTemp.length-intPos));
	}
	else {
		return (strTemp);
	}
}


function UnFadePicture(strImagePath)
{

	var strTemp=new String(strImagePath);
	var strRegExp=/fade/g;
	return(strTemp.replace(strRegExp,''));
/*	var intPos=strTemp.lastIndexOf("/",strTemp.length);
	return (strTemp.substr(0,intPos)+ '/' + strTemp.substr(intPos+5,strTemp.length-intPos));
*/


}

function openColePoll() {
	window.open("/scripts/poll/colePoll.asp", "ColePoll", "width=413,height=325");
}

function popup(which)
 {
   mywindow = window.open (which,"mywindow");
 }

function richfxpopup(which)
 {
   catalog = window.open (which,"catalog", "width=950,height=600,scrollbars=no,toolbar=no,location=no"); 
   catalog.focus();  
 }
 



