 var DOM = document.getElementById ? true : false;
 var nn4 = document.layers ? true : false;
 var ie = document.all ? true : false;

//***************************** Top Pix rollovers ********************************//
//preload
var tpbg_b = new Image();       tpbg_b.src = base_url + "web/images/tf/tp_bg_h.gif";
var tpbg_ls = new Image();      tpbg_ls.src = base_url + "web/images/tf/tp_bg_lasth.gif";

function getElement(name) {
        if (!nn4) {
                if (eval(document.all)) { return document.all[name]; }
                else { return document.getElementById(name);}
        }
}

function pixHover(ObjNum, state){
        if (state) {// hover
                obj = getElement("tPix"+ObjNum);
                if (!nn4) {
                	if (ObjNum!=9) obj.style.backgroundImage='url('+ tpbg_b.src +')';
                        else obj.style.backgroundImage='url('+ tpbg_ls.src +')';
                }
        }
        else {
                var Imsrc = base_url + 'web/images/tf/tp_bg' + ObjNum + '.gif';
                obj = getElement("tPix"+ObjNum);
                if (!nn4) obj.style.backgroundImage='url(' + Imsrc + ')';
        	}
}

//************************ Flyouts on channel menu *******************************//
 var layerOn = '';
 var timeOn = null;
 
var flowoutsY= 501;
var flowoutsX = 770;
 		
function getObj(name) {
  if(DOM) return document.getElementById(name).style;
  else if(ie) return eval('document.all.' + name + '.style;');
  else if(nn4) return eval('document.' + name);
  return null;
} // getObj
 
// Shows drop down menu
function showLayer(layerName) {
	if(ie || DOM) flowoutsX = document.body.clientWidth;
	else flowoutsX = window.innerWidth-16;
	if(flowoutsX < 770) flowoutsX = 770;
	var flowoutsX= Math.ceil(flowoutsX/2) - 215; //
	
	if (layerOn != '') { 
		menuOver();
		hideLayer(layerOn);
	} // if layerOn
	
	FlyOutId = "Fly_" + layerName;
	thisLayer = getObj(FlyOutId);
	for(var j=0; j<flowouts.length; j++ ) {
		if (flowouts[j]==FlyOutId) break; }
	eval('document.'+lmbuttons[j]+'.src=roi'+layerName+'.src;');
	
	if(thisLayer != null) { 
	thisLayer.left = flowoutsX;
	thisLayer.top = flowoutsY + j*21;
	thisLayer.visibility = "visible"; }
	layerOn = layerName;
  
} // showLayer
// Pause layer before hiding on mouseOut
function btnTimer(layerName) {
 	timeOn = setTimeout("btnOut()",600);
	layerLeaving = layerName;
}
// Calls hide layer function after pause
function btnOut() {
	hideLayer(layerLeaving);
	layerOn = '';
} // btnOut

// Hides layer
function hideLayer(layerName) {
  for(var f=0; f<flowouts.length; f++) {
  FlyOutName = "Fly_" + layerName;
  if(flowouts[f]==FlyOutName)  { 
	 var mainimg = (f==0)? 'web/images/tf/lmb_home1.png";' : 'image.aspx?menu=1&channel_id='+ layerName +'&image=tf1.gif&color=FFFFFF";';
	 eval('document.'+lmbuttons[f]+'.src="'+ base_url + mainimg); 

  }
  thisLayer=getObj(flowouts[f]);
  if(thisLayer != null) thisLayer.visibility = "hidden";
  } 
} // hideLayer

// Stops Layer from hiding if mouseOver is on drop down menu
function menuOver() {
	if(timeOn != null) clearTimeout(timeOn);
} // menuOver

function openSendToFriend(URL) {
}

function DisplayBanners() {
	for (jj = 1; jj < 5; jj++) {
		BannWrapDivName = "HiddBannAd:" + jj;
		BannWrapDiv = getElement(BannWrapDivName);
		if (BannWrapDiv) BannWrapDiv.style.display = '';
	}
}	

