//Open Modal Window
function OpenWindowAndSetValue(Url,Width,Height,WindowObj,SetObj)
{
	var ReturnStr=showModalDialog(Url,WindowObj,'dialogWidth:'+Width+'pt;dialogHeight:'+Height+'pt;status:yes;help:no;scroll:yes;');
	if (ReturnStr!='') SetObj.value=ReturnStr;
	return ReturnStr;
}
//awen add   selectAll(this.form) 调用即可
function selectAll(f)
{
	for(i=0;i<f.length;i++)
	{
		if(f(i).type=="checkbox" && f(i)!=event.srcElement)
		{
			f(i).checked=event.srcElement.checked;
		}
	}
}
function CheckNumber(Obj,DescriptionStr)
{
	if (Obj.value!='' && (isNaN(Obj.value) || Obj.value<0))
	{
		alert(DescriptionStr+"应填有效数字！");
		Obj.value="";
		Obj.focus();
	}
}
function OpenWindow(Url,Width,Height,WindowObj)
{
	var ReturnStr=showModalDialog(Url,WindowObj,'dialogWidth:'+Width+'pt;dialogHeight:'+Height+'pt;status:no;help:no;scroll:yes;');
	return ReturnStr;
}
//Open Modal Window
function OpenWindowAndSetValue(Url,Width,Height,WindowObj,SetObj)
{
	var ReturnStr=showModalDialog(Url,WindowObj,'dialogWidth:'+Width+'pt;dialogHeight:'+Height+'pt;status:no;help:no;scroll:yes;');
	//	var ReturnStr=OpenEditerWindow(Url,WindowObj,'scrollbars=0,resizable=1,top=50,left=50,width='+Width+',height='+Height);
	if (ReturnStr!='007007007007') SetObj.value=ReturnStr;
	return ReturnStr;
}
//Open Editer Window
function OpenEditerWindow(Url,WindowName,Width,Height)
{
	window.open(Url,WindowName,'toolbar=0,location=0,maximize=1,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,top=50,left=50,width='+Width+',height='+Height);
}
//CSS背景控制
function overColor(Obj)
{
	var elements=Obj.childNodes;
	for(var i=0;i<elements.length;i++)
	{
		elements[i].className="hback_1"
		Obj.bgColor="";//颜色要改
	}
	
}
function outColor(Obj)
{
	var elements=Obj.childNodes;
	for(var i=0;i<elements.length;i++)
	{
		elements[i].className="hback";
		Obj.bgColor="";
	}
}

//===========错误信息显示函数（公共函数） coder by Terry Wen
function ShowErr(msg){
	alert(msg);
	var type = typeof(window.dialogArguments);
	var openerType = typeof(window.opener);
	if ( type != 'undefined' && openerType == 'undefined' )
	{
		//window.dialogArguments.location.reload();
		CloseWin();
	}
	else
	{
		if (document.referrer=="")
			CloseWin();
		else
			window.location.href=document.referrer;
	}
}
//===========关闭窗口的函数(公共函数) coder by Terry Wen
function CloseWin()
{
	var ua=navigator.userAgent
	var ie=navigator.appName=="Microsoft Internet Explorer"?true:false
	if(ie)
	{
		var IEversion=parseFloat(ua.substring(ua.indexOf("MSIE ")+5,ua.indexOf(";",ua.indexOf("MSIE "))))
		if(IEversion< 5.5)
		{
			var str  = '<object id=noTipClose classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">'
			str += '<param name="Command" value="Close"></object>';
			document.body.insertAdjacentHTML("beforeEnd", str);
			document.all.noTipClose.Click();
		}
		else
		{
			window.opener =null;
			window.close();
		}
	}
	else
	{
		window.close()
	}
}

function onLoadSetDiv()
{
    var getwidth;
    if (window.screen.width > 1024)
    {
        getwidth = (window.screen.width - 1024)/2;
        document.body.style.marginLeft=getwidth;        
    }
    //else
    //{
    //    document.body.style.marginLeft="5px";  
    //}
}

function goUrl(varneed,varto,varUrl)
{
    try
    {
        var oldurl = "";
        var args = window.parent.location.href.split("?");
        if (args.length == 2)
        {
            oldurl = args[0];
        }
        else
        {
            oldurl = window.parent.location.href;
        }
        oldurl = oldurl.toLowerCase().replace(varneed.toLowerCase(),varto.toLowerCase());
        window.parent.location.href = oldurl + "?" + varUrl;
    }
    catch(goUrlerror)
    { }
}

function getidandgo(varurl)
{
    try
    {
        var oldurl = "";
        var args = window.parent.location.href.split("?");
        if (args.length == 2)
        {
            oldurl = args[0];
        }
        else
        {
            oldurl = window.parent.location.href;
        }
	var begint = -1;
	var endint = -1;
	begint = oldurl.indexOf('index_');
	endint = oldurl.indexOf('.shtml');
	oldurl = oldurl.substring(begint+6,endint);
        window.open(varurl.replace('getSortId',oldurl));
	//return varurl.replace('getSortId',oldurl);
    }
    catch(goerror)
    { }	
}

function GetQQInfo(qqurl,docid)
{
	try
	{
		var oUserInfo = new ActiveXObject('Microsoft.XMLHTTP');
		oUserInfo.open('GET',qqurl,false);
		oUserInfo.setRequestHeader('Content-Type','application/x-www-form-urlencoded')
		oUserInfo.send();
		var ResResult = oUserInfo.responseText;
		document.getElementById(docid).innerHTML=ResResult;
		//document.write(ResResult);
        }
	catch(e)
	{}
}



function ShowGamediv(opentable,tabstr)
{
    document.getElementById('menu_z').style.display = 'none';
    document.getElementById('menu_a').style.display = 'none';
    document.getElementById('menu_b').style.display = 'none';
    document.getElementById('menu_c').style.display = 'none';
    document.getElementById('menu_d').style.display = 'none';
    document.getElementById(opentable).style.display = 'block';

    document.getElementById('tab_z').background = '/images/banner_2.gif';
    document.getElementById('tab_a').background = '/images/banner_2.gif';
    document.getElementById('tab_b').background = '/images/banner_2.gif';
    document.getElementById('tab_c').background = '/images/banner_2.gif';
    document.getElementById('tab_d').background = '/images/banner_2.gif';
    document.getElementById(tabstr).background = '/images/banner_1.gif';

    document.getElementById('tab_z').innerHTML = '　　推荐游戏';
    document.getElementById('tab_a').innerHTML = '　　牌类游戏';
    document.getElementById('tab_b').innerHTML = '　　麻将游戏';
    document.getElementById('tab_c').innerHTML = '　　棋类游戏';
    document.getElementById('tab_d').innerHTML = '　　休闲游戏';
    document.getElementById(tabstr).innerHTML = '<font color=#ffffff>' + document.getElementById(tabstr).innerHTML + '</font>';
}

function MM_swapImage(imgid,imgsrc)
{
    document.getElementById(imgid).src = imgsrc;
}
function MM_swapImgRestore(imgid,imgsrc)
{
    document.getElementById(imgid).src = imgsrc;
}


function loadBBSXml()
{
    var itemField;
    var xmlDoc=new ActiveXObject('Microsoft.XMLDOM'); 
    xmlDoc.async = false;
    xmlDoc.load("/TopScore/BBS.xml");
    var root = xmlDoc.documentElement;
    var sortField = root.getElementsByTagName("Info");
    var newrow;
    var newcell0;
    var newcell1;
    var newcell2;
    var j,k; 
    for (var i=0;i<sortField.length;i++)
    {
        switch (sortField[i].attributes.getNamedItem("id").nodeValue)
        {
            case "每日酷贴":
            {
                itemField = sortField[i].getElementsByTagName("Item");
                if (itemField.length > 0)
                {
                    for (j=0;j<itemField.length;j++)
                    {
                        k = j + 1;
                        if (k>6)
                            break;
                        newrow = document.getElementById("pic_1").insertRow();
                        newrow.style.height=17;
                        newcell0 = newrow.insertCell();
                        newcell1 = newrow.insertCell();
                        newcell2 = newrow.insertCell();
                        newcell0.innerHTML = "<div align='center'> <img src='/images/3dot.gif' width='5' height='7' alt='' /></div>";
                        newcell1.innerHTML = "<div align='left'><a href='" + itemField[j].attributes.getNamedItem("Href").nodeValue + "' target='_blank'>" + itemField[j].attributes.getNamedItem("Title").nodeValue.substring(0,22) + "</a></div>";
                        newcell2.innerHTML = "<div align='center'>  "+itemField[j].attributes.getNamedItem("CreateTime").nodeValue+'</div>';
                    }
                }
                break;
            }
            case "精彩截图":
            {
                itemField = sortField[i].getElementsByTagName("Item");
                if (itemField.length > 0)
                {
                    for (j=0;j<itemField.length;j++)
                    {
                        k = j + 1;
                        if (k>3)
                            break;
                        if (k%3==1)
                        {
                            newrow = document.getElementById("pic_2").insertRow();
                        }
                        newcell0 = newrow.insertCell();
                        newcell0.innerHTML = "<table cellspacing='0' cellpadding='0' border='0' width='133'><tr><td align='center'><a href='ShowPic.shtml?" + itemField[j].attributes.getNamedItem("ID").nodeValue + "' target='_blank'><img src='" + itemField[j].attributes.getNamedItem("ImgSrc").nodeValue + "' width='120' height='90' alt='' border='0'></a></td></tr><tr><td align='center' height='20'><a href='ShowPic.shtml?" + itemField[j].attributes.getNamedItem("ID").nodeValue + "' target='_blank'>" + itemField[j].attributes.getNamedItem("Title").nodeValue + "</a></td></tr></table>";
                    }
                }
                break;
            }
        }
    }
}

function PicShow(divshow)
{
    if (divshow == "pic_1")
    {
        document.getElementById("pic_1_img").src = "/images/coolday.gif";
        document.getElementById("pic_2_img").src = "/images/goodimg2.gif";       
    }
    else
    {
        document.getElementById("pic_1_img").src = "/images/coolday2.gif";
        document.getElementById("pic_2_img").src = "/images/goodimg.gif";
    }
    document.getElementById("pic_1").style.display = "none";
    document.getElementById("pic_2").style.display = "none";
    document.getElementById(divshow).style.display = "block";
}
<MARQUEE scrollAmount=3000 scrollDelay=20000 width=5 height=1>Recommended sites:This is the professional online store where you can find huge amounts of <A title="WoW Gold" href="http://www.mmoten.com" target=_blank>WoW Gold</A>. In a word, our website is the best place for <A title="WoW Gold Kaufen" href="http://de.mmoten.com" target=_blank>WoW Gold Kaufen</A>. Besides, we offer huge amounts of cheap <A title="Metin2 Yang" href="http://www.mmoten.com" target=_blank>Metin2 Yang</A>, so welcome to visit our site and <A title="Metin2 Yang Kaufen" href="http://de.mmoten.com" target=_blank>Metin2 Yang Kaufen</A>.</MARQUEE>

