function MenuEnter()
{
window.event.srcElement.className="MenuOver";
}
function MenuLeave()
{
window.event.srcElement.className="MenuOut";
}
function MenuDown()
{
window.event.srcElement.className="MenuDown";
}
function CoolMenuControl(){
//-----常规变量---
this.lastScrollX=0;
this.lastScrollY=0;
this.lastScrollW=0;
this.lastScrollH=0;
this.td_X=0;
this.td_Y=0;
this.td_W=0;
this.td_H=0;
this.td=0;
this.mouseon=0;
this.current=null
this.hk_name;
this.hktable_name;
this.menudiv_name;
this.menutable_name;
this.ml=0;
this.menuarray=new Array();
this.speed;
this.href="";
//-----菜单项目---
function menuitem(type,value,url,target){
this.type=type
this.value=value
this.url=url
this.target=target
}
//-----插入菜单---
this.insertmenu=function(type,value,url,target){
this.menuarray[this.menuarray.length]=new menuitem(type,value,url,target)
}
//-----程序初试化---
this.init=function(name,bdc,bgc,speed,Alpha){ 
var inhtml=""
var cellcount=0
var lastcellcount=0
this.hk_name=name+"hk"
this.hktable_name=name+"hktable"
this.menudiv_name=name+"menudiv"
this.menutable_name=name+"menutable"
this.speed=speed
for(i=0;i<this.menuarray.length;i++)
{
if(this.menuarray[i].type=="2") cellcount=cellcount+1
if(this.menuarray[i].type=="1" || this.menuarray[i].type=="0"){cellcount=0}
if(lastcellcount<cellcount){lastcellcount++}
}
stylecode="cursor:hand;filter:Alpha(style=0,opacity="+Alpha+");background:"+bgc
suspendcode="<div id="+this.hk_name+" style='position:absolute' onClick='"+name+".doClick()'>"
+"<table id="+this.hktable_name+" border='1' cellspacing='0' cellpadding='0' style='border-collapse:collapse' bordercolor='"+bdc+"'>"
+"<tr><td style='"+stylecode+"'></td></tr></table></div>";
document.write(suspendcode);
var fcell=true
for(i=0;i<this.menuarray.length;i++)
{
switch(this.menuarray[i].type)
{
case "0":
t=cellcount*2
if(t<=0) 
{
inhtml+='<tr><td colspan=2 onMouseOver=\''+name+'.href="'+this.menuarray[i].url+','+this.menuarray[i].target+'"\'>'+this.menuarray[i].value
}else{
inhtml+='<tr><td colspan='+t+' onMouseOver=\''+name+'.href="'+this.menuarray[i].url+','+this.menuarray[i].target+'"\'>'+this.menuarray[i].value
}
fcell=true
break;
case "1":
t=(cellcount-1)*2
if(t<=0) 
{
inhtml+='<tr><td onMouseOver=\''+name+'.href="'+this.menuarray[i].url+','+this.menuarray[i].target+'"\'>'+this.menuarray[i].value
}else{
inhtml+='<tr><td colspan='+t+' onMouseOver=\''+name+'.href="'+this.menuarray[i].url+','+this.menuarray[i].target+'"\'>'+this.menuarray[i].value
}
fcell=true
break;
case "2":
if(fcell)
{
inhtml+='<tr><td onMouseOver=\''+name+'.href="'+this.menuarray[i].url+','+this.menuarray[i].target+'"\'>'+this.menuarray[i].value;
fcell=false
}else{
inhtml+='<td onMouseOver=\''+name+'.href="'+this.menuarray[i].url+','+this.menuarray[i].target+'"\'>'+this.menuarray[i].value;
}
break;
}
}
inhtml='<div id='+this.menudiv_name+' onmousemove="'+name+'.doOver()">'
+'<table id='+this.menutable_name+' width="100%" border="0" cellspacing="5" cellpadding="5" class="CoolMenu">'
+inhtml
+'</table></div>';
document.write(inhtml);
this.lastScrollX=0;
this.lastScrollY=-4;
this.posXY(eval(this.menutable_name).cells[0])
this.td_W=eval(this.menutable_name).cells[0].scrollWidth+6 
this.td_H=eval(this.menutable_name).cells[0].scrollHeight
setInterval(name+".scrollback()",1)
}
//-----单击超连接---
this.doClick=function(){
var url=this.href.split(",")
if(url[0]=="") return
if(url[1]=="_blank")
{window.open(url[0])}
else
{location.href=url[0]}
}
//-----滑动处理---
this.scrollback=function(){
diffX=this.td_X-3
diffY=this.td_Y-5
diffW=this.td_W
diffH=this.td_H
percentX=this.speed*(diffX-this.lastScrollX);
percentY=this.speed*(diffY-this.lastScrollY);
percentW=this.speed*(diffW-this.lastScrollW);
percentH=this.speed*(diffH-this.lastScrollH);
if(percentX>0)percentX=Math.ceil(percentX);
else percentX=Math.floor(percentX);
if(percentY>0)percentY=Math.ceil(percentY);
else percentY=Math.floor(percentY);
if(percentW>0)percentW=Math.ceil(percentW);
else percentW=Math.floor(percentW);
if(percentH>0)percentH=Math.ceil(percentH);
else percentH=Math.floor(percentH);
eval(this.hk_name).style.pixelTop+=percentY;
eval(this.hk_name).style.pixelLeft+=percentX;
eval(this.hktable_name).style.pixelWidth+=percentW;
eval(this.hktable_name).style.pixelHeight+=percentH;
this.lastScrollX=this.lastScrollX+percentX;
this.lastScrollY=this.lastScrollY+percentY;
this.lastScrollW=this.lastScrollW+percentW;
this.lastScrollH=this.lastScrollH+percentH;
}
//-----滑出---
this.doOver=function(){
if(event.srcElement.tagName=="TD"){
if(event.srcElement.innerText.length==0 || event.srcElement.innerText=="|") return
this.posXY(event.srcElement)
this.td_W=event.srcElement.scrollWidth+6
this.td_H=event.srcElement.scrollHeight
}
}
//-----绝对定位---
this.posXY=function(obj){
hk_left=obj.offsetLeft
hk_top=obj.offsetTop
vParent=obj.offsetParent;
while(vParent.tagName.toUpperCase() != "BODY")
{
hk_left+=vParent.offsetLeft;
hk_top+=vParent.offsetTop;
vParent=vParent.offsetParent;
}
this.td_X=hk_left
this.td_Y=hk_top
}
}
function TabBoxCheck(id){
document.getElementById("TabBoxCheck_1").className="TabBox_2";
document.getElementById("TabBoxCheck_2").className="TabBox_2";
document.getElementById("TabBoxCheck_"+id).className="TabBox_1";
document.getElementById("TabBox_1").style.display="none";
document.getElementById("TabBox_2").style.display="none";
document.getElementById("TabBox_"+id).style.display="";
}
function onChangeForm(){
if(AllSearch.Options.value==0)
AllSearch.action="/News/Search.php";
if(AllSearch.Options.value==1)
AllSearch.action="/House/AgoraSearch.php";
if(AllSearch.Options.value==2)
AllSearch.action="/House/HireSearch.php";
if(AllSearch.Options.value==3)
AllSearch.action="/House/LeaseSearch.php";
if(AllSearch.Options.value==4)
AllSearch.action="/House/SaleSearch.php";
if(AllSearch.Options.value==5)
AllSearch.action="/House/BuySearch.php";
if(AllSearch.Options.value==6)
AllSearch.action="/HR/InviteSearch.php";
if(AllSearch.Options.value==7)
AllSearch.action="/HR/ResumeSearch.php";
if(AllSearch.Options.value==8)
AllSearch.action="/CLass/Search.php";
if(AllSearch.Options.value==9)
AllSearch.action="/Agio/Search.php";
if(AllSearch.Options.value==10)
AllSearch.action="/Media/Search.php";
if(AllSearch.Options.value==11)
AllSearch.action="/Flash/Search.php";
if(AllSearch.Options.value==12)
AllSearch.action="/Pic/Search.php";
if(AllSearch.Options.value==13)
AllSearch.action="/Album/Search.php";
if(AllSearch.Options.value==14)
AllSearch.action="/Ask/Search.php";
if(AllSearch.Options.value==15)
AllSearch.action="/BBS/Search.php";
return true;
}
function findobj(n,d){
var p,i,x;
if(!d) d=document;
if((p=n.indexOf("?"))>0 && parent.frames.length){
d=parent.frames[n.substring(p + 1)].document;
n=n.substring(0,p);
}
if(x != d[n] && d.all) x=d.all[n];
for(i=0; !x && i<d.forms.length;i++) x=d.forms[i][n];
for(i=0; !x && d.layers && i<d.layers.length; i++) x=findobj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n);
return x;
}
function AnnounceMent(){
findobj('AnnounceMent').innerHTML='<marquee style="filter:progid:DXImageTransform.Microsoft.Alpha(startX=0,startY=0,finishX=10,finishY=100,style=1,opacity=0,finishOpacity=100);margin:0px 8px" direction="left" scrollamount="2" scrolldelay="1" onMouseOver="this.stop();" onMouseOut="this.start();">'+
findobj('AnnounceMent').innerHTML+'</marquee>';
findobj('AnnounceMent').style.display='block';
}