﻿function killErrors() { return true; } window.onerror = killErrors;
if(self!=top){top.location=self.location;}
var bookmarkname='114啦网址导航';
var countimg=document.createElement('img');
function checkhomepage(){
   if(document.getElementById('logo').isHomePage("http://www.114la.com/") || document.getElementById('logo').isHomePage("http://www.114la.com") ||
   document.getElementById('logo').isHomePage("http://www.114la.com/index.htm") ||
   document.getElementById('logo').isHomePage("http://www.114la.com/index.html")
  )
   {
     return true;
   }else{
     return false;
   }

}
function clicklogo(){
	if (!document.all)
	{
		window.location=('http://www.114la.com/index.htm');
	}
    if(checkhomepage()){
	    window.location=('http://www.114la.com/index.htm');
	}else{ 
		document.getElementById('logourl').style.behavior='url(#default#homepage)';
		document.getElementById('logourl').setHomePage('http://www.114la.com/index.htm'); 
	}
}
function addBookmark(title,url) {
    if( document.all ) {
        window.external.AddFavorite( url, title);
    }else if (window.sidebar) {
        window.sidebar.addPanel(title, url,"");
    } 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 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 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 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";

url[21]="http://passport.sohu.com/login.jsp";
username[21]="UserName";
pwd[21]="Password";

url[22]="http://passport.sohu.com/login.jsp";
username[22]="username";
pwd[22]="passwd";

$("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';
    }
	 if($("maillist"+obj).value==9)
     {
       $("Musername"+obj).value=$("Musername"+obj).value+'@yahoo.cn';
     }
	 	 if(document.getElementById("maillist"+obj).value==22)
    {
	   userName = document.getElementById("Musername"+obj).value;
	   strusername = document.getElementById("Musername"+obj).value+"@sogou.com";	
	   document.getElementById("loginid").value = strusername;
	   document.getElementById("eru").value = "http://mail.sogou.com/2gmail/login.jsp?username="+userName;
	}	
     if(document.getElementById("maillist"+obj).value==21)
    {
frm = document.getElementById("mail_login"+obj);
frm.elements['appid'].value = "1000";
frm.elements['ru'].value = "http://login.mail.sohu.com/servlet/LoginServlet";
frm.elements['eru'].value = "http://login.mail.sohu.com/login.jsp";
frm.elements['ct'].value = "1173080990";
frm.elements['sg'].value = "5082635c77272088ae7241ccdf7cf062";
frm.elements['id'].value = document.getElementById("Musername"+obj).value;
frm.elements['username'].value = document.getElementById("Musername"+obj).value;
frm.elements['password'].value =document.getElementById("Mpwd"+obj).value;
frm.elements['m'].value = document.getElementById("Musername"+obj).value;
frm.elements['mpass'].value = document.getElementById("Mpwd"+obj).value;
frm.elements['loginid'].value = document.getElementById("Musername"+obj).value+"@sohu.com";
frm.elements['passwd'].value = document.getElementById("Mpwd"+obj).value;
frm.elements['fl'].value = "1";
frm.elements['vr'].value = "1|1";
frm.action="http://passport.sohu.com/login.jsp";
}

    SetCookie('mailname',$("Musername"+obj).value);
    setTimeout('ResetPwd('+obj+')',1000);
    return true;
}	

function ResetPwd(obj)
{
	$("Mpwd").value="";
	if (obj!='')
	{
		$("Mpwd"+obj).value="";
	}
	
}
function DelHtml(Word) {
  a = Word.indexOf("<");
  b = Word.indexOf(">");
  len = Word.length;
  c = Word.substring(0, a);
  if(b == -1)
  b = a;
  d = Word.substring((b + 1), len);
  Word = c + d;
  tagCheck = Word.indexOf("<");
   if(tagCheck != -1)
   Word = DelHtml(Word);
   return Word;
} 




function glog(evt)
{	
  evt=evt?evt:window.event;var srcElem=(evt.target)?evt.target:evt.srcElement;
  if(srcElem.id != 'search-more'){
    showDiv("more","none");
  }
try
{
while(srcElem.tagName.toUpperCase()=="A" || srcElem.parentNode.tagName.toUpperCase()=="A") 
{
address=srcElem.href;
urlReg = /^http:\/\/(.*)\/catalog/;
urlReg2 = /^http:\/\/(.*)/; 
if (!urlReg.test(address)){
if(srcElem.parentNode.parentNode.parentNode.parentNode.id=="list"
|| srcElem.parentNode.parentNode.parentNode.id=="fmsites"
|| srcElem.parentNode.parentNode.parentNode.parentNode.id=="coolsite"
|| srcElem.parentNode.parentNode.parentNode.id=="tool"
  )
{
 linkname=DelHtml(srcElem.innerHTML);
 if (linkname!='undefined')
 { 
 wlink=linkname+"+"+address+"_114la_"; 
 wlink+=GetCookie("history");
 wlink=escape(wlink);
 SetCookie("history",wlink); 
 history_show();
 }
}
}
if(urlReg2.test(address)){
		var regular = /\b(http:\/\/[-a-z0-9]+\.114la\.com\b(\/[-a-z0-9_:\@&?=+,.!/~%\$]*)?)/;
		if(!regular.test(address)){
			var urlname = encodeURIComponent(strip_tags(srcElem.innerHTML));
            var q = 0;
			if(getq()){
			   q = 1;	 
			}
            countimg.src = 'http://stat.114la.com/index?u='+encodeURIComponent(address)+'&n='+urlname+'&q='+q+'&i='+Math.random();
		}
}
srcElem = srcElem.parentNode;
}
}
catch(e){}
return true;
}

function getq()
{
   var qvod;
   var user_agent = navigator.userAgent;
   var is_vista = user_agent.indexOf("Windows NT 6.0") > -1 || user_agent.indexOf("Windows Vista") > -1;
   try{
         

	 if(is_vista){
         qvod=null;
	 }else{
		 qvod = new ActiveXObject("QvodInsert.QvodCtrl.1");
	 }		
	 if(qvod== null){
                
        return false;
      
	 }	
	  
   }
   catch( e ){
  
	  return false;
   
   }
   
   delete qvod;
      
   return true;

}

function strip_tags(source) {
	return source.replace(/<[^>]*>/g, "");
}



function history_show()
{   
try
{
 var history=GetCookie("history");
 history=unescape(history);
 var content='';
 if(history!="null"&&history.indexOf("&")==-1)
 {
 history_arg=history.split("_114la_");
 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='<li class="none">对不起，您没有任何浏览记录</li>';

}
}
catch(e){}
}
function ClearHistory()
{
clean=confirm("确定要清除所有的浏览记录？")	
if(clean)
{
	DelCookie("history");
	document.getElementById("history").innerHTML='<li class="none">对不起，您没有任何浏览记录</li>';

	}
}
document.onclick=glog;



var showsoft=false;
var showgame=false;
var show39net=false;
var shownews=false;
var showmeirong=false;


var waitInterval;
var MouseDelayTime=400;
function Hover(obj){
	var fn =function(){
		vaf=obj.getAttribute("onclick");
	    if(typeof(vaf)=="string"){
		   vaf=vaf.replace("this","obj");
		   eval(vaf);
		}else{
		   eval(vaf());
		}
		obj.className = "active";
	}
	clearTimeout(waitInterval);	 
	waitInterval = window.setTimeout(fn,MouseDelayTime);

}
function mouseOut(){
	clearTimeout(waitInterval);
}
function tabMenu(tabId,showContent,selfObj){
	var tag = document.getElementById(tabId+"-menu").getElementsByTagName("li");
	var taglength = tag.length;
	for(i=0; i<taglength; i++){
		   tag[i].className = "";
	}
	selfObj.className = "active";
	for(i=0; j=document.getElementById(tabId+"-box"+i); i++){
	 if(tabId=='board'){
	 if(showsoft==false && i==1){
		$("indexsoft").innerHTML="正在加载中,请稍后...";
        softinfo();
		showsoft=true;
	 }else if (showgame==false && i==2)
	 {        
		$("indexgame").innerHTML="<iframe src='/game.html' frameborder='0' scrolling='no' frameborder='0' width='568' height='305' ></iframe>";
		showgame=true;
	 }else if (show39net==false && i==5)
	 {        
		$("index39net").innerHTML="<iframe src='http://www.39.net/haokan123_index.html' frameborder='0' scrolling='no' frameborder='0' width='568' height='305'></iframe>";
		show39net=true;
	 }else if (shownews==false && i==4)
	 {        
		$("indexnews").innerHTML="<iframe src='http://www.39.net/haokan123_index.html' frameborder='0' scrolling='no' frameborder='0' width='568' height='305'></iframe>";
		shownews=true;
	 }else if (showmeirong==false && i==3)
	 {        
		$("indexmeirong").innerHTML="<iframe src='http://news.qukan.com/114la/index.html' frameborder='0' scrolling='no' frameborder='0' width='568' height='305'></iframe>";
		showmeirong=true;
	 }}
			j.style.display = "none";
		}
		document.getElementById(showContent).style.display = "block";
}
function showDiv(id,type) {
	document.getElementById(id).style.display = type;
}
function moreMenu(showBox) {
	var _selfObj = document.getElementById("search-more");
	tabMenu('search',showBox,_selfObj);
	showDiv("more","none");
}
function softinfo(){
   startRequest("/soft.txt",showsoftinfo);	
}
function showsoftinfo(){
 if(xmlHttp.readyState == 4){
   $("indexsoft").innerHTML=xmlHttp.responseText;
 }
}
function gositesearch(keyword){
	oldkeyword=keyword;
    ylmftime=new Date().getTime();
	url='/search.php?keyword='+encodeURIComponent(keyword)+'&ylmftime='+ylmftime;
    $("indexhtml").innerHTML='<li><img src="/images/weatherloading.gif" />正在搜索中,请稍后...</li>';
	startRequest(url,showsearchsite);
}
function showsearchsite(){
  if(xmlHttp.readyState == 4){
	  if(xmlHttp.status == 200){
	  txt=xmlHttp.responseText;
	  if(txt=='')
	  { 
		 $("indexhtml").innerHTML='<li>没有搜索到相关站点!</li>';
	  }else{
	     $("indexhtml").innerHTML=txt;
	  }
	  }else{
	    $("indexhtml").innerHTML='<li>服务器内部错误!请稍候搜索</li>';
	  }
  }	  
}
 
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 ;
}
var oldkeyword='';
function KeyDown()
{
    if (event.keyCode == 13)
    {
        event.returnValue=false;
        event.cancel = true;
        if($('sitekeyword').value=='' ||JHshStrLen($('sitekeyword').value)<2){
			alert('请输入要搜索的关键字或关键字不能少于2个字节!!');
		}else{
			if ($('sitekeyword').value!=oldkeyword)
			{
				gositesearch($('sitekeyword').value);
			}
			
		}
    }
}
function input(){
	
      if($('sitekeyword').value=='' ||JHshStrLen($('sitekeyword').value)<2 ){//||JHshStrLen($('sitekeyword').value)<3
		 // showindexhtml();
      }else{
		  // $("indexhtml").innerHTML=JHshStrLen($('sitekeyword').value);
		  // 请求判断
		  // if (xmlHttp.readyState!=4)
		   //{
			 //  xmlHttp.abort();
		   //}
	       if ($('sitekeyword').value!=oldkeyword)
		  {
			gositesearch($('sitekeyword').value);
		  }
			
	  }
}
function CopyToClipBoard(){
	window.clipboardData.setData("Text",'114啦网址导航---上网就上114啦!\r\nhttp://www.114la.com/index.html');
	alert("复制成功，请粘贴到你的QQ/MSN上推荐给你的好友，谢谢！");
}
function savehits(linkname,address,type){	
 }
function logad(id){	
}
function searchlog(keywordid){
}
function searchkeywordlog(keywordid){
}