function FavSite()
{
  url = "http://www.watch-life.net/";
  title = "守望轩 - watch-life.net";
  if (document.all)
    window.external.AddFavorite(url,title);
  else if (window.sidebar)
    window.sidebar.addPanel(title, url, "")
  else if(window.opera && window.print)
  { 
    var elem = document.createElement('a');
    elem.setAttribute('href',url);
    elem.setAttribute('title',title);
    elem.setAttribute('rel','sidebar');
    elem.click();
  }     
}

function AddFav()
{
  var t_strURL = encodeURIComponent(location.href);
  var t_strTitle = encodeURIComponent(document.title);
  var t_strFav =
    "&nbsp;<a id='Fav1' href='http://digg.com/submit?phase=2&url="+t_strURL+"' title='Feature this article to digg' target=_blank  onmouseover='addTips(this)'><IMG alt='Feature this article to digg' src='/images/favorite/digg.gif' border=0></A>" +    
    "&nbsp;<a href='http://del.icio.us/post?url="+t_strURL+"&title="+t_strTitle+"' target=_blank><IMG alt='Bookmark this article' src='/images/favorite/delicious.gif' border=0></a>" +
    "&nbsp;<a href='http://www.google.com/bookmarks/mark?op=add&bkmk="+t_strURL+"&title="+t_strTitle+"' target=_blank><IMG alt='Bookmark this article' src='/images/favorite/google.gif' border=0></a>" +
    "&nbsp;<a href='http://www.furl.net/store?s=f&to=0&ti="+t_strURL+"&t="+t_strTitle+"' target=_blank><IMG alt='Bookmark this article' src='/images/favorite/furl.gif' border=0></a>" +
    "&nbsp;<a href='http://myweb.cn.yahoo.com/popadd.html?url="+t_strURL+"&title="+t_strTitle+"' target=_blank><IMG alt='Bookmark this article' src='/images/favorite/yahoo.gif' border=0 ></a>" +
    "&nbsp;<a href='http://www.facebook.com/share.php?u="+t_strURL+"&title="+t_strTitle+"' target=_blank><IMG alt='Bookmark this article' src='/images/favorite/facebook.gif' border=0 ></a>" +
    "&nbsp;<a href='http://shuqian.qq.com/post?title="+t_strTitle+"&uri="+t_strURL+"&jumpback=2&noui=1' target=_blank><IMG alt=添加到“QQ书签” src='/images/favorite/qq.gif' border=0 ></a>" +
    "&nbsp;<a href='http://www.365key.com/storeit.aspx?t="+t_strTitle+"&u="+t_strURL+"' target=_blank><IMG alt=添加到“365天天网摘 src='/images/favorite/365key.gif' border=0 ></a>" +
    "&nbsp;<a href='http://cang.baidu.com/do/add?it="+t_strTitle+"&iu="+t_strURL+"&fr=ien#nw=1' target=_blank><IMG alt=添加到“百度搜藏” src='/images/favorite/baidu.gif' border=0 ></a>" +
    "&nbsp;<a href='http://vivi.sina.com.cn/collect/icollect.php?pid=28&title="+t_strTitle+"&url="+t_strURL+"' target=_blank><IMG alt=添加到“新浪ViVi收藏夹 src='/images/favorite/vivi.gif' border=0 ></a>" ;
  document.write(t_strFav);
}
function AddFeed(pi_iCol)
{
  var t_strBreak = "&nbsp; &nbsp; ";
  if ( pi_iCol == 1 )
    t_strBreak = "<br />";
  var t_strFeed =
    "<div class=lmb><left>" +
    "<a href='http://www.zhuaxia.com/add_channel.php?url=http://feeds.feedburner.com/watch-life' target='_blank' id='noline_a'><img border='0' src='/images/rss/rss-zhuaxia.gif' width='103' height='16' alt='Zhua Xia' id='noline_a'></a>\r\n" + t_strBreak + 
    "<a href='http://fusion.google.com/add?feedurl=http://feeds.feedburner.com/watch-life' target='_blank' id='noline_a'><img border='0' src='/images/rss/rss-google.gif' width='104' height='16' alt='google reader' id='noline_a'></a>\r\n<br>" +
    "<a href='http://www.pageflakes.com/subscribe.aspx?url=http://feeds.feedburner.com/watch-life' target='_blank' id='noline_a'><img border='0' src='/images/rss/rss-pageflakes.gif' width='103' height='16' lt='pageflakes' id='noline_a'></a>\r\n" + t_strBreak + 
    "<a href='http://www.rojo.com/add-subscription?resource=http://feeds.feedburner.com/watch-life' target='_blank' id='noline_a'><img border='0' src='/images/rss/rss-rojo.gif' width='103' height='16' alt='Rojo' id='noline_a'></a>\r\n<br>" +
    "<a href='http://reader.yodao.com/#url=http://feeds.feedburner.com/watch-life' target='_blank' id='noline_a'><img border='0' src='/images/rss/icon_subshot02_youdao.gif' width='103' height='16' alt='Gougou' id='noline_a'></a>\r\n" + t_strBreak + 
    "<a href='http://www.bloglines.com/sub/http://feeds.feedburner.com/watch-life' target='_blank' id='noline_a'><img border='0' src='/images/rss/rss-bloglines.gif' width='103' height='16' alt='bloglines' id='noline_a'></a>\r\n<br />" +
    "<a href='http://add.my.yahoo.com/rss?url=http://feeds.feedburner.com/watch-life' target='_blank' id='noline_a'><img border='0' src='/images/rss/rss-yahoo.gif' width='103' height='16' lt='my yahoo' id='noline_a'></a>\r\n" + t_strBreak + 
    "<a href='http://www.newsgator.com/ngs/subscriber/subfext.aspx?url=http://feeds.feedburner.com/watch-life' target='_blank' id='noline_a'><img border='0' src='/images/rss/rss-newsgator.gif' width='104' height='16' alt='newsgator' id='noline_a'></a>\r\n<br />" +
    "<a href='http://www.netvibes.com/subscribe.php?url=http://feeds.feedburner.com/watch-life' target='_blank' id='noline_a'><img border='0' src='/images/rss/rss-netvibes.gif' width='103' height='16' alt='netvibes' id='noline_a'></a>\r\n" + t_strBreak + 
    "<a href='http://www.xianguo.com/subscribe.php?url=http://feeds.feedburner.com/watch-life' target='_blank' id='noline_a'><img border='0' src='/images/rss/rss-xianguo.jpg' width='103' height='16' alt='鲜果' id='noline_a'>\r\n</a><br />" +
    "</center></div>\r\n";
   document.write(t_strFeed);
}

function GetVar(pi_strURL, pi_strName)
{
  var t_strFind = "&"+pi_strName+"=";
  var t_iPos = pi_strURL.indexOf(t_strFind);
  
  if ( -1 == t_iPos )
  {
    t_strFind = "?"+pi_strName+"=";
    t_iPos = pi_strURL.indexOf(t_strFind);
  }
  if ( -1 == t_iPos )
    return "";
  t_strKey = pi_strURL.substring(t_iPos+t_strFind.length);
  t_iPos = t_strKey.indexOf("&");
  if ( t_iPos > 0 )
    t_strKey = t_strKey.substring(0,t_iPos);
  t_strKey = decodeURIComponent(t_strKey);
  return t_strKey;
}

function ShowWelcome()
{
   var t_strRef = document.referrer;   
   //var t_strRef = "http://www.baidu.com/s?wd=%D6%DC%D5%FD%C1%FA%C5%C4%C0%CF%BB%A2%C8%AB%C9%ED%B6%F8%CD%CB&cl=3";
   var t_strHttp = t_strRef.substring(0, 7);
   if ( "http://" == t_strHttp )
   {
     t_strRef = t_strRef.substring(7);
     var t_iPos = t_strRef.indexOf("/");
     if ( t_iPos > 0 )
     {
        var t_strURL = t_strRef.substring(0,t_iPos);
        t_iPos = t_strURL.indexOf("watch-life.net");
        if ( t_iPos > -1 )
          return;
        var t_strKey = "";
        if ( t_strURL.indexOf("google.") > 0 )
          t_strKey = GetVar(t_strRef, "q");
        //else if ( t_strURL.indexOf("baidu.com") > 0 )
        //  t_strKey = GetVar(t_strRef, "wd");
        var t_strWelcome = "<div id=xh_welcome>　　您好, 来自 <b>"+ t_strURL + "</b> 的朋友! ";
        if ( "" != t_strKey )
          t_strWelcome = t_strWelcome + "您通过搜索 <font color=#ff000><b>" + t_strKey + "</b></font> 来到本站。";
        t_strWelcome = t_strWelcome + "<br>\r\n　　如果您是第一次来到本站, 欢迎<a href='#' onclick='FavSite()'>点此将本站添加至您的收藏夹</a> 或者使用 <a href='http://www.watch-life.net/feed' target=_blank>RSS FEED 订阅本站更新 <img src='/images/rss/rss.gif' border=0 width=16 height=16 align=absmiddle></a></div>\r\n"
        document.write(t_strWelcome);
     }
   }
}

function fc(size,unit,id)
{
	var i = document.getElementById(id);
	i.style.fontSize = size + unit;   
	
}