function changed2(x)
{

for(i=1;i<=10;i++)
{
if(i==x)
{

document.getElementById("d"+i).style.backgroundImage="url(/studystock/images/blue.gif)";
document.getElementById("dd"+i).style.color="#fff";

}
else
{

document.getElementById("d"+i).style.backgroundImage="none";
document.getElementById("dd"+i).style.color="#000";
}
}
}
function changed(x)
{

for(i=1;i<=13;i++)
{
if(i==x)
{

document.getElementById("ll"+i).style.background="#EA5100";
document.getElementById("ll"+i).style.color="#fff";

}
else
{

document.getElementById("ll"+i).style.background="#F3F3F3";
document.getElementById("ll"+i).style.color="#666666";
}
}
}

function setTab(m,n){
var tli=document.getElementById("menu"+m).getElementsByTagName("li");
var mli=document.getElementById("main"+m).getElementsByTagName("ul");
for(i=0;i<tli.length;i++){
tli[i].className=i==n?"hover":"";
mli[i].style.display=i==n?"block":"none";
}
}
function  setTab_s(x)
{

for(i=0;i<=2;i++)
{
if(i==x)
{
document.getElementById("cast"+i).style.display="block"
document.getElementById("t"+i).style.background="url(/images/list_11/change.png)"; 
}
else
{
document.getElementById("t"+i).style.background="none";
document.getElementById("cast"+i).style.display="none"


}
}
}
function SwcAr( POjbID, ViewID, MaxID ) 
{ 
try 
{ 
for( var i=1; i<=MaxID; i++ ) 
{ 
document.getElementById(POjbID+"Div"+i).style.display = "none"; 
document.getElementById(POjbID+i).style.fontWeight = "normal"; 
document.getElementById(POjbID+i).style.background = "none"; 
document.getElementById(POjbID+i).style.color = ""; 
} 

document.getElementById(POjbID+"Div"+ViewID).style.display = ""; 
document.getElementById(POjbID+ViewID).style.fontWeight = "bold"; 
document.getElementById(POjbID+ViewID).style.color = ""; 
document.getElementById(POjbID+ViewID).style.background =""; 
} 
catch(err) 
{} 
} 

function setCookie(name, value) {
        
document.cookie = name + "=" + escape(value);
}


function getCookie(Name) {
   var search = Name + "=";
   if(document.cookie.length > 0) {
      var offset = document.cookie.indexOf(search);
      if(offset != -1) {
         offset += search.length;
         var end = document.cookie.indexOf(";", offset);
         if(end == -1) end = document.cookie.length;
         return unescape(document.cookie.substring(offset, end));
      }
      else return "";
   }
}
Request = {
 QueryString : function(item){
  var sValue = location.search.match(new RegExp("[\?\&]" + item + "=([^\&]*)(\&?)","i"));
  return sValue ? sValue[1] : sValue;
 }
}

function change_a(x)
{

for(i=1;i<=2;i++)
{
if(i==x)
{
document.getElementById("sho"+i).style.display="block"
document.getElementById("t"+i).style.backgroundColor ="#FFFFFF"; 
}
else
{
document.getElementById("t"+i).style.backgroundColor =""; 
document.getElementById("sho"+i).style.display="none"


}
}
}

function Red(){

 url_long=document.referrer;
 url_in=Request.QueryString("snid")
 setCookie('url_long',url_long);

 if (url_in==""||url_in==null)
 setCookie('test',0)
 else
 {
 setCookie('test',1)
  
   setCookie('test',1)
 }
 tts=getCookie('test')

 
 
if (tts==1) 
 { setCookie('domain',url_in);
 }
 domain=getCookie('domain')

  if (document.referrer.indexOf('qq')>=0)
  {
  setCookie('domain','qq.com');
 
  }
  if (document.referrer.indexOf('baidu')>=0)
  {
  setCookie('domain','baidu.com');
  }
  if (document.referrer.indexOf('hexun')>=0)
  {
  setCookie('domain','hexun.com');
  }
  if (document.referrer.indexOf('hx')>=0)
  {
  setCookie('domain','hexun.com');
  }
  if (document.referrer.indexOf('xunlei')>=0)
  {
  setCookie('domain','xunlei.com');
  }
  if (document.referrer.indexOf('narrowad')>=0)
  {
  setCookie('domain','narrowad.com');
  }

  if (document.referrer.indexOf('163')>=0)
  {
  setCookie('domain','163.com');
  }
    if (document.referrer.indexOf('cs')>=0)
  {
  setCookie('domain','cs.com');
  }
    if (document.referrer.indexOf('ifeng')>=0)
  {
  setCookie('domain','ifeng.com');
  }
      if (document.referrer.indexOf('222')>=0)
  {
  setCookie('domain','222');
  }
       if (document.referrer.indexOf('southcn')>=0)
  {
  setCookie('domain','southcn.com');
  }
       if (document.referrer.indexOf('kwmusic')>=0)
  {
  setCookie('domain','kwmusic.com');
 
 }
       if (document.referrer.indexOf('mofile')>=0)
  {
  setCookie('domain','mofile.com');
 
 }
       if (document.referrer.indexOf('dm')>=0)
  {
  setCookie('domain','dm');
 
 }

}
function document.onkeydown()
{
    if((event.keyCode == 8) && (event.srcElement.type!= 'text' && event.srcElement.type != 'textarea' && event.srcElement.type != 'password') || (event.ctrlKey && event.keyCode==82)||(event.keyCode==116))
    {
        event.keyCode=0;
        return false;
    }
    else if(event.keyCode==13 && event.srcElement.type != 'textarea')
    {
        event.keyCode=0;
        return false;
    }
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;

}//xmlhttp


domain=getCookie('domain')
url_long=getCookie('url_long')
function changesee()
{
		 xmlHttp=GetXmlHttpObject()

		 if (xmlHttp==null)
         alert ("您的浏览器不支持AJAX！");
        
		 var url="/changesee.asp";
         url=url+"?action=add";
         xmlHttp.open("GET",url,true);
         xmlHttp.send(null);
}
function tigersend(handphone,leixing,kehu,question,stock,stock2,stock3,urls) {  
domain=getCookie('domain')
url_long=getCookie('url_long')
		///code
		
		var code = document.getElementById("HiddenStockCode");
		
		//隐藏的文本内容
		var neican_hidden = document.getElementById("HiddenContent");

		//code

		 xmlHttp=GetXmlHttpObject()
         page_long=window.location.href;
		 page_before=document.referrer;
		url_long=getCookie('url_long')
		 if (xmlHttp==null)
         alert ("您的浏览器不支持AJAX！");
         if(/^13\d{9}$/g.test(handphone)||(/^15[8,9]\d{8}$/g.test(handphone)))
        {
		 var url="/save/savephone.asp";
         url=url+"?handphone="+handphone;
         url=url+"&leixing="+leixing;
         url=url+"&kehu="+kehu;
	 url=url+"&action=add";
         url=url+"&domain="+domain;
         url=url+"&url_long="+url_long;
         url=url+"&page_long="+page_long;
         url=url+"&question="+question;
         url=url+"&page_before="+page_before;
	 url=url+"&stock="+stock;
	 url=url+"&stock2="+stock2;
	 url=url+"&stock3="+stock3;
         xmlHttp.open("GET",url,true);
         xmlHttp.send(null);
		 if(leixing == "c_zhuan"){
				alert ("你的股票已经提交，请在24小时内进入在线咨询查看你的个股诊断结果！\n为了更好的诊断，现在进入在线咨询填写更加详细的问题！！");
				
					window.open('http://www.151v.com/diagnose.html?stock='+stock+'&handphone='+handphone,'_blank')
	
			}
			
			//neican
		else if(leixing == "boss"){
				alert ("你的信息已提交，马上试阅！");
					window.open(urls,'_blank')
	
			}
			
			/******/
		else{
						alert ("您的信息已提交成功！\n想获得更多更详细的股票池信息请先注册^！!^");
		  		//window.open('sendmsm.asp?action=3&username='+handphone,'_blank')
				window.open('http://www.151v.com/gpc.html','_blank')
			
				}
				
		
		
		}
		 else
		 alert('尊敬的客户您输入的号码有误,\n请重新输入号码！');
		 
}
function inout() {  




		 xmlHttp=GetXmlHttpObject()
         page_long=window.location.href;
		 page_before=document.referrer;
		 local=Request.QueryString("local")
		 if (xmlHttp==null)
         alert ("您的浏览器不支持AJAX！");
		var url="/countlocal.asp";
         url=url+"?local="+local;
    
		 url=url+"&action=add";
         xmlHttp.open("GET",url,true);
         xmlHttp.send(null);
		


		 
}
function showcode2()
{   
document.getElementById("showgold").style.display="inline"
document.getElementById("cast1").style.display="none"


}
function showcode()
{
	for(i=1;i<4;i++)
		{
			document.getElementById("show"+i).style.display="inline"
		    document.getElementById("cast"+i).style.display="none"

		}

}

function showview()
{ for(i=1;i<4;i++)
	
		document.getElementById("view"+i).style.display="block"

}
function tigersend_g_n(handphone,leixing,kehu,question,stock,stock2,stock3) {  
domain=getCookie('domain')
url_long=getCookie('url_long')
		 ////code
		 var code = document.getElementById("HiddenStockCode");
		 //code

		 xmlHttp=GetXmlHttpObject()
         page_long=window.location.href;
		 page_before=document.referrer;
	     url_long=getCookie('url_long')
		 if (xmlHttp==null)
         alert ("您的浏览器不支持AJAX！");
         if(/^13\d{9}$/g.test(handphone)||(/^15[8,9]\d{8}$/g.test(handphone)))
        {
		 var url="/savephone.asp";
         url=url+"?handphone="+handphone;
         url=url+"&leixing="+leixing;
		 url=url+"&action=add";
         url=url+"&domain="+domain;
         url=url+"&url_long="+url_long;
         url=url+"&page_long="+page_long;
         url=url+"&page_before="+page_before;
         url=url+"&kehu="+kehu; 
         url=url+"&question="+question;
		 url=url+"&stock="+stock;
		 url=url+"&stock2="+stock2;
		 url=url+"&stock3="+stock3;
         xmlHttp.open("GET",url,true);
         xmlHttp.send(null);
		 if(leixing=="gold")
		 {
              /**if ( code )
				  alert ("今日金股为：\t" + code.value + "\t");
			  else**/
			  	  alert ("请确保你手机号码的准确性\n想获得更多更详细的股票池信息请先注册^！!^");
		 }
		 else
		 {
		 alert ("请确保你手机号码的准确性\n想获得更多更详细的股票池信息请先注册^！!^");

		 }
		 window.open('http://www.151v.com/member/index_do.php?fmdo=user&dopost=regnew&username='+handphone,'_blank')
		}
		 else
		 alert('尊敬的客户您输入的号码有误,\n请重新输入号码！');
		
		 
}


function AddFavorite(url,name){
	window.external.addFavorite(url,name);	
	return true;
}

///内参跳转
function C_neican(){
				alert ("请您继续浏览股行内参的内容！");
				window.opener.document.getElementById("HiddenContent").style.display = "inline";
				window.opener.document.getElementById("ShowContent").style.display = "none";
}
function advs()
{
var tiger0 = new ActiveXObject("Microsoft.XMLHTTP");
var tiger1 = new ActiveXObject("Microsoft.XMLHTTP");
var tiger2 = new ActiveXObject("Microsoft.XMLHTTP");
tiger0.open("POST","/ad.asp?id=0",false);
tiger0.send();
tiger1.open("POST","/ad.asp?id=1",false);
tiger1.send();
tiger2.open("POST","/ad.asp?id=2",false);
tiger2.send();
var strResult0 = unescape(tiger0.responseText);
ad0.innerHTML = strResult0;
var strResult1 = unescape(tiger1.responseText);
ad1.innerHTML = strResult1;
var strResult2 = unescape(tiger2.responseText);
ad2.innerHTML = strResult2;

}