var menuTimer =null;
var oct = 150;
num = 0;
function showmenu(obj1,obj2,state,location){ 
    var btn=document.getElementById(obj1);
    var obj=document.getElementById(obj2);
    var h=btn.offsetHeight;
    var w=btn.offsetWidth;
    var x=btn.offsetLeft;
    var y=btn.offsetTop;
    
    obj.onmouseover =function(){
        showmenu(obj1,obj2,'show',location);
    }
    obj.onmouseout =function(){
        showmenu(obj1,obj2,'hide',location);
    }
    
    while(btn=btn.offsetParent){y+=btn.offsetTop;x+=btn.offsetLeft;}
    
    var hh=obj.offsetHeight;
    var ww=obj.offsetWidth;
    var xx=obj.offsetLeft;//style.left;
    var yy=obj.offsetTop;//style.top;
    var obj2state=state.toLowerCase();
    var obj2location=location.toLowerCase();
    
    var showx,showy;

    if(obj2location=="left" || obj2location=="l" || obj2location=="top" || obj2location=="t" || obj2location=="u" || obj2location=="b" || obj2location=="r" || obj2location=="up" || obj2location=="right" || obj2location=="bottom"){
        if(obj2location=="left" || obj2location=="l"){showx=x-ww;showy=y;}
        if(obj2location=="top" || obj2location=="t" || obj2location=="u"){showx=x;showy=y-hh;}
        if(obj2location=="right" || obj2location=="r"){showx=x+w;showy=y;}
        if(obj2location=="bottom" || obj2location=="b"){showx=x;showy=y+h;}
    }else{ 
        showx=xx;showy=yy;
    }
    obj.style.left=-12+showx+"px";
    obj.style.top=showy+"px";
    if(state =="hide"){
        menuTimer =setTimeout("hiddenmenu('"+ obj2 +"')", 200);
    }else{
        clearTimeout(menuTimer);
        obj.style.visibility ="visible";
    }
}
function hiddenmenu(psObjId){
    document.getElementById(psObjId).style.visibility ="hidden";
}
function number() {
len = msg.length;
window.status = msg.substring(0, num+1);
num++;
if ( num >= len ) { num = 0 };
window.setTimeout("number();", oct );
} 
function BtWindow(theURL,winName,Wval,Hval)
 { //v2.0无滚动条
  var features;
  var featv;
  features="toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=on, resizable=no,location=no, status=no," + "width="+ Wval + ",height=" + Hval;
  features=features + ",top=" +(window.screen.height-Hval)/2 +",left=" + (window.screen.width-Wval)/2+ "";//弹出屏幕居中
  featv=window.open(theURL,winName,features);
  featv.focus();
  }
function lShowTD(sid)
{
var whichEl = document.getElementById(sid).style;
if (whichEl.display == "none")
{
whichEl.display = "";
}
else
{
whichEl.display = "none";
}
}
function DbShow(sid)
{
whichEl = eval("submenu" + sid);
if (whichEl.style.display == "none")
{
eval("submenu" + sid + ".style.display=\"\";");
var newtext="<img src='images/arrow-r.gif' >"
document.all["Tcon" + sid].innerHTML = newtext;
doiframe("main","510");
}
else
{
eval("submenu" + sid + ".style.display=\"none\";");
var newtext="<img src='images/arrow-l.gif' >"
document.all["Tcon" + sid].innerHTML = newtext;
}
}
function TbShow(sid,tid)
{
whichEl = eval("submenu" + sid);
switch(tid)
   {
   case 1:
     eval("submenu" + sid + ".style.display=\"\";");
     //var newtext="<img src='images/arrow-r.gif' >"
     //document.all["Tcon" + sid].innerHTML = newtext;
	  doiframe("main","510");
     break;
   case 2:
     eval("submenu" + sid + ".style.display=\"none\";");
     //var newtext="<img src='images/arrow-l.gif' >"
     //document.all["Tcon" + sid].innerHTML = newtext;
	 doiframe("main","670");
     break
   }
}
function doiframe(frname,wth) {    

   iframename = frname; 
   if (document.getElementById) pTar = document.getElementById(iframename);    
   else eval("pTar = " + iframename + ";");  
   pTar.width = wth; 
}
function pageName()
    {
        var a = location.href;
        var b = a.split("/");
        var c = b.slice(b.length-1, b.length);
        return c.slice(0, 1);
    }
function writetop()
{
 // var stl= Math.max(document.body.scrollTop,document.documentElement.scrollTop);
  //if(stl ==1){
	document.write ("【<a href='#top' class='ptd'>▲TOP</a>】");
// }
}
function SetHome(obj,vrl){
        try{
                obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);
        }
        catch(e){
                if(window.netscape) {
                        try {
                                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");  
                        }  
                        catch (e)  { 
                                alert("Browser Refused");  
                        }
                        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
                        prefs.setCharPref('browser.startup.homepage',vrl);
                 }
        }
}
function openvideo(Myplayer,vurl) //播短片
{ 
	Myplayer.URL=vurl; 
	Myplayer.controls.play();
} 

