function s(id,title){document.CitySearch.TID.value=id;document.CitySearch.BQName.value=title;ShowHiddenCityList();return false}

function ShowHiddenCityList(){var a=document.getElementById("divCityList");if(a.style.display!="none"){a.style.display="none"}else{a.style.display="block"}}

function StopPropagation(a){if(!a)a=window.event;if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true}

function ShowHiddenMessTopList(){var a=document.getElementById("Mess_Top_List");if(a.style.display!="none"){a.style.display="none"}else{a.style.display="block"}}

function MM_findObj(n, d) { //v4.01
  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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function setUserTab(name,cursel,n,ID,IDD,IDDD,key){
for(i=0;i<=n;i++){
var menu=document.getElementById(name+i);
var con=document.getElementById("News_"+name+"_"+i);
//var me=document.getElementById("con_menu_"+i);
menu.className=i==cursel?"UserTopMenuA":"UserTopMenuB";
con.style.display=i==cursel?"block":"none";
con.innerHTML=i==cursel?"<IFRAME name='News.list"+i+"' ID='News.list"+i+"' SRC='/News/News.List.asp?TID="+ID+"&TTID="+IDD+"&TTTID="+IDDD+"&Keyword="+key+"' FRAMEBORDER='0' SCROLLING='no' WIDTH='100%' HEIGHT='100%'></IFRAME>":"";
//me.style.display=i==cursel?"block":"none";
}
}


function setiUserTab(name,cursel,n,ID){
for(i=0;i<=n;i++){
var menu=document.getElementById(name+i);
var con=document.getElementById("News_"+name+"_"+i);
//var me=document.getElementById("con_menu_"+i);
menu.className=i==cursel?"UserTopMenuC":"UserTopMenuD";
con.style.display=i==cursel?"block":"none";
con.innerHTML=i==cursel?"<IFRAME name='News.list"+i+"' ID='News.list"+i+"' SRC='/Home/News.List.asp?TT="+ID+"' FRAMEBORDER='0' SCROLLING='no' WIDTH='100%' HEIGHT='100%'></IFRAME>":"";
//me.style.display=i==cursel?"block":"none";
}
}


function setGUserTab(name,cursel,n){
for(i=0;i<=n;i++){
var menu=document.getElementById(name+i);
var con=document.getElementById("News_"+name+"_"+i);
//var me=document.getElementById("con_menu_"+i);
menu.className=i==cursel?"UserTopMenuC":"UserTopMenuD";
con.style.display=i==cursel?"block":"none";
//me.style.display=i==cursel?"block":"none";
}
}


function setMessTopTab(name,cursel,n){
for(i=1;i<=n;i++){
var menu=document.getElementById(name+i);
var con=document.getElementById("Mess_"+name+i);
menu.className=i==cursel?"Mess_Top_Menu1":"Mess_Top_Menu2";
con.style.display=i==cursel?"block":"none";
}
}


function setMessTopListTab(name,cursel,n){
for(i=1;i<=n;i++){
var menu=document.getElementById(name+i);
var con=document.getElementById("Mess_"+name+i);
menu.innerHTML=i==cursel?"<FONT face=webdings>6</FONT>":"<FONT face=webdings>4</FONT>";
con.style.display=i==cursel?"block":"none";
}
}


var lastID = "";//声明上次取回的消息的ID
var mGetTime;//设置setTimeout的返回值
// 通过封装getAjax()方法创建XMLHTTPRequest对象
function getAjax()
{
    var ajax=false;
    try{
        ajax = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
        try{
            ajax = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(E){
            ajax = false;
        }
    }
    if(!ajax && typeof XMLHttpRequest!='undefined'){
        ajax = new XMLHttpRequest();
    }
    return ajax;
}

function Xiaox()
{

var getMessXx = getAjax();

    var d = new Date();
    if(getMessXx.readyState==4 || getMessXx.readyState == 0){
        var getUrl = "/Home/Mess.x.asp?d="+d.getTime();//从服务器返回消息的地址
        getMessXx.open("POST",getUrl,true);//建立请求连接
        getMessXx.onreadystatechange = function(){
            if(getMessXx.readyState==4&&getMessXx.status==200){
                var chatEL = document.getElementById("XiaoxID");
                var messXML = getMessXx.responseXML;//获得返回后的XML
                var messNodes = messXML.getElementsByTagName("message");
                var messCount = messNodes.length;
                for(var i = 0 ; i < messCount ; i++){
				
                    var vvNode = messNodes[i].getElementsByTagName("vv");
					var wavNode = messNodes[i].getElementsByTagName("wav");

					chatEL.innerHTML = vvNode[0].firstChild.nodeValue;
					
					if(wavNode[0].firstChild.nodeValue==1){
					document.getElementById("bgwav").play();
					}else{
					document.getElementById("bgwav").stop();
					}
					
                }
                mGetTime = setTimeout("Xiaox()",2000);//每隔两秒从服务返回最新消息
            }
        }
        getMessXx.send(null);
    }
}


function openEg(url,width,height,left,top){
 var temp = "channelmode=no,location=no,menubar=no,toolbar=no,directories=no,scrollbars=no,resizable=no";
 if (width) {
  temp += ',width=' + width;
 } else {
  width = 0;
 }
 if (height) {
  temp += ',height=' + height;
 } else {
  height = 0;
 }
 if (left) {
  temp += ',left=' + left;
 } else {
  temp += ',left='
    + Math.round((window.screen.width - parseInt(width)) / 2);
 }
 if (top) {
  temp += ',top=' + top;
 } else {
  temp += ',top='
    + Math.round((window.screen.height - parseInt(height)) / 2);
 }
   window.open(url, '_blank', temp);
}




var count=0;//做计数器
var limit=new Array();//用于记录当前显示的哪几个菜单
var countlimit=1;//同时打开菜单数目，可自定义
function expandIt(su,el) {
obj = eval("BB_" + su + el);
obl = eval(su + el);
	if (obj.style.display == "none") {
		obj.style.display = "block";//显示子菜单
		obl.className = "MenuAddnewsSel";
		document.AddNewsFrom.Mn1.value = el;
		document.AddNewsFrom.Mn2.value = 0;
		document.AddNewsFrom.Mn3.value = 0;
		document.getElementById ("AddnewsSubmit").innerHTML = "<img src='/Images/save_0.jpg' style='margin-bottom:5px;' />";
		if (count<countlimit) {//限制2个
		limit[count]=el;//录入数组
		count++;
		}
		else {
		eval("BB_" + su + limit[0]).style.display = "none";
		eval(su + limit[0]).className = "MenuAddnews";
		for (i=0;i<limit.length-1;i++) {limit[i]=limit[i+1];}//数组去掉头一位，后面的往前挪一位
		limit[limit.length-1]=el;
		}
	}
	else {
	obj.style.display = "none";
	obl.className = "MenuAddnews";
	var j;
	for (i=0;i<limit.length;i++) {if (limit[i]==el) j=i;}//获取当前点击的菜单在limit数组中的位置
	for (i=j;i<limit.length-1;i++) {limit[i]=limit[i+1];}//j以后的数组全部往前挪一位
	limit[limit.length-1]=null;//删除数组最后一位
	count--;
	}
}


var count2=0;//做计数器
var limit2=new Array();//用于记录当前显示的哪几个菜单
var countlimit2=1;//同时打开菜单数目，可自定义
function expandIt2(su,el) {
obj2 = eval("CC_" + su + el);
obl2 = eval(su + el);
	if (obj2.style.display == "none") {
		obj2.style.display = "block";//显示子菜单
		obl2.className = "MenuAddnewsSel";
		document.AddNewsFrom.Mn2.value = el;
		document.AddNewsFrom.Mn3.value = 0;
		document.getElementById ("AddnewsSubmit").innerHTML = "<input name='submit' type='submit' id='addnewssubmit' class='addnewssubmit' value='' style='margin-bottom:5px;' />";
		if (count2<countlimit2) {//限制2个
		limit2[count2]=el;//录入数组
		count2++;
		}
		else {
		eval("CC_" + su + limit2[0]).style.display = "none";
		eval(su + limit2[0]).className = "MenuAddnews";
		for (i=0;i<limit2.length-1;i++) {limit2[i]=limit2[i+1];}//数组去掉头一位，后面的往前挪一位
		limit2[limit2.length-1]=el;
		}
	}
	else {
	obj2.style.display = "none";
	obl2.className = "MenuAddnews";
	var j2;
	for (i=0;i<limit2.length;i++) {if (limit2[i]==el) j2=i;}//获取当前点击的菜单在limit数组中的位置
	for (i=j2;i<limit2.length-1;i++) {limit2[i]=limit2[i+1];}//j以后的数组全部往前挪一位
	limit2[limit2.length-1]=null;//删除数组最后一位
	count2--;
	}
}


var count3=0;//做计数器
var limit3=new Array();//用于记录当前显示的哪几个菜单
var countlimit3=1;//同时打开菜单数目，可自定义
function expandIt3(su,el) {
obl3 = eval(su + el);
	if (obl3.className == "MenuAddnews") {
		obl3.className = "MenuAddnewsSel";
		document.AddNewsFrom.Mn3.value = el;
		if (count3<countlimit3) {//限制2个
		limit3[count3]=el;//录入数组
		count3++;
		}
		else {
		eval(su + limit3[0]).className = "MenuAddnews";
		for (i=0;i<limit3.length-1;i++) {limit3[i]=limit3[i+1];}//数组去掉头一位，后面的往前挪一位
		limit3[limit3.length-1]=el;
		}
	}
	else {
	obl3.className = "MenuAddnews";
	var j3;
	for (i=0;i<limit3.length;i++) {if (limit3[i]==el) j3=i;}//获取当前点击的菜单在limit数组中的位置
	for (i=j3;i<limit3.length-1;i++) {limit3[i]=limit3[i+1];}//j以后的数组全部往前挪一位
	limit3[limit3.length-1]=null;//删除数组最后一位
	count3--;
	}
}


function AddNewsFrom_chk(){
 if (document.AddNewsFrom.Mn1.value=="" || document.AddNewsFrom.Mn1.value==0){
 alert("-请选择一级分类-");
 return false;
 }
 if (document.AddNewsFrom.Mn2.value=="" || document.AddNewsFrom.Mn2.value==0){
 alert("-请选择二级分类-");
 return false;
 }
}