// Description: Generates the top navigation menu 

// Code written by external source
q18=0;
q19=new Array();
dh=DQM_divider_height;
q61 =false;
ns=navigator.appName==("Netscape");
ns4=(ns &&(navigator.appVersion.indexOf("4.")!=-1));
mac=(navigator.appVersion.indexOf("Mac")!=-1);
ie=(navigator.appName.toLowerCase().indexOf("microsoft")>-1);
ie5=(navigator.appVersion.toLowerCase().indexOf("msie 5.")!=-1);
ie6=(navigator.appVersion.toLowerCase().indexOf("msie 6.")!=-1);
ie7=(navigator.appVersion.toLowerCase().indexOf("msie 7.")!=-1);
ie4=((ie)&&(!ie5)&&(!ie6)&&(!ie7));
ns5=(navigator.vendor==("Netscape6")|| navigator.product==("Gecko"));
if((ns5)||(ie6)||(ie4)||(ie7))ie5=true;
ie5only=true;
(ie5only)? brn="ie":brn="ns";if((ns5)||((ie5)&&(mac)))brn="ns6";

q58="style.visibility=\"visible\"";
q59="style.visibility=\"hidden\"";
q82=null;document.onmousemove=q80;
onresize=q31;

if(!window.DQM_cancel_onload)
	onload=DQM_handleOnload;

while(eval("window.DQM_subdesc"+q18+"_0"))
{
	q0(q18+"");
	q18++;
}

for(var j=0; j<q19.length; j++)
	q0(q19[j]);

q83="";

for(var j=0;j<q18;j++)
{
	imgwh=q33(eval("DQM_rollover_wh"+j));
	q83+="<img id=qmim"+j+" style='position:absolute;cursor:hand;z-index:9;visibility:hidden;' src='"+eval("DQM_rollover_image"+j)+"' width="+imgwh[0]+" height="+imgwh[1]+" border=0' onclick=\"q32('"+j+"')\">";
}

document.write(q83);

function q0(mindex)
{
	level=0;
	i=0;
	
	while((i=mindex.indexOf("_",i+1))>-1)
		level++;
	
	bw=getLevelVal(mindex,"_width",DQM_border_width);
	q50=q15("DQM_sub_menu_width"+mindex,DQM_sub_menu_width);
	sd="";
	tin="";
	
	if((!ns5)&&(!mac)&&(!ie4))
		tin=" background-color:#ffffff;filter:alpha(opacity=0);";
	
	bc=getLevelVal(mindex,"_color",DQM_border_color);
	sd+="<div id=qm"+mindex+" style='z-index:900"+level+";position:absolute;top:"+0+";left:"+0+";visibility:hidden;width:"+q50+";";
	
	if(bc!="transparent")
		sd+=" background-color:"+bc+";";
	
	sd+="'>";
	i=0;
	
	while(eval("window.DQM_subdesc"+mindex+"_"+i))
	{
		id=mindex+"_"+i;
		
		if(eval("window.DQM_subdesc"+id+"_0"))
			q19=q19.concat(new Array(id));
		
		iid=-1;
		tval=eval("window.DQM_icon_index"+mindex+"_"+i);
		
		if((tval || tval==0)&& eval("window.DQM_icon_image"+tval))
		{
			iid=tval;
			q52=q33(eval("DQM_icon_image_wh"+iid));
			q51=eval("window.DQM_icon_rollover"+iid);
		}
		
		ttn=0;
		
		if(ns5)
			ttn=DQM_margin_left;
		
		tpx=DQM_fontsize+"px";
		
		if(ie4)
			tpx=DQM_fontsize+"pt";

		q47="style='position:absolute;cursor:hand;left:"+bw+";top:"+bw+";width:"+(q50-(bw*2)-ttn)+";";
		q48=" font-weight:"+DQM_fontweight+";font-size:"+tpx+";font-family:"+DQM_fontfamily+";padding-left:"+DQM_margin_left+";padding-top:"+DQM_margin_top+";padding-bottom:"+DQM_margin_bottom+";";
		q49="";
		
		if(iid>-1)
			q49="' border=0 width='"+q52[0]+"' height='"+q52[1]+"'>";

		sd+="<div id=qmitemst"+id+" "+q47+" background-color:"+DQM_menu_bgcolor+";";
		sd+=q48+" text-decoration:"+DQM_textdecoration+";color:"+DQM_textcolor+";";
		sd+="'>";

		if(iid>-1)
			sd+="<img src='"+eval("DQM_icon_image"+iid)+q49;
		
		sd+=eval("DQM_subdesc"+id)+"</div>";
		sd+="<div id=qmitemhl"+id+" "+q47+" visibility:hidden;background-color:"+DQM_hl_bgcolor+";";
		sd+=q48+" text-decoration:"+DQM_hl_textdecoration+";color:"+DQM_hl_textcolor+";";
		sd+="' onclick=\"q32('"+id+"')\">";
		
		if(iid>-1)
			sd+="<img src='"+q51+q49;
		
		sd+=q15("hl_DQM_subdesc"+id,eval("DQM_subdesc"+id))+"</div>";
		i++;
	}
	
	document.write(sd+"</div>");
}

function q1(id,main)
{
	sub=q16("qm"+id);
	subc=sub.children;
	ih=bw;
	
	for(j=0;j<subc.length;j=j+2)
	{
		subc[j].style.top=ih;
		subc[j+1].style.top=ih;
		ih+=subc[j].offsetHeight+dh;
		
		if(j>subc.length-3)ih -=dh;
	}
	
	ih+=bw;
	sub.style.height=ih;
	sub.lasthl=null;
	sub.q60=null;
	sxy=q33(q15("DQM_sub_xy"+id,DQM_sub_xy));
	
	if(main)
	{
		q87=q17(q16("menu"+id));
		q88=q16("qmim"+id);
		q88.style.left=q87.x;
		q88.style.top=q87.y;
		q85=q16("menu"+id);
		tc=q17(q85);
		sub.style.left=tc.x+sxy[0]+q85.offsetWidth;
		sub.style.top=tc.y+sxy[1];
	}
}

function q4(menu)
{
	eval("q16(qmitemhl"+menu.lasthl+")."+q59);
	menu.lasthl=null;
}

function q5(menu,hl_id)
{
	q30(menu);
	eval("q16(qmitemhl"+hl_id+")."+q58);
	q86=menu.q60;
	
	if((q86!=null)&&(hl_id.indexOf(q86)==-1))
	{
		eval("q16(qmitemhl"+q86+")."+q59);
		q6(q86);
	}
	
	menu.q60=null;
	
	if(popIt(hl_id))
		menu.q60=hl_id;
	
	menu.lasthl=hl_id;
}

function q80(e)
{
	if(!q61)
		return;

	q84=event.srcElement.id;
	q81=event.srcElement.parentElement.id;
	tid="n";
	
	if(q84.indexOf("menu")>-1)
	{
		tid=q84.substring(4);
		q79(tid);
	}
	else
	{
		if(q84.indexOf("qmitem")>-1)
			tid=q84;
		else  if(q81.indexOf("qmitem")>-1)
			tid=q81;

		else 
		{
			if((q82!=null)&&(q84.indexOf("qm")<0))
			{
				q6(q82);
				q27(q82);
				q82=null;
			}
		}
		
		if(tid.indexOf("st")>-1)
		{
			tid=tid.substring(8);
			q5(q16("qm"+tid.substring(0,tid.lastIndexOf("_"))),tid);
		}
	}
}

function q79(id)
{
	if(q82!=id)
	{
		if(q82!=null)
		{
			q6(q82);
			q27(q82);
		}
		
		if(eval("window.DQM_rollover_image"+id))
			eval("q16(qmim"+id+")."+q58);
		
		popIt(id);
		q82=id;
	}
}

function popIt(id)
{
	if(q15("DQM_subdesc"+id+"_0",null)!=null)
	{
		eval("q16(qm"+id+")."+q58);
		return true;
	}
}

function q6(id)
{
	tm=q16("qm"+id);
	eval("tm."+q59);
	
	if(tm.lasthl!=null)
		eval("q16(qmitemhl"+tm.lasthl+")."+q59);
		
	ts=tm.q60;
		
	if(ts!=null)
	{
		eval("q16(qmitemhl"+tm.q60+")."+q59);
		tm.q60=null;
		q6(ts);
	}
}

function hideMenu(e)
{
	return;
}

function showMenu(e)
{
	return;
}

function q15(pname,rv)
{
	if(eval("window."+pname))
		return eval(pname);
	else
		return rv;
}

function q16(id)
{
	return eval(id);
}

function q17(o)
{
	var q70=new Object();
	q70.x=o.offsetLeft;
	q70.y=o.offsetTop;
	q64=o.offsetParent;
	
	while(q64 !=null)
	{
		q70.y+=q64.offsetTop;
		q70.x+=q64.offsetLeft;
		q64=q64.offsetParent;
	}
	
	return q70;
}

function DQM_handleOnload()
{
	if(q61)
		return;
		
	q31();
	if(!ie5only)
	{
		i=0;
		
		while(eval("window.DQM_rollover_image"+i))
		{
			q20=q20.concat(new Array(new Image()));
			q20[i].src=eval("DQM_rollover_image"+i);
			q21=q21.concat(new Array(q16("menu"+i).src));
			i++;
		}
	}
	q61=true;
	eval(DQM_onload_statement);
}

function q27(nid)
{
	if(eval("window.DQM_rollover_image"+nid))
	{
		if(ie5only)eval("q16(qmim"+nid+")."+q59);
	else 
		q16("menu"+nid).src=q21[nid];
	}
}

function q30(menu)
{
	if((menu.lasthl!=null)&&(menu.q60==null))
		q4(menu);
}

function q31()
{
	for(i=0;i<q18;i++)
	{
		if(eval("window.DQM_subdesc"+i+"_0"))
			q1(i,true);
	}
	
	for(i=0;i<q19.length;i++)
		q1(q19[i],false);
}

function q32(index)
{
	if(!eval("window.DQM_url"+index))
		return;
	if(eval("window.DQM_urltarget"+index))
		where=eval("DQM_urltarget"+index);
	else
		where=DQM_urltarget;
	
	if((where.length<1)||(where.toLowerCase()=="_self"))
	{
		window.location.href=eval("DQM_url"+index);
	}
	else
	{
		if(where.toLowerCase().indexOf("_parent")>-1)
			eval("parent.window.location=DQM_url"+index);
		else if(where.toLowerCase().indexOf("_new")<0)
			eval("parent."+where+".location=DQM_url"+index);
		else
			window.open(eval("DQM_url"+index));
	}
}

function q33(coords)
{
	var q72=new Array(0,0);
	var txy=coords.indexOf(",");
	
	if(txy!=-1)
	{
		q72[0]=parseInt(coords.substring(0,txy));
		q72[1]=parseInt(coords.substring(txy+1));
	}
	
	return q72;
}

function getLevelVal(id,endv,rt)
{
	level=0;
	k=0;
	
	while((k=id.indexOf("_",k+1))>-1)
		level++;
		
	if(eval("window.DQM_border"+endv+level))
		return eval("DQM_border"+endv+level);
	else 
		return rt;
}
