/*
* 
* 添加收藏
*/
function addBookmark(title,url) {
   try {   
        window.external.addFavorite(url, title);   
    } catch (e) {   
        try {   
            window.sidebar.addPanel(title, url, "");   
        } catch (e) {   
            alert("加入收藏失败，请使用Ctrl+D进行添加");   
        }   
    }  
}

//登陆特效
function _div(type)
{
var lockDiv = document.getElementById("suoding");
if (document.documentElement.clientHeight>document.documentElement.clientHeight)
{lockDiv.style.height=document.body.scrollHeight;}
else
{
lockDiv.style.height=document.documentElement.clientHeight;}
lockDiv.style.display="block";

var MsgWindow = document.getElementById("kuang");
var url=document.location.href;

MsgWindow.style.display="block";
if (type=="login"){
url=url.replace("exit=ture","");
url=url.replace("?&","?");
document.getElementById("kuangcontent").innerHTML="<iframe id='sprz' src='inc/login.asp?url="+url+"' width='100%' height='100%'  scrolling='no' frameborder='0'  style='margin:0px; padding:0px;' ></iframe>";
}
if (type=="reg"){
url=url.replace("exit=ture","");
url=url.replace("?&","?");
document.getElementById("kuangcontent").innerHTML="<iframe id='sprz' src='inc/Reg.asp?url="+url+"' width='100%' height='100%'  scrolling='no' frameborder='0'  style='margin:0px; padding:0px;' ></iframe>";
}

}


function _close()
{
var lockDiv = document.getElementById("suoding");
var MsgWindow = document.getElementById("kuang");
document.getElementById("kuangcontent").innerHTML="";
history.go(0);
MsgWindow.style.display="none";
lockDiv.style.display="none";
}



//创建ajax对象
var xmlHttp = false;
try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}


//登陆后添加工具操作
function Loginaddtool(ID) {
  
  var url = "inc/alterwb.asp?type=add&ID=" + escape(ID);
  xmlHttp.open("GET", url, true);
  xmlHttp.onreadystatechange =updateLoginaddtool; 
  xmlHttp.send(null); 
}

function updateLoginaddtool() {
    if (xmlHttp.readyState == 4) {
    var response = xmlHttp.responseText;
	if (response=="1"){
	//alert(response);
	alert("成功收藏该网站");
	}
	if (response=="2"){
	//alert(response);
	alert("您还未登录，请登录后在收藏网站");
	}
	else
	{
	//alert(response);
	alert("已添加过该网站");
	}
	//usernamecheck.innerHTML=response;
  }
}

function maillogin(){
	//alert("sdf");
	if (document.getElementById("maillogin").style.display=="block")
	   document.getElementById("maillogin").style.display="none";
	else
	   document.getElementById("maillogin").style.display="block";
	}
	
function mailloginclose(){
	document.getElementById("maillogin").style.display="none";
	}

var childWindow;
	function toQzoneLogin()
	{
		window.location.href="qqconnect/redirect.asp";
		//childWindow = window.open("qqconnect/redirect.asp","TencentLogin","width=450,height=320,menubar=0,scrollbars=1, resizable=1,status=1,titlebar=0,toolbar=0,location=1");
	} 
	
	function closeChildWindow()
	{
		childWindow.close();
	}
