self.moveTo(0,0);
self.resizeTo(screen.availWidth,screen.availHeight);
self.focus();


/**
 * 初始化ajax
 */
function creat_Object() { 
var xmlhttp; 
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { 
try { 
xmlhttp = new XMLHttpRequest(); 
} 
catch (e) { 
alert("Your browser is not supporting XMLHTTPRequest");
 xmlhttp = false; 
} 
} 
else { 
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
} 
return xmlhttp; 
} 
var ajax = creat_Object(); 




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 = "/mp/Web_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 chatEL0 = document.getElementById("YinLiangID");
                var messXML = getMessXx.responseXML;//获得返回后的XML
                var messNodes = messXML.getElementsByTagName("messagex");
                var messCount = messNodes.length;
                for(var i = 0 ; i < messCount ; i++){
				
                    var vvNode = messNodes[i].getElementsByTagName("vv");
					var vv0Node = messNodes[i].getElementsByTagName("vv0");
					var wavNode = messNodes[i].getElementsByTagName("wav");

					chatEL.innerHTML = vvNode[0].firstChild.nodeValue;
					chatEL0.innerHTML = vv0Node[0].firstChild.nodeValue;
//					chatEL1.innerHTML = vv1Node[0].firstChild.nodeValue;
//					chatEL2.innerHTML = vv2Node[0].firstChild.nodeValue;
//					chatEL3.innerHTML = vv3Node[0].firstChild.nodeValue;
//					chatEL4.innerHTML = vv4Node[0].firstChild.nodeValue;
//					chatEL5.innerHTML = vv5Node[0].firstChild.nodeValue;
//					chatEL6.innerHTML = vv6Node[0].firstChild.nodeValue;
//					chatEL7.innerHTML = vv7Node[0].firstChild.nodeValue;
//					chatEL8.innerHTML = vv8Node[0].firstChild.nodeValue;
//					chatEL9.innerHTML = vv9Node[0].firstChild.nodeValue;
//					chatEL10.innerHTML = vv10Node[0].firstChild.nodeValue;
//					chatEL11.innerHTML = vv11Node[0].firstChild.nodeValue;
//					chatEL12.innerHTML = vv12Node[0].firstChild.nodeValue;
//					chatEL13.innerHTML = vv13Node[0].firstChild.nodeValue;
					
					if(wavNode[0].firstChild.nodeValue==1){
					//document.getElementById("bgwav").play();
					}else{
					//document.getElementById("bgwav").stop();
					}
					
                }
                mGetTime = setTimeout("Xiaox()",30000);//每隔两秒从服务返回最新消息
            }
        }
        getMessXx.send(null);
    }
}





function startChat()
{
    Xiaox();
    //document.getElementById("mess").focus();//把焦点设置到消息输入框
}






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 linkThis(id){
var ddd="";
if(id==null){
ddd="M7";
document.getElementById("M7").className="M7_Hover";
}
else{
ddd=id;
document.getElementById("M1").className="M1";
document.getElementById("M7").className="M7";
document.getElementById("M10").className="M10"
document.getElementById("M11").className="M11"
document.getElementById("M12").className="M12";
document.getElementById("M13").className="M13";
document.getElementById("M14").className="M14";
//document.getElementById("M8").className="M8";
//for(i=1;i<8;i++){	
//document.getElementById("M"+i).className="M"+i;
//}
document.getElementById(id).className=id+"_Hover";
}  
document.getElementById("bx").innerHTML = '<IFRAME ID="table_index" SRC="Vip_Iframe.asp?ID='+ ddd +'" FRAMEBORDER="0" SCROLLING="yes" WIDTH="100%" HEIGHT="100%"></IFRAME>';    
}












function showDiv(tag){
var light=document.getElementById(tag);
var fade=document.getElementById('bg');
var Iframe=document.getElementById('popIframe');
light.style.display='block';
Iframe.style.display='block';
fade.style.display='block';
}

function hideDiv(tag){
var light=document.getElementById(tag);
var fade=document.getElementById('bg');
var Iframe=document.getElementById('popIframe');
light.style.display='none';
Iframe.style.display='none';
fade.style.display='none';
}








function reinitIframe(id) {
        var iframe = document.getElementById(id);
        try {
            var bHeight = iframe.contentWindow.document.body.scrollHeight;
            var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
            var height = Math.max(bHeight, dHeight);
            iframe.height = height;
        } catch (ex) { }
}