//获取ID
function $id(id){
	return document.getElementById(id);
	}
function ShowMsg(){
	document.writeln("<div id=\"msgdiv\" style=\"position:absolute;display:none;\"><\/div>");
	document.writeln("<div id=\"overdiv\" style=\"position:absolute;display:none;\">");
	document.writeln("<\/div>");
	//回调函数
	this.ok_callback=function(){};
	this.cancel_callback=function(){};
	this.msgobjname=""
	this.show=function(info){
		var tempobj1=$id("msgdiv");
		var tempobj2=$id("overdiv");
		var msgobj=this.msgobjname;
  		tempobj2.style.filter="alpha(opacity=75)";
  		tempobj2.style.MozOpacity = 75/100;
    	tempobj2.style.backgroundColor = "#000000";
	  	tempobj2.style.display = '';
    	tempobj2.style.zIndex= 1000;
    	tempobj2.style.height= document.documentElement.clientHeight+500+"px";
    	tempobj2.style.width= document.documentElement.clientWidth+"px";
			tempobj2.style.left=0;
			tempobj2.style.top=0;
			tempobj1.style.display="none";
    	tempobj1.style.left= (document.documentElement.clientWidth)/4.7+"px";
    	tempobj1.style.top= (document.documentElement.scrollTop+(document.documentElement.clientHeight)/10)+"px";
    	tempobj1.style.display= '';
    	tempobj1.style.width=280+"px";
    	tempobj1.style.zIndex= 2000;
    	var OutStr;
		OutStr="<div id=\"tc_body\"><div class=\"tit\"><div class=\"l\">"+"Choose your server"+"</div><div class=\"r\"><a href=\"javascript:"+msgobj+".cancel()\"><img src=\"images/tc_h1_r.gif\" alt=\"close\"/></a></div></div>"
OutStr=OutStr+"<div class=\"sle_tab\">"
OutStr=OutStr+"<span class=\"selectd\" id=\"S_Menu_26\" onMouseOver=\"Show_Sub(26)\">"+"A"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_1\" onMouseOver=\"Show_Sub(1)\">"+"B"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_2\" onMouseOver=\"Show_Sub(2)\">"+"C"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_3\" onMouseOver=\"Show_Sub(3)\">"+"D"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_4\" onMouseOver=\"Show_Sub(4)\">"+"E"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_5\" onMouseOver=\"Show_Sub(5)\">"+"F"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_6\" onMouseOver=\"Show_Sub(6)\">"+"G"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_7\" onMouseOver=\"Show_Sub(7)\">"+"H"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_8\" onMouseOver=\"Show_Sub(8)\">"+"I"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_9\" onMouseOver=\"Show_Sub(9)\">"+"J"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_10\" onMouseOver=\"Show_Sub(10)\">"+"K"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_11\" onMouseOver=\"Show_Sub(11)\">"+"L"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_12\" onMouseOver=\"Show_Sub(12)\">"+"M"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_13\" onMouseOver=\"Show_Sub(13)\">"+"N"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_14\" onMouseOver=\"Show_Sub(14)\">"+"O"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_15\" onMouseOver=\"Show_Sub(15)\">"+"P"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_16\" onMouseOver=\"Show_Sub(16)\">"+"Q"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_17\" onMouseOver=\"Show_Sub(17)\">"+"R"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_18\" onMouseOver=\"Show_Sub(18)\">"+"S"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_19\" onMouseOver=\"Show_Sub(19)\">"+"T"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_20\" onMouseOver=\"Show_Sub(20)\">"+"U"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_21\" onMouseOver=\"Show_Sub(21)\">"+"V"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_22\" onMouseOver=\"Show_Sub(22)\">"+"W"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_23\" onMouseOver=\"Show_Sub(23)\">"+"X"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_24\" onMouseOver=\"Show_Sub(24)\">"+"Y"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_25\" onMouseOver=\"Show_Sub(25)\">"+"Z"+"</span>"
OutStr=OutStr+"<span id=\"S_Menu_27\" onMouseOver=\"Show_Sub(27)\">"+"..."+"</span>"
OutStr=OutStr+"</div>"
OutStr=OutStr+"<div class=\"sle_con\">"
OutStr=OutStr+info
OutStr=OutStr+"</div>"
OutStr=OutStr+"<div class=\"bottom\"></div>"
OutStr=OutStr+"</div>"
OutStr=OutStr+"<iframe frameborder=\"0\" style=\"position:absolute;top:0px;left:0px; width:820px; height:450px; z-index:-1;\"></iframe>"
    	
    	tempobj1.innerHTML=OutStr;
    	var md=false,mobj,ox,oy
     	document.onmousedown=function(ev)
     	{
			var ev=ev||window.event;
			var evt=ev.srcElement||ev.target;
         	if(typeof(evt.getAttribute("canmove"))=="undefined")
         	{
            	 return;
         	}
         	if(evt.getAttribute("canmove"))
         	{
             	md = true;
             	mobj = document.getElementById(evt.getAttribute("forid"));
             	ox = mobj.offsetLeft - ev.clientX;
             	oy = mobj.offsetTop - ev.clientY;
         	}
     	}
     	document.onmouseup= function(){md=false;}
     	document.onmousemove= function(ev)
     	{
			var ev=ev||window.event;
         	if(md)
         	{
             	mobj.style.left= (ev.clientX + ox)+"px";
             	mobj.style.top= (ev.clientY + oy)+"px";
         	}
     	}
		}
		this.ok = function()
		{
			$id('msgdiv').style.display='none';
			$id('overdiv').style.display='none';
			this.ok_callback();
		}
		this.cancel=function(){
			$id('msgdiv').style.display='none';
			$id('overdiv').style.display='none';
			this.cancel_callback();
		}
	}


function GetObj(objName){
        if(document.getElementById){
                return eval('document.getElementById("' + objName + '")');
        }else{
                return eval('document.all.' + objName);
        }
}
function Show_Sub(num){
	for(var i = 0;i <= 99;i++){
		if(GetObj("S_Menu_" + i)){GetObj("S_Menu_" + i).className = '';}
		if(GetObj("S_Cont_" + i)){GetObj("S_Cont_" + i).style.display = 'none';}
	}
	if(GetObj("S_Menu_" + num)){GetObj("S_Menu_" + num).className = 'selectd';}
	if(GetObj("S_Cont_" + num)){GetObj("S_Cont_" + num).style.display = 'block';}
}


function ShowServer(server){
	var tmpSid = document.getElementById("tmpServerID");
	var InfoID = document.getElementById("InfoID");
  tmpSid.innerHTML = '<input type="hidden" id="serverID" name="serverID" value="'+server+'" />';
	ShowMsgo.cancel();
	if(InfoID.value){
		ajaxresponse("pullServerID", "action=showserver&gameid="+$("game").value+"&server="+server+"&type="+InfoID.value);
	}else{
		ajaxresponse("pullServerID", "action=showserver&gameid="+$("game").value+"&server="+server);
	}
	changeServer(server);
}	

var ShowMsgo=new ShowMsg();
//设置对象名,供内部引用
ShowMsgo.msgobjname="ShowMsgo";
//定义回调函数
ShowMsgo.ok_callback=function(){}
ShowMsgo.cancel_callback=function(){}
