﻿var universal_d = 'ddhw.info';
if((self.location+'').toLowerCase().indexOf('ddhw.net')>=0)
    universal_d = 'ddhw.net';
else if((self.location+'').toLowerCase().indexOf('ddhw.cn')>=0)
    universal_d = 'ddhw.cn';
else if((self.location+'').toLowerCase().indexOf('ddhw.org')>=0)
    universal_d = 'ddhw.org';
else if((self.location+'').toLowerCase().indexOf('ddhw.info')>=0)
    universal_d = 'ddhw.info';

var book_universal_d = 'ddhw.com';
var CISTANITIMER=null;var CISTANISTEP=1;var midhighlightholdertimer=null;var oopstw;var objManager;var secondclicktime=0;var firstclicktime=0;var delaytimer=null;var doneclickflag;var didclick=100; function cleartt() {var len=objManager.length;for(var i=0;i<len;i++) {if(document.getElementById('menuh'+i)) document.getElementById('menuh'+i).className='unhighlight';}}function fmover(obj) {keepit();obj.className='highlight';} function fmout(obj) {obj.className='unhighlight';} function fff(id){if(midhighlightholdertimer!=null) clearTimeout(midhighlightholdertimer);midhighlightholdertimer=null;keepit();build(id);didclick=id;} function build(id){if(document.getElementById('menulist')) dtti();var yx=getYX(document.getElementById("menuh"+id));promptbox = document.createElement('div');promptbox.setAttribute ('id' , 'menulist');promptbox.onmouseover=function(e){keepit();};promptbox.onmouseout= function(e){dttip();}; promptbox.className='mymenu';document.getElementById('boss').appendChild(promptbox);promptbox = eval("document.getElementById('menulist').style");promptbox.position = 'absolute';promptbox.top = yx[0]+24+'px';promptbox.left = yx[1]-4+'px';promptbox.zIndex=95;document.getElementById('menulist').innerHTML =buildOneMenu(id);document.getElementById('menulist').style.visibility='hidden';document.getElementById('menuh'+id).className='highlight';buildframe(yx);} 
function buildframe(yx) {promptbox = document.createElement('div');promptbox.setAttribute ('id' , 'menulistframe');promptbox.className='animatedBox';document.getElementById('boss').appendChild(promptbox);promptbox = eval("document.getElementById('menulistframe').style");promptbox.top = yx[0]+20+'px';promptbox.left = yx[1]-4+'px';openframe();}
function openframe(){var o=document.getElementById('menulistframe');CISTANISTEP=1;o.style.display='block';openframenow();}
function openframenow() {var o=document.getElementById('menulistframe');var oc=document.getElementById('menulist');if(o==null||oc==null){dtti();return;} if (CISTANISTEP>=6) {document.getElementById('menulist').style.visibility='visible';o.style.visibility='hidden';return;} CISTANIsetopenwh(o,CISTANISTEP,oc);CISTANISTEP++;if(CISTANISTEP<=5) CISTANITIMER=setTimeout('openframenow()',20);else if (CISTANISTEP==6) CISTANITIMER=setTimeout('openframenow()',100);}
function closeframe(){var o=document.getElementById('menulistframe');if(o==null){dtti();return;} o.className='animatedBoxHollow';if(CISTANITIMER!=null){clearTimeout(CISTANITIMER);CISTANITIMER=null;} o.style.visibility='visible';document.getElementById('menulist').style.visibility='hidden';CISTANISTEP=1;closeframenow();}
function closeframenow(){var o=document.getElementById('menulistframe');var oc=document.getElementById('menulist');if(o==null||oc==null) {dtti();return;}  CISTANIsetclosewh(o,CISTANISTEP,oc);CISTANISTEP++;if(CISTANISTEP<=4)  setTimeout('closeframenow()',20);else {dtti();}}
function CISTANIsetopenwh(o,step,oc) {var ws=oc.offsetWidth;var hs=oc.offsetHeight;if(step==1) {w=20;h=20;} else if (step==2){w=40;h=50;} else if (step==3) {w=80;h=110;} else if (step==4) { w=110;h=200;} else {w=ws;h=hs;} if(w>ws)  w=ws;if(h>hs) h=hs;o.style.width=w+'px';o.style.height=h+'px';}
function CISTANIsetclosewh(o,step,oc) {var ws=oc.offsetWidth;var hs=oc.offsetHeight;w=CISTANIgetvalue(ws);h=CISTANIgetvalue(hs);if (step>1) h=CISTANIgetvalue(h );if (step>2) h=CISTANIgetvalue(h);if (step>3) h=CISTANIgetvalue(h);o.style.width=parseInt(ws/2)+'px';o.style.height=h+'px';}
function CISTANIgetvalue(v) {if(v<40) return parseInt(v/2);else if(v<200) return parseInt(v/3);else if(v<800) return parseInt(v/4);else return 100;}
function keepit() {if(oopstw!=null) clearTimeout(oopstw);oopstw=null;} function dttip(id) {if(midhighlightholdertimer!=null) clearTimeout(midhighlightholdertimer);midhighlightholdertimer=null;oopstw=setTimeout("closeframe()",300);} function xfff(o, n){if(n==didclick) {keepit();return;} if(didclick!=100) fff(n);else {keepit();dtti();o.className="midhighlight";midhighlightholdertimer=setTimeout("fff("+n+")", 500);}} function dtti() {if(midhighlightholdertimer!=null) clearTimeout(midhighlightholdertimer);midhighlightholdertimer=null;oopstw=null;didclick=100;cleartt();var obj=document.getElementById('boss'); while( obj.hasChildNodes() ) { obj.removeChild( obj.lastChild );}} function getYX( oElement ){var y=0,x=0;while( oElement != null ) {y += oElement.offsetTop;x += oElement.offsetLeft;oElement = oElement.offsetParent;} return [y,x];} function initAll() { var urlstr;if((self.location+'').toLowerCase().indexOf('opchinesenews')>0) urlstr='http://www.topchinesenews.com/'; else if((self.location+'').toLowerCase().indexOf('ddhw.com')>0)  urlstr='http://www.ddhw.com/'; else urlstr='http://www.'+universal_d+'/';objManager=[initbbs(urlstr),initblog(urlstr),initbook('http://info.'+book_universal_d+'/'),initboss(urlstr),initbus(urlstr),initnews(urlstr),inithealth('http://www.ddhealth.cn/'),initmainpage(urlstr)];} function uvw(n){var o=document.getElementById('maindingzi'+n);o.className='dinghi';o.style.background='#ffff80';o.style.color='#ff0000';o.style.fontSize='12px';o.innerText='点击进主页';keepit();dtti();didclick=7;} function uvww(n){var o=document.getElementById('maindingzi'+n);o.className='dingunhi';o.style.background='url(/img/tline.gif)';o.style.color='#f85f00';o.style.fontSize='';o.innerText='顶顶主页';dttip();}
function initbbs(urlstr)
{
  var bbsurl='list.aspx?topic_id=';
  var bbsobj=new Object();

  //bbsobj.list=[['纵论天下',bbsurl+5,1],['军事天地',bbsurl+27,1],['顶顶贴图',bbsurl+18,1],['热门聚焦',bbsurl+8,1],['幽你一默',bbsurl+1,1],['美丽人生',bbsurl+26,1],['我行我秀',bbsurl+21,1],['娱乐八卦',bbsurl+15,1],['音乐欣赏',bbsurl+16,1],['顶顶杂谈',bbsurl+10,1],['我爱厨房',bbsurl+13,1],['医疗保健',bbsurl+2,1],['婚姻家庭',bbsurl+3,1],['子女教育',bbsurl+24,1],['脑筋一动',bbsurl+9,1],['浪漫爱情',bbsurl+4,1],['情趣贴图',bbsurl+28,1],['舞文弄墨',bbsurl+14,1],['金融股市',bbsurl+23,1],['体育健身',bbsurl+7,1],['电脑科技',bbsurl+17,1],['佛教人生',bbsurl+20,1],['基督人生',bbsurl+22,1],['论坛管理',bbsurl+11,1]];
  bbsobj.list=[['<B>主题：转跳到</B>','#',2],['即时新闻','openheadlinenews.aspx?topic_id=1000',1],['新闻热评','mymsgreview.aspx',1],['纵论天下',bbsurl+5,1],['军事天地',bbsurl+27,1],['顶顶贴图',bbsurl+18,1],['热门聚焦',bbsurl+8,1],['幽你一默',bbsurl+1,1],['美丽人生',bbsurl+26,1],['我行我秀',bbsurl+21,1],['娱乐八卦',bbsurl+15,1],['音乐欣赏',bbsurl+16,1],['我爱厨房',bbsurl+13,1],['情感婚姻',bbsurl+3,1],['脑筋一动',bbsurl+9,1],['情趣贴图',bbsurl+28,1],['佛教人生',bbsurl+20,1],['基督人生',bbsurl+22,1],['论坛管理',bbsurl+11,1],['顶顶书库','http://info.'+universal_d+'/wx',1],['顶顶博客','blog',1],['顶顶邮局','club/postoffice.aspx',1],['顶顶健康','http://www.ddhealth.cn',1]];
  bbsobj.baseurl=urlstr;
  bbsobj.alignment=0;
  bbsobj.tdwidth=100;
  bbsobj.tdnum=2;
  bbsobj.height=4;

  return bbsobj;
}

 
function initblog(urlstr)
{
   var blogobj=new Object();

   blogobj.list=[['顶顶博客主页','blog',1],['进入我的博客','blog/blog.aspx',1],['发表博客文章','blog/addnewblog.aspx',1],['创建博客','blog/index.aspx?addnew=yes',1],['博客用户列表','blog/index.aspx?page=1',1],['博客域名','blog/editblog.aspx?delete=3',1],['自己设计博客主页','blog/createmyblog.aspx',1],['博客问答','club/blogqanda.html',1]];
   blogobj.baseurl=urlstr;
   blogobj.alignment=1;
   blogobj.tdwidth=135;
   blogobj.tdnum=1;
   
   return blogobj;
}

 
function initbook(urlstr)
{
   var bookurl='wx/updates.aspx?type_id='
   var bookobj=new Object();

   bookobj.list=[['顶顶书库主页','wx',2],['武侠小说',bookurl+2,1],['言情小说',bookurl+3,1],['都市小说',bookurl+17,1],['现代文学',bookurl+4,1],['科幻小说',bookurl+5,1],['古典文学',bookurl+6,1],['外国文学',bookurl+7,1],['纪实文学',bookurl+8,1],['军事战争',bookurl+9,1],['报告文学',bookurl+10,1],['侦探推理',bookurl+11,1],['儿童文学',bookurl+12,1],['名家经典',bookurl+13,1],['现代诗文',bookurl+14,1],['历史资料',bookurl+15,1],['电脑科技',bookurl+16,1],['网络原创',bookurl+18,1],['玄幻鬼怪',bookurl+19,1],['哲学宗教',bookurl+20,1],['英文原著',bookurl+21,1]];
   bookobj.baseurl=urlstr;
   bookobj.alignment=0;
   bookobj.tdwidth=80;
   bookobj.tdnum=2;

   return bookobj;
}

 

function initboss(urlstr)
{
   var bossobj=new Object();

   bossobj.list=[['顶顶邮局','club/postoffice.aspx',2],['查看注册用户信息','club/accountinfo.aspx',2],['注册笔名','club/registeraccount.aspx',1],['修改密码','club/changeaccountpassword.aspx',1],['我的账户','club/editaccount.aspx',1],['社区交易','club/trade.aspx',1],['社区规则','club/clubrules.aspx',1],['问题解答','club/qanda.html',1],['发贴技巧','club/howtopost.html',1],['邮局问答','club/postofficefaq.html',1],['斑竹专区','club/moderator.html',1]];
   bossobj.baseurl=urlstr;
   bossobj.alignment=0;
   bossobj.tdwidth=80;
   bossobj.tdnum=2;

   return bossobj;
}


function initbus(urlstr)
{
   var busobj=new Object();

   busobj.list=[['查看IP地址',urlstr+'tools/ipaddress.aspx',1],['中文简繁体转换',urlstr+'tools/chinesechar.html',1],['贷款计算器',urlstr+'tools/mortgagecalculator.aspx',1],['顶顶上传（图片，音频，视频）','http://upload.ddhw.cn',1],['公历和农历',urlstr+'tools/calendar.html',1],['HTML简易教程',urlstr+'jc/html/introduction.html',1],['度量衡的换算',urlstr+'tools/unitconverter.html',1],['你开公司的潜力如何？',urlstr+'tools/bizIQ.aspx',1],['测试手机号的凶吉',urlstr+'tools/cellphone.html',1],['美国移民局 Case Status','https://egov.uscis.gov/cris/caseStatusSearchDisplay.do',1],['美国移民局 Processing Dates','https://egov.uscis.gov/cris/jsps/ptimes.jsp',1]];
   busobj.baseurl='';
   busobj.alignment=1;
   busobj.tdwidth=200;
   busobj.tdnum=1;

   return busobj;
}

 

function initnews(urlstr)
{
   var newsobj=new Object();

   newsobj.list=[['新闻热评','mymsgreview.aspx',1],['即时新闻','openheadlinenews.aspx?topic_id=1000',1],['推荐新闻','openheadlinenews.aspx?topic_id=1001',1]];
   newsobj.baseurl=urlstr;
   newsobj.alignment=1;
   newsobj.tdwidth=100;
   newsobj.tdnum=1;

   return newsobj;
}


function inithealth(urlstr)
{
   var healthobj=new Object();

   healthobj.list=[['顶顶健康','',2],['看看你能活多久？','dotest.aspx',2],['家庭医生','type19.html',1],['饮食健康','type1.html',1],['心理健康','type3.html',1],['美容美体','type4.html',1],['两性健康','type5.html',1],['女性健康','type6.html',1],['男性健康','type7.html',1],['运动健身','type8.html',1],['中老年保健','type9.html',1],['婴幼儿保健','type10.html',1],['青少年健康','type11.html',1],['心脑血管','type12.html',1],['消化系统','type15.html',1],['肝脾肾胆','type13.html',1],['五官疾病','type17.html',1],['癌症肿瘤','type14.html',1],['糖尿病','type16.html',1],['其他疾病','type2.html',1]];
   healthobj.baseurl=urlstr;
   healthobj.alignment=0;
   healthobj.tdwidth=85;
   healthobj.tdnum=2;

   return healthobj;
}

function initmainpage(urlstr)
{
    var mpobj=new Object();
    mpobj.list=[['','',1]];
    mpobj.baseurl=urlstr;
    
    return mpobj;
} 

function buildOneMenu(id){var obj=objManager[id];var tdalign=' align=center';var cellH=5;if(obj.alignment!=0) tdalign=' align=left';if(!isNaN(obj.height)) cellH=obj.height;var sttr="<TABLE class=mm style='width:"+obj.tdwidth*obj.tdnum+"px' cellPadding="+cellH+" border=0>";var len=obj.list.length;var pa=0;for(var i=0; i<len;i++){if(pa % obj.tdnum ==0) sttr+="<tr>";if(i==0 && id==0) sttr+="<TD colspan="+obj.list[i][2]+tdalign+">"+obj.list[i][0]+"</TD>"; else {var specialitem="";if(id==0&& (i==19||i==20)) specialitem="style='color:red;'";else if(id==0 && i==21) specialitem="style='color:green;'";sttr+="<TD "+specialitem+" colspan="+obj.list[i][2]+tdalign+" onmouseover='fmover(this)' onmouseout='fmout(this)' title='顶顶小秘密：快速双击 开启新窗口\nTips: Double click to open in a new window' onclick='fclick(event.type,"+id+","+i+")' ondblclick='fclick(event.type,"+id+","+i+")'>"+obj.list[i][0]+"</TD>";} pa +=obj.list[i][2];} while(pa % obj.tdnum !=0){sttr+="<td>&nbsp;</td>";pa++;} sttr+="</tr></table>";return sttr;} function fclick(which,objid,id) {switch (which) {case "click":var d = new Date();if ((d.getTime() - secondclicktime) < 100)  return false;doneclickflag=0;firstclicktime = d.getTime();delaytimer = setTimeout("singleclick("+objid+","+id+")", 350);break; case "dblclick":doubleclick(objid,id);break; default:}} function singleclick( objid,id) {if (firstclicktime - secondclicktime <= 0) return false;doneclickflag=1;var obj=objManager[objid];if(obj.list[id][1].indexOf('http')>=0)  top.location=obj.list[id][1];else top.location=obj.baseurl+obj.list[id][1];} function doubleclick(objid,id) {if(doneclickflag==1) return false; var d = new Date();secondclicktime = d.getTime();if (delaytimer != null) {clearTimeout( delaytimer );delaytimer = null;} var obj=objManager[objid];if(obj.list[id][1].indexOf('http')>=0)  window.open(obj.list[id][1]); else window.open(obj.baseurl+obj.list[id][1]);}

function okayiamready(m) { initAll();
    var mp1='';
    var mp2='';
    if (m!='m') {mp1="<td title='点击进入顶顶主页' nowrap onclick='fclick(event.type,7,0);' ondblclick='fclick(event.type,7,0);' id=maindingzi1 onmousedown='uvw(1);' onmouseover='uvw(1);' onmouseout='uvww(1);' style='cursor:pointer;width:80px;color:#f85f00'>顶顶主页</td>";
                 mp2="<td title='点击进入顶顶主页' nowrap onclick='fclick(event.type,7,0);' ondblclick='fclick(event.type,7,0);' id=maindingzi2 onmousedown='uvw(2);' onmouseover='uvw(2);' onmouseout='uvww(2);' style='cursor:pointer;width:80px;color:#f85f00'>顶顶主页</td>";}
    var om='xfff';  
    var str="<div style='width:100%;background:#d8ebff;' nowrap><div id=boss></div>"+
            "<table class=tt cellspacing=2 width=100%><tr width=100%>"+mp1+
            "<td id=menuh0 onmouseover='if(didclick==0) {keepit();return;} fff(0);didclick=0;' onmouseout='dttip();' onclick='fff(0);' nowrap>&nbsp;轻轻滑过&nbsp;</td>"+
            "<td id=menuh1 onmouseover='"+om+"(this, 1);' onmouseout='dttip();' onclick='fff(1);' nowrap>&nbsp;博 客&nbsp;</td>"+
            "<td id=menuh2 onmouseover='"+om+"(this, 2);' onmouseout='dttip();' onclick='fff(2);' nowrap>&nbsp;顶顶书库&nbsp;</td>"+
            "<td id=menuh6 onmouseover='"+om+"(this, 6);' onmouseout='dttip();' onclick='fff(6);' nowrap>&nbsp;顶顶健康&nbsp;</td>"+
            "<td id=menuh4 onmouseover='"+om+"(this, 4);' onmouseout='dttip();' onclick='fff(4);' nowrap>&nbsp;顶顶资源&nbsp;</td>"+
            "<td id=menuh3 onmouseover='"+om+"(this, 3);' onmouseout='dttip();' onclick='fff(3);' nowrap>&nbsp;社区管理互动&nbsp;</td>"+
             mp2+"</tr></table></div>";
    document.write(str);
} 