var defaultMenuWidth="230px" //set default menu width.
var defaultMenuHeight="35px"

var linkset=new Array()
//SPECIFY MENU SETS AND THEIR LINKS. FOLLOW SYNTAX LAID OUT

linkset[0]='<IFRAME MARGINHEIGHT=0 MARGINWIDTH=0 FRAMEBORDER=0 WIDTH=100% HEIGHT=100% SCROLLING=NO SRC=pop.asp></IFRAME>'

////No need to edit beyond here

var ie5=document.all && !window.opera
var ns6=document.getElementById

if (ie5||ns6)
document.write('<div id="popitmenu" onMouseover="clearhidemenu();" onMouseout="dynamichide(event)"></div>')

function iecompattest(){
return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body
}
function Tlinkset(Tnum,Tnum2){
    if (Tnum==0)
	{
	var showT='<IFRAME MARGINHEIGHT=0 MARGINWIDTH=0 FRAMEBORDER=0 WIDTH=100% HEIGHT=30 SCROLLING=NO SRC=/new_pop.asp?programID='+Tnum2+'&ForenoticeID='+Tnum+'></IFRAME>'
	}else{
    var showT='<IFRAME MARGINHEIGHT=0 MARGINWIDTH=0 FRAMEBORDER=0 WIDTH=100% HEIGHT=130 SCROLLING=NO SRC=/pop_2.asp?programID='+Tnum2+'&ForenoticeID='+Tnum+'></IFRAME>'
	}
	return showT
}
function showmenu(e, which, optWidth, optHeight){
if (!document.all&&!document.getElementById)
return
clearhidemenu()
menuobj=ie5? document.all.popitmenu : document.getElementById("popitmenu")
menuobj.innerHTML=which
menuobj.style.width=(typeof optWidth!="undefined")? optWidth : defaultMenuWidth
//menuobj.style.Height=(typeof optHeight!="undefined")? optHeight : defaultMenuHeight
popitmenu.style.Height=defaultMenuHeight

menuobj.contentwidth=menuobj.offsetWidth
menuobj.contentheight=menuobj.offsetHeight-80

//alert(menuobj.style.Height)

eventX=ie5? event.clientX : e.clientX
eventY=ie5? event.clientY : e.clientY
//Find out how close the mouse is to the corner of the window
var rightedge=ie5? iecompattest().clientWidth-eventX : window.innerWidth-eventX
var bottomedge=ie5? iecompattest().clientHeight-eventY : window.innerHeight-eventY
//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<menuobj.contentwidth)
//move the horizontal position of the menu to the left by it's width
menuobj.style.left=ie5? iecompattest().scrollLeft+eventX-menuobj.contentwidth+"px" : window.pageXOffset+eventX-menuobj.contentwidth+"px"
else
//position the horizontal position of the menu where the mouse was clicked
menuobj.style.left=ie5? iecompattest().scrollLeft+eventX+"px" : window.pageXOffset+eventX+"px"
//same concept with the vertical position
if (bottomedge<menuobj.contentheight)
menuobj.style.top=ie5? iecompattest().scrollTop+eventY-menuobj.contentheight+"px" : window.pageYOffset+eventY-menuobj.contentheight+"px"
else
menuobj.style.top=ie5? iecompattest().scrollTop+event.clientY+"px" : window.pageYOffset+eventY+"px"
menuobj.style.visibility="visible"
return false
}

function contains_ns6(a, b) {
//Determines if 1 element in contained in another- by Brainjar.com
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function hidemenu(){
if (window.menuobj)
menuobj.style.visibility="hidden"
}

function dynamichide(e){
if (ie5&&!menuobj.contains(e.toElement))
hidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
hidemenu()
}

function delayhidemenu(){
delayhide=setTimeout("hidemenu()",500)
}

function clearhidemenu(){
if (window.delayhide)
clearTimeout(delayhide)
}

//********显示打印模版********
//PRT 模版类型 1:按电视台分 ; 2:按节目类型分
//ids 显示打印的节目ID列表
//Pid 节目类型的类型ID 
//zd 是否显示重点节目
//TDD节目显示的时间段  1:00-06   2:06-12    3:12-18   4:18-24
function printPR(PRT,ids,Pid,zd,TDD)
{
   if (PRT==1){
      window.open("print_temp.asp?zd="+zd+"&TDD="+TDD+"&ids="+ids,"PT","width=500,height=600,top=10,left=20,resizable=yes,scrollbars=yes,status=yes");
   }else{
      window.open("print_temp2.asp?zd="+zd+"&TDD="+TDD+"&ParentID="+Pid+"&ids="+ids,"PT","width=500,height=600,top=10,left=20,resizable=yes,scrollbars=yes,status=yes");  
   }
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
if (ie5||ns6)
document.onclick=hidemenu