﻿if(self!=top){top.location=self.location;}
 var isylmf=false;
 var bookmarkname='安美奇网址导航';
 var govid="冀ICP备09024754号";
 var dynamichost='www.xamq.com';
 var myReg = /^([a-z0-9.]*)+ylmf.com$/; 
 var countimg=document.createElement('img');
function zhidaoData(data){
    for(var i=0;i<data.list.length-1;i++)
    document.write("<a href='"+data.list[i].url+"' target='_blank'>"+data.list[i].tit+"</a>&nbsp;&nbsp;");

}
function checkhomepage(){
   if(document.getElementById('logo').isHomePage("http://www.anmeiqi.com/") || document.getElementById('logo').isHomePage("http://www.xamq.com") ||
   document.getElementById('logo').isHomePage("http://www.anmeiqi.com") ||
   document.getElementById('logo').isHomePage("http://www.xamq.com")
  )
   {
     return true;
   }else{
     return false;
   }

}
function clicklogo(){
    if(checkhomepage()){
	    window.location=('http://www.anmeiqi.com');
	}else{ 
		document.getElementById('logourl').style.behavior='url(#default#homepage)';
		document.getElementById('logourl').setHomePage('http://www.xamq.com'); 
	}
}
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 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";
}
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 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 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 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;
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.id=="mingzhan"||srcElem.parentNode.parentNode.id=="pagelist"||srcElem.parentNode.parentNode.id=="pagelist2"||srcElem.parentNode.parentNode.id=="indextool" ||srcElem.parentNode.parentNode.parentNode.id=="pagelist"||srcElem.parentNode.parentNode.parentNode.id=="pagelist2"||srcElem.parentNode.parentNode.parentNode.id=="indextool" )
{
 linkname=DelHtml(srcElem.innerHTML); 
 if (linkname!='undefined')
 {
 
 wlink=linkname+"+"+address+"_xamq_"; 
 wlink+=GetCookie("history");
 wlink=escape(wlink);
 SetCookie("history",wlink); 
 history_show();
 }
}
}
if(urlReg2.test(address)){
		var regular = /\b(http:\/\/[-a-z0-9]+\.xamq\.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.xamq.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("_xamq_");
 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 handleStateChange(){
  if(xmlHttp.readyState == 4){
	  //alert(xmlHttp.responseText);
  }	  
}
function savehits(linkname,address,type){	
 }
function logad(id){	
}
function searchlog(keywordid){
}
function searchkeywordlog(keywordid){
}
var showsoft=false;
var showgame=false;
var show39net=false;
var shownews=false;
var shownews7=false;
var shownews8=false;
var shownews9=false;
var showmeirong=false;
function showStm(n){
	if(showsoft==false && n==1){
		$("indexsoft").innerHTML="<iframe src='/index/jywh.html' frameborder='0' scrolling='no' frameborder='0' width='570' height='292'></iframe>";
		showsoft=true;
	}
	if (showgame==false && n==2)
	{        
		$("indexgame").innerHTML="<iframe src='/index/gsqy.html' frameborder='0' scrolling='no' frameborder='0' width='570' height='292'></iframe>";
		showgame=true;
	}
	if (show39net==false && n==4)
	{        
		$("index39net").innerHTML="<iframe src='/index/dnwl.html' frameborder='0' scrolling='no' frameborder='0' width='570' height='292'></iframe>";
		show39net=true;
	}
    if (shownews==false && n==5)
	{        
		$("indexnews").innerHTML="<iframe src='/index/zfjg.html' frameborder='0' scrolling='no' frameborder='0' width='570' height='292'></iframe>";
		shownews=true;
	}
    if (showmeirong==false && n==6)
	{        
		$("indexmeirong").innerHTML="<iframe src='/index/shfw.html' frameborder='0' scrolling='no' frameborder='0' width='570' height='292'></iframe>";
		showmeirong=true;
	}
	for (i=0;i<=6;i++){
		 document.getElementById("stgm" + i).className = "blur";
		 document.getElementById("stm" + i).style.display = "none";
    }
	document.getElementById("stgm" + n).className = "";
	document.getElementById("stm" + n).style.display = "block";
}
function softinfo(){
   startRequest("/index/daohang.html",showsoftinfo);	
}
function showsoftinfo(){
 if(xmlHttp.readyState == 4){
   $("indexsoft").innerHTML=xmlHttp.responseText;
 }
}

function CopyToClipBoard(){
	window.clipboardData.setData("Text",'安美奇网址导航---安全-美丽-奇特的网址导航!\r\nhttp://www.anmeiqi.com');
	alert("复制成功，请粘贴到你的QQ/MSN上推荐给你的好友，谢谢！");
}