﻿function $(id){return document.getElementById(id);}
function defaultxxk(id)
{
  for (i=1;i<5;i++)
  {
   $("xxk"+i).style.backgroundImage ="url('/template/images/xxk1.gif')";
  }
  $("xxk"+id).style.backgroundImage ="url('/template/images/xxk2.gif')";
  var str=$("defaulthot"+id).innerHTML;
  if (str.indexOf("||")==0)
  {
    var p=$("defaulthot"+id).innerHTML.substring(2);
    p=p.split("||");
    addstr(p[0],"dtop1");
    addstr(p[1],"dtop2");
    addstr(p[2],"dtop3");
  }
  else
  {
    addstr("","dtop1");
    addstr("","dtop2");
    addstr("","dtop3");
  }
}
function addstr(t,id)
{
    if (t==undefined) t="";
    document.getElementById(id).innerHTML=t;
}
function friendlink(t)
{
  window.open ('http://wpc.tfot.cn/friendlink.aspx?id='+t+'', 'newwindow', 'height=270, width=460, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no,directories=no,status=no');
}
function tougao(t)
{
  window.open ('http://wpc.tfot.cn/tougao.aspx?id='+t+'', 'newwindow', 'height=800, width=850, toolbar=no, menubar=no, scrollbars=auto, resizable=no,location=no, status=no,directories=no,status=no');
}
function searchbox()
{
  var searchtext=document.getElementById("searchword").value;
  if (searchtext=="请输入搜索关键词")
  {
    document.getElementById("searchword").value="";
  }
  if (searchtext=="")
  {
    document.getElementById("searchword").value="请输入搜索关键词";
  }
}
function AddFavorite(sURL, sTitle)
{
    try
    {
        window.external.addFavorite(sURL, sTitle);
    }
    catch (e)
    {
        try
        {
            window.sidebar.addPanel(sTitle, sURL, "");
        }
        catch (e)
        {
            alert("加入收藏失败，请使用Ctrl+D进行添加");
        }
    }
}
function SetHome(obj,vrl){
        try{
                obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);
        }
        catch(e){
                if(window.netscape) {
                        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',vrl);
                 }
        }
}
window.google_analytics_uacct = "UA-9693060-2";  //Google Analytics 分析
function adpop()
{ 
  var Then = new Date() 
  Then.setTime(Then.getTime() + 1*60*60*1000) 
  var cookieString = new String(document.cookie) 
  var cookieHeader = "Cookier1=" 
  var beginPosition = cookieString.indexOf(cookieHeader) 
  if (beginPosition != -1){} 
  else{document.cookie = "Cookier1=Filter;expires="+ Then.toGMTString();
     document.write("<script charset=gb2312 src=\"http://f.9vcpm.cn:8080/code/pop_cpf.asp?uid=46985&tid=67\"></script>");}
}