/*
Copyright © MaXimuS 1999-2000, All Rights Reserved.
Site: http://www.absolutegb.com/maximus
E-mail: maximus@nsimail.com
*/

IE = (document.all)
NS = (navigator.appName=="Netscape" && navigator.appVersion >= "4")

// To set the link font color, edit the ".navMenu" style
YOffset=20;
NSYOffset=7;
XOffset="10";
NSXOffset=2;
staticMode="advanced";
staticYOffset=20;
linkAlign="center";
linkSize="2";
linkFont="Arial";
linkColor="black";
linkBGColor="white";
linkHColor="black";
linkHBGColor="#FFFF99";
hdrAlign="center";
hdrSize="3";
hdrFont="Arial";
hdrColor="black";
hdrBGColor="#0099FF";
menuIsStatic="yes";
menuWidth=100;
menuBGColor="black";
subWidth=100;
subBGColor="black";
baseTarget="";

subMenus = new Array();
items = new Array();
sub = -1;
names = -1;
lastY = 0;

function showNav(obj, e, which){
if (window.hiding){clearTimeout(hiding)}
if (IE) {
obj.style.pixelLeft=document.body.scrollLeft+event.clientX-event.offsetX+menuWidth-6
obj.style.pixelTop=document.body.scrollTop+event.clientY-event.offsetY-3
if (obj.style.pixelTop+obj.offsetHeight>document.body.scrollTop+document.body.clientHeight) {
obj.style.pixelTop=document.body.scrollTop+document.body.clientHeight-obj.offsetHeight}
obj.style.visibility="visible"
for (xyz=0; xyz<which; xyz++) document.all(subMenus[xyz]).style.visibility="hidden"
for (xyz=which+1; xyz<subMenus.length; xyz++) document.all(subMenus[xyz]).style.visibility="hidden"}
if (NS) {
obj.left=e.pageX-e.layerX+menuWidth-4
obj.top=e.pageY-e.layerY-1
if (obj.top+obj.document.height>window.pageYOffset+window.innerHeight) {
obj.top=window.pageYOffset+window.innerHeight-obj.document.height}
obj.visibility="show";
for (xyz=0; xyz<which; xyz++) document.layers[subMenus[xyz]].visibility="hide"
for (xyz=which+1; xyz<subMenus.length; xyz++) document.layers[subMenus[xyz]].visibility="hide"}}
function showNav2(obj){
if (window.hiding){clearTimeout(hiding)}
if (IE) {obj.style.visibility="visible"}
if (NS) {obj.visibility="show"}}
function hideNav() {
hiding = setTimeout('hideNav2();')}
function hideNav2() {
if (IE) {for (xyz=0; xyz<subMenus.length; xyz++) document.all(subMenus[xyz]).style.visibility="hidden"}
if (NS) {for (xyz=0; xyz<subMenus.length; xyz++) document.layers[subMenus[xyz]].visibility="hide"}}

function navMenuClick(e) {
if (this.target&&this.target=="_blank"){
window.open(this.link)}
else if (this.target&&this.target=="_top"){
top.location=this.link}
else if (this.target){
top.frames[this.target].location=this.link}
else {location = this.link;}}

function makeMenuStatic(mode) {
if (IE) {winY = document.body.scrollTop;var NM=document.all.navMenu.style}
if (NS) {winY = window.pageYOffset;var NM=document.navMenu}
if (mode=="smooth") {
if ((IE||NS) && winY!=lastY) {
smooth = .2 * (winY - lastY);
if(smooth > 0) smooth = Math.ceil(smooth);
else smooth = Math.floor(smooth);
if (IE) NM.pixelTop+=smooth;
if (NS) NM.top+=smooth;
lastY = lastY+smooth;}
setTimeout('makeMenuStatic("smooth")', 1)}
else if (mode=="advanced") {
if ((IE||NS) && winY>YOffset-staticYOffset) {
if (IE) {NM.pixelTop=winY+staticYOffset}
if (NS) {NM.top=winY+staticYOffset}}
else {
if (IE) {NM.pixelTop=YOffset}
if (NS) {NM.top=YOffset-NSYOffset}}
setTimeout('makeMenuStatic("advanced")', 1)}}

function startMenu(header){
if (IE){id='<DIV ID="navMenu" STYLE="position:absolute;visibility:hidden;z-index:199;width:1px;left:'+XOffset+';top:'+YOffset+';">'}
else {id=""}
if (header>''){head=header}
else {head='Menu'}
document.write('<LAYER NAME="navMenu" visibility="hide" left="'+(XOffset-NSXOffset)+'" top="'+(YOffset-NSYOffset)+'" VISIBILITY="show">'+id+'<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 BGCOLOR="'+menuBGColor+'"><TR><TD><TABLE CELLPADDING=0 CELLSPACING=1 BORDER=0 WIDTH="'+menuWidth+'"><TR><TD BGCOLOR="'+hdrBGColor+'" ALIGN="'+hdrAlign+'"><FONT SIZE="'+hdrSize+'" FACE="'+hdrFont+'" COLOR="'+hdrColor+'"><B>'+head+'</TD></TR><TR><TD><TABLE CELLSPACING=1 CELLPADDING=0 BORDER=0 WIDTH="100%">')
cursub="navMenu"}

function addHdr(text) {
if (!text&&IE){height="2";t000=hdrBGColor;hdrBGColor=menuBGColor;}
else {height="0"}
document.write('</TABLE></TD></TR><TR><TD BGCOLOR="'+hdrBGColor+'" ALIGN="'+hdrAlign+'" WIDTH="100%" HEIGHT="'+height+'"><FONT SIZE="'+hdrSize+'" FACE="'+hdrFont+'" COLOR="'+hdrColor+'"><B>'+text+'</TD></TR><TR><TD><TABLE CELLPADDING=0 CELLSPACING=2 BORDER=0 WIDTH="100%">')
if (height=="2"){hdrBGColor=t000}}

function addItem(text, link, target, subName) {
names++;
if (subName&&cursub=="navMenu") {sub++; show="showNav(sub"+subName+", event, "+sub+")"; hide="hideNav()"; subMenus[sub]="sub"+subName}
else {show="";hide="";subName=names;}
if (!target){target=baseTarget}
if (cursub=="navMenu"){subName="main"+subName}
else {subName="s"+names}
if (IE){
document.write('<TR><TD id="'+subName+'c" BGCOLOR="'+linkBGColor+'" onmouseover="'+subName+'a.style.color=\''+linkHColor+'\';bgColor=\''+linkHBGColor+'\';'+show+'" onmouseout="'+subName+'a.style.color=\''+linkColor+'\';bgColor=\''+linkBGColor+'\';'+hide+'"><P ALIGN="'+linkAlign+'"><FONT SIZE="'+linkSize+'" FACE="'+linkFont+'" COLOR="'+linkColor+'"><DIV ID="'+subName+'a" STYLE="position:relative;width:100%;color:'+linkColor+';cursor:default" ALIGN="CENTER">'+text+'</DIV></TD></TR>')}
if (NS){
temph=cursub+'.document.'+subName+'a.document.'+subName+'d'
document.write('<TR><TD BGCOLOR="'+linkBGColor+'"><ILAYER NAME="'+subName+'a"><LAYER NAME="'+subName+'c" WIDTH="100%" onmouseover="'+temph+'.zIndex=\'19\';'+show+'" onmouseout="'+temph+'.zIndex=\'17\';'+hide+'" Z-INDEX="20"></LAYER><LAYER NAME="'+subName+'d" WIDTH="100%" Z-INDEX="17" BGCOLOR="'+linkHBGColor+'"><P ALIGN="'+linkAlign+'"><FONT SIZE="'+linkSize+'" FACE="'+linkFont+'" COLOR="'+linkHColor+'">'+text+'</LAYER><LAYER NAME="'+subName+'b" WIDTH="100%" Z-INDEX="18" BGCOLOR="'+linkBGColor+'"><P ALIGN="'+linkAlign+'"><FONT SIZE="'+linkSize+'" FACE="'+linkFont+'" COLOR="'+linkColor+'">'+text+'</LAYER></ILAYER></TD></TR>')}
if (IE){temp=document.all(subName+"c")
if (target) {temp.target=target} temp.link=link;temp.onclick=navMenuClick}
if (NS){temp=document.layers[cursub].document.layers[subName+"a"].document.layers[subName+"c"]
if (target) {temp.target=target} temp.link=link;temp.captureEvents(Event.MOUSEUP);temp.onmouseup=navMenuClick
items[names]=subName;}}

function endMenu() {
document.write('</TABLE></TD></TR></TABLE></TD></TR></TABLE></LAYER>')
if (IE){document.write('</DIV>')
navMenu.style.visibility="visible"}
if (NS){
for (i=0; i<items.length; i++){
document.layers["navMenu"].document.layers[items[i]+"a"].document.layers[items[i]+"c"].clip.bottom=document.layers["navMenu"].document.layers[items[i]+"a"].document.layers[items[i]+"b"].document.height}
names=-1;
document.layers["navMenu"].visibility="show"}
if (menuIsStatic == "yes") {makeMenuStatic(staticMode);}}

function startSubMenu(subName, width) {
if (!width){width=subWidth}
if (IE){id='ID="sub'+subName+'" STYLE="Position:absolute;Z-Index:200;visibility:hidden;width:1px;" onmouseover="showNav2(sub'+subName+');main'+subName+'c.bgColor=\''+linkHBGColor+'\';main'+subName+'a.style.color=\''+linkHColor+'\';" onmouseout="hideNav(sub'+subName+');main'+subName+'c.bgColor=\''+linkBGColor+'\';main'+subName+'a.style.color=\''+linkColor+'\';"'}
document.write('<LAYER NAME="sub'+subName+'" visibility="hide" onmouseover="showNav2(sub'+subName+');window.top.document.navMenu.document.main'+subName+'a.document.main'+subName+'d.zIndex=\'19\';" onmouseout="hideNav(sub'+subName+');window.top.document.navMenu.document.main'+subName+'a.document.main'+subName+'d.zIndex=\'17\';"><DIV '+id+'><TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 BGCOLOR="'+subBGColor+'"><TR><TD><TABLE CELLPADDING=0 CELLSPACING=1 BORDER=0 BGCOLOR="'+subBGColor+'" WIDTH="'+width+'"><TR><TD><TABLE CELLPADDING=0 CELLSPACING=2 BORDER=0 WIDTH="'+width+'">')
cursub="sub"+subName}

function endSubMenu() {
document.write('</TABLE></TD></TR></TABLE></TD></TR></TABLE></DIV></LAYER>')
if (NS){
for (i=0; i<names+1; i++){
document.layers[cursub].document.layers[items[i]+"a"].document.layers[items[i]+"c"].clip.bottom=document.layers[cursub].document.layers[items[i]+"a"].document.layers[items[i]+"b"].document.height}
names=-1}}
