﻿var ReLoadAjax = function()
{}
ReLoadAjax.prototype.GetHttpRequest = function()
{
	var reObj="";
	if ( window.XMLHttpRequest ){
		reObj= new XMLHttpRequest() ;
	}
	else if ( window.ActiveXObject ){	
		try{
			reObj=new ActiveXObject("MsXml2.XmlHttp") ;
		}
		catch(e){
			reObj=new 	ActiveXObject("microsoft.XmlHttp")
		}
	}
	return reObj;
}

ReLoadAjax.prototype.LoadUrl = function( urlToCall,altDiv,valInput)
{	
	var oReAjax = this ;
	var oAjaxHttp = this.GetHttpRequest() ;
	oAjaxHttp.open( "GET", urlToCall, true) ;
	oAjaxHttp.onreadystatechange=function()
	{
		if(oAjaxHttp.readyState==4)
		{
			document.getElementById(altDiv).innerHTML=oAjaxHttp.responseText;
		}
	}
	oAjaxHttp.send( null ) ;	
}
ReLoadAjax.prototype.LoadUrl2 = function(urlToCall)
{	
	var oReAjax = this ;
	var oAjaxHttp = this.GetHttpRequest() ;
	oAjaxHttp.open( "GET", urlToCall, false) ;
	oAjaxHttp.send( null );
	var result=oAjaxHttp.responseText;
	return result;	
}

function addCookie()
{
    if (document.all){
      window.external.addFavorite('http://www.igxe.com.cn/','游戏币交易|美服游戏交易平台|魔兽世界(WOW)金币交易-IGXE中国');
     }
	else if(window.sidebar){
    	window.sidebar.addPanel('游戏币交易|美服游戏交易平台|魔兽世界(WOW)金币交易-IGXE中国', 'http://www.igxe.com.cn/', "");
	}
}
/***淘宝的收藏本站的代码***/
function addBookmark(title,url) 
{
	if(!title){title =document.title};
  	if(!url){url=window.location.href}
  	if (window.sidebar) {
  		window.sidebar.addPanel(title,url ,"");
  	} 
	else if( document.all ) {
  		window.external.AddFavorite(url,title);
  	} 
	else if( window.opera && window.print ) {
  		return true;
  	}
}
/***淘宝的收藏本站的代码***/

//设为首页javascript代码
function setHomepage()
{
	if (document.all){
		document.body.style.behavior='url(#default#homepage)';
		document.body.setHomePage('http://www.igxe.com.cn/');
	}
	else if(window.sidebar){
		if(window.netscape){
			try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
			}catch (e){
				alert( "亲爱的用户你好：\n你使用的不是IE浏览器，此操作被浏览器阻挡了，你可以选择手动设置为首页！\n给你带来的不便，本站深表歉意。" );
			}
		}
	}
}
//验证QQ
function validateQQ(qq)
{
	if(qq=="")
	{
		alert("请输入QQ号码！");
		return false;
	}
	else
	{
		var url = "http://www.igxe.com.cn/ajax/ajax_QQ.cfm?qq="+qq;
		var result = ReLoadAjax.prototype.LoadUrl2(url); 
		//alert(result)<font color="#0b57c9"></font>
		
		if(result==1)
		{
			document.getElementById("spanOKQQ").innerHTML="<span color='#0b57c9'>"+qq+"</span>"
			var div = document.getElementById("OKMSG").innerHTML;
			popWin("Message from webpage", div, 390, 190);
		}
		else
		{
			document.getElementById("spanQQ").innerHTML="<span color='#0b57c9'>"+qq+"</span>"
			var div = document.getElementById("ERRORMSG").innerHTML;
			popWin("Message from webpage", div, 390, 190);
		}
	}
}

function viewQQ(qq,num,type)
{
	var numCC = num - 1;
	if (online[numCC]==0)
	{
		document.getElementById("viewQQDIV_"+type+"_"+num).innerHTML=" <li><a href='http://wpa.qq.com/msgrd?V=1&amp;Uin="+qq+"&amp;Site=www.igxe.com.cn&amp;Menu=yes' target='_blank'><img src='/newImages/igxesh-xxp.gif' width='27' height='29' /></a></li><li class='MFtxt01'><a href='http://wpa.qq.com/msgrd?V=1&amp;Uin="+qq+"&amp;Site=www.igxe.com.cn&amp;Menu=yes' target='_blank'>"+qq+"</a></li>";
	}
	else
	{
		document.getElementById("viewQQDIV_"+type+"_"+num).innerHTML=" <li><a href='http://wpa.qq.com/msgrd?V=1&amp;Uin="+qq+"&amp;Site=www.igxe.com.cn&amp;Menu=yes' target='_blank'><img src='/newImages/igxesh-icon04.gif' width='27' height='29' /></a></li><li class='MFtxt01'><a href='http://wpa.qq.com/msgrd?V=1&amp;Uin="+qq+"&amp;Site=www.igxe.com.cn&amp;Menu=yes' target='_blank'>"+qq+"</a></li>";
	}
}
function CNChangeTab(id,num,id1,id2){
	for(i=1;i<=num;i++){
	if(i==id)
		{
		document.getElementById(""+id1+""+i+"").className="gamebg"
		document.getElementById(""+id2+""+i+"").style.display='block';
		}
	else
		{
		document.getElementById(""+id1+""+i+"").className="gamebg1"
		document.getElementById(""+id2+""+i+"").style.display='none';
		}
	}
}
//显示开仓游戏名称
function viewGameSelect(gid)
{
	var obj = document.getElementById("selects");
	for(i=0;i<obj.length;i++)
	{
		if(obj[i].value==gid)
		{
			obj[i].selected=true;
		}
	}
}

function loginIndex(DID)
{
	if(DID=="passDIV")
	{
		document.getElementById("passDIV").innerHTML="";
	}
	else
	{
		document.getElementById(""+DID+"").value="";
	}
}
