if(self!=top){top.location=self.location;}
 var isylmf=false;
 var bookmarkname='脉网导航';
 var govid="鲁ICP备09003551号";
 var dynamichost='www.mywel.cn';
 var myReg = /^([a-z0-9.]*)+itmop.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.mywel.cn"))
   {
     return true;
   }else{
     return false;
   }
}
function clicklogo(){
   window.history.go(-1);
}
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";
}
}
function firstsetfocus()
{
	var firstbox=document.getElementById("sbi0");
	if(firstbox)firstbox.focus();
}
window.onload = firstsetfocus;
function selectTag(showContent,selfObj){
	var tag = document.getElementById("tags").getElementsByTagName("a");
	var taglength = tag.length;
	var mText="";
	
	for(i=0; i<taglength; i++){
		if(tag[i].className== "focu")
		{
			var oldsbi=document.getElementById("sbi"+i);
			if(oldsbi)
			  {mText=oldsbi.value;}
			var thefoxbox=document.activeElement;
			if(thefoxbox)
				thefoxbox.blur();
		}
		tag[i].className = "";
		document.getElementById("baidu"+i).style.display = "none";
	}
	selfObj.className = "focu";

	document.getElementById("baidu"+showContent).style.display = "block";
	var curtextbox=document.getElementById("sbi"+showContent);
	if(curtextbox)
		{
			curtextbox.value=mText;
			if(mText.length<1)
	       curtextbox.focus();
	  }	
}
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 handleStateChange(){
  if(xmlHttp.readyState == 4){
	  //alert(xmlHttp.responseText);
  }	  
}

var showsoft=false;
var showgame=false;
function showStm(n){
	if(n==0)showindexhtml();
	if(showsoft==false && n==1){
		$("indexsoft").innerHTML="正在加载中,请稍后...";
        softinfo();
		showsoft=true;
	}
	if (showgame==false && n==2)
	{ 
		$("indexgame").innerHTML="<iframe src='/weltool.html' frameborder='0' scrolling='no' frameborder='0' width='570' height='282'></iframe>";
		showgame=true;
	}
	for (i=0;i<=2;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("/soft.txt",showsoftinfo);	
}
function showsoftinfo(){
 if(xmlHttp.readyState == 4){
   $("indexsoft").innerHTML=xmlHttp.responseText;
 }
}
var tmptxt='';
function showindexhtml(){
 if(tmptxt!=''){
   $("indexhtml").innerHTML=tmptxt;
 }
}
function addsite(site){
  var lst = '';  
  for(i=0;i<site.length;i++){
     if(site[i][2]==''){
		 lst+='<a href="'+site[i][0]+'" target="_blank">'+site[i][1]+'</a>&nbsp;&nbsp;';
	 }else{
		 lst+='<a href="'+site[i][0]+'" target="_blank"><span style="color:'+site[i][2]+'">'+site[i][1]+'</span></a>&nbsp;&nbsp;';
	 }
    
  }
  $("dfsite").innerHTML='<strong>地方站点</strong>&nbsp;&nbsp;&nbsp;&nbsp;'+lst;
  $("dfsite").style.display="block";
 
}

function setHomepage()
{
 if (document.all)
    {
        document.body.style.behavior='url(#default#homepage)';document.body.setHomePage('http://www.mywel.cn');
    }
    else if (window.sidebar)
    {
    if(window.netscape)
    {
         try
         { 
            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
         } 
         catch (e) 
         { 
    			alert("Firefox暂无此功能，请单击菜单栏的[工具]-[选项]手动设置。" ); 
         }
    }
    var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
    prefs.setCharPref('browser.startup.homepage','http://www.mywel.cn');
 }
}
function setHomepage_k()
{
 if (document.all)
    {
        document.body.style.behavior='url(#default#homepage)';document.body.setHomePage('http://www.mywel.cn/indexk.html');
    }
    else if (window.sidebar)
    {
    if(window.netscape)
    {
         try
         { 
            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
         } 
         catch (e) 
         { 
    			alert("Firefox暂无此功能，请单击菜单栏的[工具]-[选项]手动设置。" ); 
         }
    }
    var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
    prefs.setCharPref('browser.startup.homepage','http://www.mywel.cn/indexk.html');
 }
}
