//设置主页
window.onload=function(){
	document.getElementById("set_hp").onclick=function(){
		if(document.all){
			this.style.behavior='url(#default#homepage)';
			this.setHomePage(this.href);
			return false;
		}
	}
}


document.write('<style>'
+'.portal_top { clear:both}'
+'.top_logo,.top_ad,.menu_adl,.menu_nav{ float:left;display:inline}'
+'.top_ad{ margin:0 0 0 10px; width:565px; text-align:center}'
+'.top_logo{ margin:12px 0 0 12px}'
+'.link_nav{ width:160px; float:right; margin-top:10px}'
+'.link_nav li{ margin:3px 0; float:left; width:80px}'
+'.link_nav li img{ margin-right:5px; vertical-align:middle}'
+'.link_nav li a{ color:#868686; font-size:12px; text-decoration:none}'
+'.link_nav li a:hover{ text-decoration: underline; color:#ff802a}'
+'.clear{ clear:both; overflow:hidden; height:0;}'
+'</style>'
+'<div class="ext_top">'
+'<div class="left"><a href="http://www.tiancity.com"><img src="http://images.tiancity.com/images/portal/new/logo_tiancity.jpg" width="144" height="45" /></a></div>'
+'<div class="middle">'
+'<iframe width="560" height="60" src="http://tcmgt.tiancity.com/frmout.aspx?pst=61&uparams=TC01SY01" marginheight="0" marginwidth="0" frameborder="0" ></iframe>'
+'</div>'
+'<ul class="link_nav">'
+'<li><img src="http://images.tiancity.com/include/portalv3/images/portal3rd_home_ico.gif" /><a id="set_hp" href="http://www.tiancity.com">设置主页</a></li>'
+'<li><img src="http://images.tiancity.com/include/portalv3/images/portal3rd_quick_ico.gif" /><a href="http://member.tiancity.com/" target="_blank">通　行　证</a></li>'
+'<li><img src="http://images.tiancity.com/include/portalv3/images/portal3rd_busness_ico.gif" /><a href="http://iga.tiancity.com/" target="_blank">商务合作</a></li>'
+'<li><img src="http://images.tiancity.com/include/portalv3/images/portal3rd_netbar_ico.gif" /><a href="http://pcbar.tiancity.com/" target="_blank">网吧欢乐行</a></li>'
+'</ul>'
+'</div>'
+'<div class="top_nav">'
+'<div class="top_nav_left"></div>'
+'<div class="top_nav_right"></div>'
+'<ul class="sub_item">'
+'<li class="left_ad"><iframe width="206" height="50" src="http://tcmgt.tiancity.com/frmout.aspx?pst=264&uparams=TC01MM01" marginheight="0" marginwidth="0" frameborder="0" ></iframe></li>'
+'<li class="list_item"><a href="http://bbs.tiancity.com" target="_blank"><img src="http://images.tiancity.com/images/portal/new/portal_nav_bbs.jpg" width="38" height="36" title="广场" /></a></li>'
+'<li class="list_item"><a href="http://www.tiancity.com/webphp/netbarregister/pointcard/pointcard.php" target="_blank"><img src="http://images.tiancity.com/images/portal/new/portal_nav_card1.jpg" width="40" height="36" title="充值"   /></a></li>'
+'<li class="list_item"><a href="http://www.tiancity.com/download/Class_296_Time_1.html" target="_blank"><img src="http://images.tiancity.com/images/portal/new/portal_nav_download.jpg" width="52" height="36" title="下载"  /></a></li>'
+'<li class="list_item"><a href="http://ask.tiancity.com" target="_blank"><img src="http://images.tiancity.com/images/portal/new/portal_nav_shop.jpg" width="37" height="36" title="问吧"  /></a></li>'
+'<li class="list_item"><a href="http://service.tiancity.com/homepage/default.asp" target="_blank"><img src="http://images.tiancity.com/images/portal/new/portal_nav_server.jpg" width="68" height="36" title="客服中心"  /></a></li>'
//+'<li class="right_ad"></li>'
+'</ul>'
+'</div>')



/*******用于wiselog统计开始********/
function Nethru_getCookieVal(offset)
{
         var endstr = document.cookie.indexOf (";", offset);
         if (endstr == -1)
                   endstr = document.cookie.length;
         return unescape(document.cookie.substring(offset, endstr));
}

function Nethru_SetCookie(name, value){
   var argv = Nethru_SetCookie.arguments;
   var argc = Nethru_SetCookie.arguments.length;
   var expires = (2 < argc) ? argv[2] : null;
   var path = (3 < argc) ? argv[3] : null;
   var domain = (4 < argc) ? argv[4] : null;
   var secure = (5 < argc) ? argv[5] : false;

  // alert("DOMAIN = " + domain);
   document.cookie = name + "=" + escape (value) +
        ((expires == null) ? "" : ("; expires="+expires.toGMTString())) +
     ((path == null) ? "" : ("; path=" + path)) +
     ((domain == null) ? "" : ("; domain=" + domain)) +
        ((secure == true) ? "; secure" : "");

//      alert(document.cookie);
}

function Nethru_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 Nethru_getCookieVal (j);
      i = document.cookie.indexOf(" ", i) + 1;
      if (i == 0)
         break;
      }
  return null;
}

function Nethru_makePersistentCookie(name,length,path,domain)
{
    var today = new Date();
    var expiredDate = new Date(2011,1,1);
    var cookie;
         var value;

    cookie = Nethru_GetCookie(name);
    if ( cookie ) {
//               alert(cookie);
        return 1;
         }

         var values = new Array();
         for ( i=0; i < length ; i++ ) {
                   values[i] = "" + Math.random();
         }

         value = today.getTime();

         // use first decimal
         for ( i=0; i < length ; i++ ) {
                   value += values[i].charAt(2);
         }

    Nethru_SetCookie(name,value,expiredDate,path,domain);
}

function Nethru_getDomain() {
         var _host   = document.domain;
         var so      = _host.split('.');
         var dm    = so[so.length-2] + '.' + so[so.length-1];
         return (so[so.length-1].length == 2) ? so[so.length-3] + '.' + dm : dm;
}

var Nethru_domain  = Nethru_getDomain();

Nethru_makePersistentCookie("PCID",10,"/",Nethru_domain);
/*******用于wiselog统计结束********/
