﻿// JScript 文件  共用版权信息

function copyright(){
document.writeln("<div class=\"logo\"><a href=\"http:\/\/www.wauxi.com\"><img src=\"http:\/\/www.wauxi.com\/images\/commonlogo.png\" width=\"204\" height=\"50\" alt=\"挖游戏—游戏搜索专家\" title=\"挖游戏—游戏搜索专家\" border=\"0\"\/><\/a><\/div>");
document.writeln("<p align=\"left\">");
document.writeln("<a href=\"#\" onclick=\"javascript:setHomepage(\'http:\/\/www.wauxi.com\');\">设为首页<\/a> | <a href=\"#\" onclick=\"javascript:AddFavorite(\'http:\/\/www.wauxi.com\', \'挖游戏—游戏搜索专家\');return false\">加入收藏<\/a> | <a href=\"http:\/\/netbar.wauxi.com\/\" target=\"_blank\">网吧地图<\/a> | <a href=\"http:\/\/daohang.wauxi.com\/\" target=\"_blank\">游戏导航<\/a> | ");
document.writeln("<a href=\"http:\/\/help.wauxi.com\/aboutus.htm\" target=\"_blank\" class=\"gerylink\">关于我们<\/a> | <a href=\"http:\/\/help.wauxi.com\/law.htm\" target=\"_blank\" class=\"gerylink\">免责声明<\/a> | <a href=\"http:\/\/help.wauxi.com\/contactus.htm\" target=\"_blank\" class=\"gerylink\">联系我们<\/a> | <a href=\"http:\/\/help.wauxi.com\/joinus.htm\" target=\"_blank\" class=\"gerylink\">加入我们<\/a> | <a href=\"http:\/\/help.wauxi.com\/websitelogin.htm\" target=\"_blank\" class=\"gerylink\">登记网站<\/a> | <a href=\"http:\/\/www.wauxi.com\/note.aspx\" target=\"_blank\" class=\"gerylink\">用户反馈<\/a><br \/>&copy; 2009 wauxi.com <a href=\"http:\/\/www.miibeian.gov.cn\/\" target=\"_blank\" class=\"gerylink\">京ICP证050837号<\/a> 北京市公安局海淀分局备案编号1101082060");
document.writeln("<br\/>");
document.writeln("官方公会合作：<a href=\"http:\/\/sighttp.qq.com\/cgi-bin\/check?sigkey=83717df6a36758953cedba560103636db4f818244b05e28e765d73a6a47d54972181f297a4f652c3c97fbc96605d03198c847a58ffd595485d720c2ec7556727b6c1544e1545c6ec2d834b18062eb6860521750f4b612f24df5709d74383e77b7aff67e91a86662542872ab15382c3f5\"; target=_blank; onclick=\"var tempSrc=\'http:\/\/sighttp.qq.com\/wpa.js?rantime=\'+Math.random()+\'&sigkey=83717df6a36758953cedba560103636db4f818244b05e28e765d73a6a47d54972181f297a4f652c3c97fbc96605d03198c847a58ffd595485d720c2ec7556727b6c1544e1545c6ec2d834b18062eb6860521750f4b612f24df5709d74383e77b7aff67e91a86662542872ab15382c3f5\';var oldscript=document.getElementById(\'testJs\');var newscript=document.createElement(\'script\');newscript.setAttribute(\'type\',\'text\/javascript\'); newscript.setAttribute(\'id\', \'testJs\');newscript.setAttribute(\'src\',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;\">QQ1078948283<\/a>&nbsp;&nbsp;");
document.writeln("商务合作与广告：<a href=\"http:\/\/sighttp.qq.com\/cgi-bin\/check?sigkey=42c821ebb5d97a033d52a56e9e2d9312593a558271a0d9005f87c4dd289665cf7ed27a70cca860029a2fe33fc8cb514944f6bde0a0428ac31af654a3380629860aea693fd0045ae51f77b340cb8cf0186f5b62c1ef84f8659a79eb6232d10dd35d3b6895188af83cabb8c8ef685780c8\"; target=_blank; onclick=\"var tempSrc=\'http:\/\/sighttp.qq.com\/wpa.js?rantime=\'+Math.random()+\'&sigkey=42c821ebb5d97a033d52a56e9e2d9312593a558271a0d9005f87c4dd289665cf7ed27a70cca860029a2fe33fc8cb514944f6bde0a0428ac31af654a3380629860aea693fd0045ae51f77b340cb8cf0186f5b62c1ef84f8659a79eb6232d10dd35d3b6895188af83cabb8c8ef685780c8\';var oldscript=document.getElementById(\'testJs\');var newscript=document.createElement(\'script\');newscript.setAttribute(\'type\',\'text\/javascript\'); newscript.setAttribute(\'id\', \'testJs\');newscript.setAttribute(\'src\',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;\">QQ452033904<\/a>");
document.writeln("<script src=\"http:\/\/s46.cnzz.com\/stat.php?id=1083238&web_id=1083238&show=pic\" language=\"JavaScript\" charset=\"gb2312\"><\/script>");
document.writeln("<\/p>");

}
	
function resizepic() { 
	var xw="650";//限制宽度 
	for (var i=0; i<document.images.length; i++) { 
		if (document.images[i].width > xw) 
		{ 
			xh=document.images[i].height; 
			bl=xh/document.images[i].width; 
			document.images[i].width =xw; 
			//document.images[i].height=xw*bl; 
		} 
	} 
}

function resize_LogoPic() { 
	var xw="240";//限制宽度 
	for (var i=0; i<document.images.length; i++) { 
		if (document.images[i].width > xw) 
		{ 
			xh=document.images[i].height; 
			bl=xh/document.images[i].width; 
			document.images[i].width =xw; 
			//document.images[i].height=xw*bl; 
		} 
	} 
}

//通用搜索
 function SeackUrl()
 {
  var  text=encodeURI(document.getElementById("searchword").value);
  var checkOL=document.getElementById("checkOL");
  var checkPIC=document.getElementById("checkPIC");
   //alert(checkPIC.checked);
   //alert(checkOL);
  if(checkPIC.checked==true)
  {
    window.location.href="http://www.wauxi.com/PicPage?q="+text+"&tp=1031&ps=12";
   
  }
  else
  {
  window.location.href="http://www.wauxi.com/Raiders?q="+text+"&tp=1011&gl=2&sf=0&ps=10";
  }
 }
 
 
 function SeackwebGameUrl()
 {
  var  text=encodeURI(document.getElementById("searchword").value);
   window.location.href="http://www.wauxi.com/webgameRaiders?q="+text+"&tp=1028&ps=10&gl=2";
 }


function makeRestoreRequest(url)
{


	http_request = false;
	
	//支持XMlHttpRequest类的浏览器，如mozilla
	if (window.XMLHttpRequest) 
	{ // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) 
		{
			http_request.overrideMimeType('text/html');
		}
    } else if (window.ActiveXObject) 
	{ // IE
        try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                       http_request = new ActiveXObject("Microsoft.XMLHTTP");
                    } 
					catch (e) {}
            }
    }
	if (!http_request) {
            alert('对不起，浏览器版本须5.5之上，请升级浏览器!');
            return false;
        }
        http_request.onreadystatechange = getRestoreInfo;
        http_request.open('POST', url, true);
        http_request.send(null);
}
function getRestoreInfo()
{
 
	//var sd = document.getElementById("sd");
	  if (http_request.readyState == 4 )
	  {
	  	
	  	  if( http_request.status == 200)
		  {
			 str = http_request.responseText;
			 alert(str);
			 var get_array = Array();
			 //eval(str);
			 //cs_info.innerHTML = str;
			 alert(str);
			 if(str=="你尚未登录")
			 {

			    alert('请先登入再收藏!')
			    window.open("http://cheba.wauxi.com/login.aspx");
			 }
		  }
	}
}
function showInfo(address)
{
    
  
	makeRestoreRequest('http://cheba.wauxi.com/AddFavorite.aspx?'+address);
}

 function loginSeackURl()
 {
  var  text=encodeURI(document.getElementById("keyword").value);
  window.location.href="http://www.wauxi.com/Raiders?q="+text+"&tp=1011&gi=0";
 }
 
 
 //下三个方法是QMZZ的登入JS
 
function showInfoQMZZ(address)
{
    
  alert('AddFavorite.aspx?'+address);
  document.domain="wauxi.com";
	Send_Login('http://gh.wauxi.com/qmzzLogin.aspx');
}
function makeRestoreRequestQMZZ(url)
{

alert('a');
	http_request = false;
	
	//支持XMlHttpRequest类的浏览器，如mozilla
	if (window.XMLHttpRequest) 
	{ // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) 
		{
			http_request.overrideMimeType('text/html');
		}
    } else if (window.ActiveXObject) 
	{ // IE
        try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                       http_request = new ActiveXObject("Microsoft.XMLHTTP");
                    } 
					catch (e) {}
            }
    }
	if (!http_request) {
            alert('对不起，浏览器版本须5.5之上，请升级浏览器!');
            return false;
        }
        http_request.onreadystatechange = getRestoreInfo1QMZZ;
        alert('c');
        http_request.open('POST', 'http://cheba.wauxi.com', false);
        alert('d');
        http_request.send(null);
}
function getRestoreInfo1QMZZ()
{
    alert('aa');
    			
	//var sd = document.getElementById("sd");
	  if (http_request.readyState == 4 )
	  {
	  	//alert('bb');
	  	  if( http_request.status == 200)
		  {
             str = http_request.responseText;
			 
			 var get_array = Array();
			 //eval(str);
			 //cs_info.innerHTML = str;
			 
			 if(str=="密码错误")
			 {

			    alert('密码错误!');
			    //window.open("http://cheba.wauxi.com/login.aspx");
			 }
			 else if(str=="用户名不存在")
			 {
			    alert('用户名不存在!');
			 }
			 else
			 {
			    alert('登入成功');
			    location.href="http://cheba.wauxi.com/qmzzGameindex.aspx"+str;
			 }
		  }
	}
}




var xmlHttp;
function createXMLHTTP()
{
    if(window.XMLHttpRequest)
    {
        xmlHttp=new XMLHttpRequest();//mozilla浏览器
    }
    else if(window.ActiveXObject)
    {
        try
        {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");//IE老版本
        }
        catch(e)
        {}
        try
        {
            xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");//IE新版本
        }
        catch(e)
        {}
        if(!xmlHttp)
        {
            window.alert("不能创建XMLHttpRequest对象实例！");
            return false;
        }
    }
}



function Send_Login(url)
{
    window.alert('ddd');
    createXMLHTTP();//创建XMLHttpRequest对象
    //var url="operateComment.aspx?act="+act+"&cmt_ID="+cmt_ID+"&num="+num+"";    
    xmlHttp.open("GET",url,true);
    
    alert('cc');
    xmlHttp.onreadystatechange=updateComment;
    xmlHttp.send(null);
}

function updateComment()
{
    
    if(xmlHttp.readyState==4)//判断对象状态
    {
        
        if(xmlHttp.status==200)//信息成功返回，开始处理信息
        {
           var divID="divID";
           alert(xmlHttp.responseText.substring(0,5));
           
        }        
    }
 
}


// 设为首页 加入收藏的 IE6下设为首页不行
function AddFavorite(sURL, sTitle) { 
    try { 
        window.external.addFavorite(sURL, sTitle); 
    } catch (e) { 
        try { 
            window.sidebar.addPanel(sTitle, sURL, ""); 
        } catch (e) { 
            alert("加入收藏失败,请手动添加."); 
        } 
    } 
} 

function setHomepage(pageURL) { 
    if(this.style)
	{
	    this.style.behavior='url(#default#homepage)'; 
		this.setHomePage(pageURL);
	
	}
   else if (document.all) { 
		document.body.style.behavior='url(#default#homepage)'; 
        document.body.setHomePage(pageURL); 
		
    } 
	
    else if (window.sidebar) { 
        if(window.netscape) { 
            try { 
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
            } 
            catch (e) { 
                alert( "该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项signed.applets.codebase_principal_support 值该为true" ); 
            } 
        } 
        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch); 
        prefs.setCharPref('browser.startup.homepage',pageURL); 
    } 
} 

//解决PNG兼容问题
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6. 
{ 
    var arVersion = navigator.appVersion.split("MSIE") 
    var version = parseFloat(arVersion[1]) 
    if ((version >= 5.5) && (document.body.filters)) 
    { 
       for(var j=0; j<document.images.length; j++) 
       { 
          var img = document.images[j] 
          var imgName = img.src.toUpperCase() 
          if (imgName.substring(imgName.length-3, imgName.length) == "PNG") 
          { 
             var imgID = (img.id) ? "id='" + img.id + "' " : "" 
             var imgClass = (img.className) ? "class='" + img.className + "' " : "" 
             var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' " 
             var imgStyle = "display:inline-block;" + img.style.cssText 
             if (img.align == "left") imgStyle = "float:left;" + imgStyle 
             if (img.align == "right") imgStyle = "float:right;" + imgStyle 
             if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle 
             var strNewHTML = "<span " + imgID + imgClass + imgTitle 
             + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" 
             + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" 
             + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
             img.outerHTML = strNewHTML 
             j = j-1 
          } 
       } 
    }     
} 
window.attachEvent("onload", correctPNG); 