// JavaScript Document
var js_dir = 'http://www.exinshi.com/';
document.write('<script language="javascript" src="'+js_dir+'js/conf/config.js"><\/script>');
document.write('<script language="javascript" src="'+js_dir+'scripts/srcMarquee.js"><\/script>');

function $(obj){
  return document.getElementById(obj);
}
//hua men
function tabit(navname,tabName,btnId,tabNumber){    
    for(i=0;i<tabNumber;i++){    
        document.getElementById(tabName+"_"+i).style.display = "none";    
        document.getElementById(navname+"_"+i).className = "off";    
    }    
    document.getElementById(tabName+"_"+btnId).style.display = "block";    
    document.getElementById(navname+"_"+btnId).className = "on";    
}    


//book begin

function check(obj) 
{ 
if(obj.checked==true) 
{ 
this.form1.Anonymous.value="1";
} 
else 
{ 
this.form1.Anonymous.value="0";
} 
} 

function setBook(){
	$("Results").innerHTML = ""
	}
function sendbook()
 {
    if(this.form1.Content.value.length<6)
	{
	 alert('留言信息不少于六个字');
	 this.form1.Content.focus();
	 return false;
	}

   var id        = $('hits').title;
   var title     = document.getElementsByTagName("h1")[0].innerHTML;
   var content   = this.form1.Content.value;
   var anonymous = this.form1.Anonymous.value;

   var xmlhttp;
   try
   {
	 xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
   }
   catch (e)
   {
     try
     {
       xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
     }
     catch (e)
     { 
	    try
	    {
			xmlhttp=new XMLHttpRecordset();
	    }
	    catch (e)
	    {
	    }
     }
   }

  //创建请求，并使用escape对username编码，以避免乱码
   xmlhttp.onreadystatechange=function()
   {
     if(4==xmlhttp.readyState)
	 {
	   if(200==xmlhttp.status)
	   {
	     if (xmlhttp.responseText=="yes")
	     {
			this.form1.Content.value="";
//			document.getElementById("Content").innerHTML="";
			document.getElementById("Results").innerHTML="感谢您的纠错，我们将尽快处理。";
//			alert('注册成功');
//			location.href('login.asp');
		}
		else
		{
		    this.form1.Content.value="";
			alert('留言失败');
		}
	   }
	   else
	   {
	   	 alert('网络连接失败');
	   }
	 }
   }
  //打开连接
  xmlhttp.open("post","/js/book.wiki.asp",true)
  xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
  //发送数据
  xmlhttp.send("title="+escape(title)+"&content="+escape(content)+"&InfoID="+escape(id)+"&Anonymous="+escape(anonymous));
 }


//book end


//store begin

 function sendStore(type,id)
 {
   var xmlhttp;
   try
   {
	 xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
   }
   catch (e)
   {
     try
     {
       xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
     }
     catch (e)
     { 
	    try
	    {
			xmlhttp=new XMLHttpRecordset();
	    }
	    catch (e)
	    {
	    }
     }
   }

  //创建请求，并使用escape对username编码，以避免乱码
   xmlhttp.onreadystatechange=function()
   {
     if(4==xmlhttp.readyState)
	 {
	   if(200==xmlhttp.status)
	   {
	     if (xmlhttp.responseText=="login")
	     {
			alert('请先登录！');
			window.open('http://www.exinshi.com/user/login.asp');
//			location.href('../../../user/login.asp',"_bank");
		}
		else
		{
	     if (xmlhttp.responseText=="Stored")
	     {
			alert('您已收藏了此信息');
		}
		else
		{
			alert('收藏成功');
		}
	   }
	   }
	   else
	   {
	   	 alert('网络连接失败');
	   }
	 }
   }
  //打开连接
  xmlhttp.open("post","/inc/Store.asp",true)
  xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
  //发送数据
  xmlhttp.send("type="+escape(type)+"&id="+escape(id));
 }


//store end


///**********背投广告代码－开始**********/
//ShowFullPopWin();
//function ShowFullPopWin()
//{
//var advPage = "/tool/pr.php";
//var showWith = window.screen.availWidth;
//var showHeight = window.screen.availHeight;
//
//var oPopWin = window.open(advPage, "FullPopWin", "width="+showWith+",height="+showHeight);
//self.focus();
//}
///**********背投广告代码－结束**********/ 

//var ebeibei_itemId = "9fd626d7-39b0-4072-8fa3-ab5ced8076c4";
//var ebeibei_adId   = "875a6aa4-9284-430d-987c-c6e9ba545360";
//var ebeibei_siteId = "aa283d8f-62da-4bee-bd88-41bdfd7e10b7";
//document.write('<scr'+'ipt src="http://union.ebeibei.com/cpm/showAds.Js" type=text/javascript></scr'+'ipt>');
