var page_id='h';var windowing_time=0;var lastSearch = '';var hwd={host:'http://yehg.net/hwd/',current_session:'null',load_time:900,tmpvars:'',m:'/hwd/manager.php?do=getPg&id=',plusHis:function(id,data){dhtmlHistory.add(id,data);},getID:function(id){return document.getElementById(id);},crlf:function(browser){if(navigator.appName==browser)return'<br />';else return'';},load:function(session_name){if(this.current_session!=session_name){this.page(session_name);this.current_session=session_name;}},page:function(id){switch(id){case'r':setTimeout("hwd.pgRoot()",this.load_time);break;case'h':setTimeout("hwd.pgWelcome()",this.load_time);break;case'c':setTimeout("hwd.DigintoDir(1)",200);break;case's':setTimeout("hwd.pgSearch()",this.load_time);break;case'ns':this.transit('new sites');setTimeout("hwd.pgNewSites()",this.load_time);break;case'ts':setTimeout("hwd.pgTopSites()",this.load_time);break;case'tr':setTimeout("hwd.pgTopRanks()",this.load_time);break;case'nh':setTimeout("hwd.pgNavHacks()",this.load_time);break;case'wh':setTimeout("hwd.pgWhoHack()",this.load_time);break;}},transit:function(pg){this.getID('session_title').innerHTML='';this.getID('session_txt').innerHTML='Generating '+pg+' page ...'+'<br /><img src=\'assets/bar_ani.gif\' />';},
DigintoDir:function(vars){this.current_session="Go There";page_id='c';this.getID('session_title').innerHTML='';this.tmpvars='&go='+vars;displayPg('c');},selectGo:function(catno){if(catno==0)return;page_id='c';this.tmpvars='&go='+catno;displayPg('c');},
pgWelcome:function(){this.getID('session_title').innerHTML="Welcome";displayPg('h');},
pgRoot:function(){this.getID('session_title').innerHTML="";displayPg('r');},pgSearchForm:function(){this.getID('session_title').innerHTML="Search";this.tmpvars='';displayPg('f');
},searchit:function(form){if (form.query.value == lastSearch){alert('Already done!\nPlease provide different keyword to search.');return;}else{lastSearch= form.query.value;}form.query.disabled = 'true';setTimeout("$('query').disabled = ''",5000);this.doSubmit(form);form.query.style.backgroundColor='transparent'; },doSubmit:function(form){if(form.query.value=='Your search :'||form.query.value.length<=2){alert('Enter enough keywords to search!\nMininum => 3 characters');return;}this.tmpvars="q="+form.query.value+"&res=10&booleen=AND";page_id='s';$('session_title').innerHTML='Search Results';new Effect.Appear('session_title');load_content(hwd.m+page_id+'&'+this.tmpvars,'');},pgSearch:function(){this.getID('session_title').innerHTML="Search Result";
page_id='s';displayPg('s');},pgSearchContinue:function(q){this.getID('session_title').innerHTML="Search Result";this.tmpvars='&q='+q;displayPg('s');},pgNewSites:function()
{this.getID('session_title').innerHTML="New Sites";displayPg('ns');},pgWhoHack:function()
{this.getID('session_title').innerHTML="";displayPg('wh');},pgNavHacks:function(){
this.getID('session_title').innerHTML="Navigation Hacks";displayPg('nh');},setTitle:function(str){if(str=='0wn The Box!'){$('session_title').innerHTML=str;var newspan=document.createElement("span");newspan.setAttribute('id','stats_lnk');newspan.setAttribute('style','font-size:10px');$('session_title').appendChild(newspan);$('stats_lnk').innerHTML=' ';}else{$('session_title').innerHTML=str;}if(str==''){document.title='Your Ultimate Hacker Web Directory :: 0wn The B0x!';}if(str!='Welcome'){document.title="Your Ultimate Hacker Web Directory :: "+str;}
},getTitle:function(id){switch(id){case'':return'Welcome';break;case'h':return'Welcome';break;case'r':return'0wn The Box!';break;case'ns':return'New Sites';break;case'sl':return'Submit Links';break;case'ts':return'Top Sites';break;case'tr':return'Top Ranks';break;case's':return'SearchResults';break;case'nh':return'Navigation Hacks';break;case'wh':return'Who Hacked?';break;default:return'';}},open_iframe:function(url,w,h,t)
{Win1=new Window("Win1"+windowing_time,{height:h,width:w,zIndex:101+windowing_time,
resizable:true,title:"<span style='color:#FF6600;font-weight:bold;font-size:13px;'>"+t+"</span>",
url:url,showEffect:Effect.SlideDown,hideEffect:Effect.SlideUp});Win1.showCenter();windowing_time++;},saveAsBk:function(url,title){url=this.host+'goto.php?id='+url;window.sidebar.addPanel(title,url,'');},showContact:function(subj){var str='Please mail hwd[at]yehg.net with Subject title:';if(subj=='ad')str+='\n "HWD Ad Query"';else{str+='\n "HWD Contact: Your Name"';}str+='\n\nThank you.';alert(str);}
}//end of class hwd
var url = window.location+"";
if(url=='http://yehg.org/hwd/'||url=='http://yehg.net/hwd/'){setTimeout("Effect.toggle('jmp_view','appear')",3000);}
if (url.indexOf("id=h")!=-1){$('session_title').innerHTML=hwd.getTitle("h");}
else if (url.indexOf("id=r")!=-1){$('session_title').innerHTML=hwd.getTitle("r");}
else if (url.indexOf("id=ns")!=-1){$('session_title').innerHTML=hwd.getTitle("ns");}
else if (url.indexOf("id=sl")!=-1){$('session_title').innerHTML=hwd.getTitle("sl");}
else if (url.indexOf("id=s")!=-1){$('session_title').innerHTML=hwd.getTitle("s");}
if (url.indexOf("id")==-1) $('session_title').innerHTML=hwd.getTitle("h");
if (url.indexOf("#") >-1){site_title = url.substring(url.indexOf("#")+1,url.length);$(decodeURIComponent(site_title)).style.backgroundColor='#D4FFAA';}