function 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 getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break; 
}
return "";
}
function setCookie(name, value) 
{
var argv = setCookie.arguments;
var argc = setCookie.arguments.length;
var expDay = (argc > 2) ? argv[2] : 30;
try
{
expDay=parseInt(expDay);
if(expDay<0)expDay=0;
}
catch(e)
{
expDay=30;
}
var expDate = new Date();
// The expDate is the date when the cookie should expire, we will keep it for a month
expDate.setTime( expDate.getTime() + (expDay * 24 * 60 * 60 * 1000) ); 
setCookieVal( name, value, expDate); 	
}
function deleteCookie(name)
{
var exp = new Date();
exp.setTime (exp.getTime() - 1); // This cookie is history
var cval = getCookie (name);
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
function getCookieVal(offset) 
{
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function setCookieVal(name, value)
{
var argv = setCookieVal.arguments;
var argc = setCookieVal.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
function initGuideBar()
{
var forumStructure=forums.XMLDocument.selectSingleNode("forum_structure");
var forumList=forumStructure.selectNodes("forum");
for (var i=0;i<forumList.length;i++)
{
var forum=forumList[i];
treatForum(forum,guide_bar);
}
var viewingForumName=getCookie("viewingForum");
if(viewingForumName!="")
{
openMenu(document.all[viewingForumName]);
}
}
function treatForum(f,tbl)
{
var fl=f.selectNodes("forum");
if(fl==null||fl.length==0)
{
treatLeaf(f,tbl);
}
else
{
var img=document.createElement("img");
img.src="images/lblogo.gif";
img.border=0;
var a=document.createElement("A");
a.appendChild(img);
a.insertAdjacentText("beforeEnd"," "+f.selectSingleNode("alias").text);
a.href="javascript:turn(forum"+f.selectSingleNode("id").text+")";
a.className="p1";
var nobr=document.createElement("nobr");
nobr.appendChild(a);
var tr=tbl.insertRow();
var td=tr.insertCell();
td.appendChild(nobr);
var tr2=tbl.insertRow();
var td2=tr2.insertCell();
var itbl=document.createElement("Table");
tr2.id="forum"+f.selectSingleNode("id").text;
tr2.style.display="none";
td2.appendChild(itbl);
var itr=itbl.insertRow();
var itd=itr.insertCell();
var itd2=itr.insertCell();
itd.innerText=" ";
itd2.appendChild(itbl2);
for(var i=0;i<fl.length;i++)
{
var forum=fl[i];
treatForum(forum,itbl2);
}
}
}
function treatLeaf(leaf,tbl)
{
var tr=tbl.insertRow();
var td=tr.insertCell();
var img=document.createElement("img");
img.src="images/folder_1.gif";
img.border=0;
var a=document.createElement("A");
a.appendChild(img);
a.insertAdjacentText("beforeEnd"," "+leaf.selectSingleNode("alias").text);
a.href=leaf.selectSingleNode("server").text+"forum.html?forum="+leaf.selectSingleNode("id").text;
a.className="p1";
var nobr=document.createElement("nobr");
nobr.appendChild(a);
td.appendChild(nobr);
}
function turn(s)
{
if(s.style.display=="")
{
s.style.display="none";
}
else
{
openMenu(s);
}
}
function hideAll()
{
subfnc.style.display="none";
var forumStructure=forums.XMLDocument.selectSingleNode("forum_structure");
var forumList=forumStructure.selectNodes("forum");
for (var i=0;i<forumList.length;i++)
{
var forum=forumList[i];
hide(forum);
}
}
function hide(f)
{
var fl=f.selectNodes("forum");
if(!(fl==null||fl.length==0))
{
document.all["forum"+f.selectSingleNode("id").text].style.display="none";
for(var i=0;i<fl.length;i++)
{
var forum=fl[i];
hide(forum);
}
}
}
function openMenu(f)
{
setCookie("viewingForum",f.id);
hideAll();
f.style.display="";
var ref=f;
for(var _i=0;_i<30;_i++)
{
if(ref.id=="divMenu2")break;
if(ref.id!="")ref.style.display="";
if(typeof(ref.parentElement)=="undefined")
{
break;
}
else
{
ref=ref.parentElement;
}
}
}
function MM_showHideLayers()
{ //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3)
if ((obj=MM_findObj(args[i]))!=null)
{
v=args[i+2];
if (obj.style)
{
obj=obj.style;
v=(v=='show')?'visible':(v='hide')?'hidden':v;
}
obj.visibility=v;
}
}
function MM_findObj(n, d)
{ //v3.0
var p,i,x;
if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length)
{
d=parent.frames[n.substring(p+1)].document;
n=n.substring(0,p);
}
if(!(x=d[n])&&d.all) x=d.all[n];
for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}
function makeMenu(obj,nest){
nest=(!nest) ? '':'document.'+nest+'.'
this.css=(supportLayer) ? eval(nest+'document.'+obj):eval(obj+'.style')
this.state=1
this.go=0
this.width=supportLayer?this.css.document.width:eval(obj+'.offsetWidth')
this.left=b_getleft
this.obj = obj + "Object"; 	eval(this.obj + "=this")
}
function menuInit()
{
oMenu=new makeMenu('divMenu');
scrolled=supportLayer?"window.pageYOffset":"document.body.scrollTop"
//oMenu.css.left=-oMenu.width+lshow
ltop=(supportLayer)?oMenu.css.top:oMenu.css.pixelTop;
oMenu.css.visibility='visible'
if(moveOnScroll) ie?window.onscroll=checkScrolled:checkScrolled();
}
function b_getleft()
{
var gleft=(supportLayer) ? eval(this.css.left):eval(this.css.pixelLeft);
return gleft;
}
function checkScrolled()
{
if(!oMenu.go)
{
var _scrolled_=eval(scrolled);
var _new_top_=_scrolled_+ltop*(500-_scrolled_)/500;
oMenu.css.top=_new_top_>_scrolled_?_new_top_:_scrolled_;
}
if(supportLayer) setTimeout('checkScrolled()',30)
}
function logout()
{
location.href="logout.jsp";
}
var moveOnScroll=true
var ie=document.all?1:0
var supportLayer=document.layers?1:0
onload=menuInit;
divMenu.innerHTML="<div id='divMenu1' style='position:absolute; visibility:visible; cursor:hand'><table CELLPADDING='0' CELLSPACING='0' WIDTH='25' height='100%' onMouseOver='MM_showHideLayers(&quot;divMenu1&quot;,&quot;&quot;,&quot;hide&quot;,&quot;divMenu2&quot;,&quot;&quot;,&quot;show&quot;)'><tr><td><img SRC='images/dhmenu01.gif' WIDTH='25' HEIGHT='150'></td></tr><tr><td background='images/dhmenu02.gif' height='100%'>&nbsp;</td></tr><tr><td height='175'><img SRC='images/dhmenu03_pconline.gif' WIDTH='25' HEIGHT='175'></td></tr></table></td></tr></table></div><div id='divMenu2' style='position:absolute;  width:135; visibility: hidden' onMouseOut='MM_showHideLayers(&quot;divMenu1&quot;,&quot;&quot;,&quot;show&quot;,&quot;divMenu2&quot;,&quot;&quot;,&quot;hide&quot;)' onMouseOver='MM_showHideLayers(&quot;divMenu1&quot;,&quot;&quot;,&quot;hide&quot;,&quot;divMenu2&quot;,&quot;&quot;,&quot;show&quot;)'><table WIDTH='137' BORDER='0' CELLSPACING='0' CELLPADDING='0'><tr><td VALIGN='TOP' bgcolor='#eeeeee' STYLE='border-top:#FFA200 1px solid;border-bottom:#FFA200 1px solid;'><!--#include file='inc/CX_Menu.Asp'--></td><td VALIGN='TOP' height='100%'><table CELLPADDING='0' CELLSPACING='0' WIDTH='25' height='100%'><tr><td><img SRC='images/dhmenu01.gif' WIDTH='25' HEIGHT='150'></td></tr><tr height='100%'><td background='images/dhmenu02.gif' height='100%'>&nbsp;</td></tr><tr><td height='175'><img SRC='images/dhmenu03_pconline.gif' WIDTH='25' HEIGHT='175'></td></tr></table></td></tr></table></div>";

