// -------------------------------------------------------------------------------------
// Modified	06.15.2000 for Intel by Brian Gregory
// Reason:	To abstract menu list generation from this file into an easier to manage
//          external file, to be included separately.
//          Also, to reformat. A couple extra bytes sent down the wire aint gonna
//          kill us.. and readability is a bear with 256+ column lines.
//          Also, to abstract the <many> image http references and put them in one
//          spot... 
//          ... Obfuscated code.. NO MORE!
//
//          MAJOR NEW STUFF:
//          You must include your own images from an external definitions file.
// -------------------------------------------------------------------------------------
function initMenu()
{
    navPics = new imageGroup( g_mnuGroup );
    if (isNS)
        document.captureEvents(Event.MOUSEMOVE | Event.MOUSEUP);

    if (isNS||isIE)
        document.onmousemove = d_findMouse;
    //******* End Basic DHTML Functions ********//

    // body onload fix
    if (document.images)
        dhtmlBrowser=1;

    d_loadChecker();

    if (isNS||isIE)
        { // global vars
    	currentNav = new Array(0);          // holds current dhtml nav (how the nav 
    	                                        // looks right then)
    	d_mouseY=0;                         // cursor positions (calculated as long as 
    	                                        // dhtml nav is on)
    	d_navTimer = setTimeout("null",10); // timeout for nav to dissapear
    	nsFix=0;                            // nsFix used for Netscape mouseover/out bug
    	d_moveNavTimer = setInterval('null',1);
    	clearInterval(d_moveNavTimer);
        }

    cascadeNav = new navObject('cascadeNav',g_nMenuTop,navPics,d_navOnFunc,d_navOffFunc);
    NavObj = null;
    d_popupTimer = setTimeout("null",10); // timeout for nav to appear (allows diagonal mouse movement by delaying nav pop up)

    if (isNS||isIE)
        { // vars used by createNavLayer()
    	d_navtabletop = '<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="173"><TR>' + '<TD WIDTH="1" ROWSPAN="2" BGCOLOR="#a6a6a6"><IMG SRC="' + g_sSpacerImg + '" WIDTH="1" HEIGHT="1"></TD>' + '<TD WIDTH="173" BACKGROUND="' + g_sNavIMGLoc + 'navtopbg.gif"><IMG SRC="' + g_sSpacerImg + '" WIDTH="173" HEIGHT="9"></TD>' + '<TD WIDTH="6"><IMG SRC="' + g_sNavIMGLoc + 'navtopright.gif" WIDTH="6" HEIGHT="9"></TD></TR>' + '<TR><TD WIDTH="173" BGCOLOR="#FFFFCC">' + '<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="173">' + '<TR><TD WIDTH="15"><IMG SRC="' + g_sSpacerImg + '" WIDTH="15" HEIGHT="1"></TD><TD WIDTH="175"><IMG SRC="' + g_sSpacerImg + '" WIDTH="173" HEIGHT="1"></TD><TD WIDTH="18"><IMG SRC="' + g_sSpacerImg + '" WIDTH="18" HEIGHT="1"></TD></TR>';
    	d_navtablebot = '</TABLE></TD><TD WIDTH="6" BACKGROUND="' + g_sTableBG + '"><IMG SRC="' + g_sNavIMGLoc + '/sp0033ff.gif" WIDTH="6" HEIGHT="5"></TD></TR><TR>' + '<TD WIDTH="1"><IMG SRC="' + g_sNavIMGLoc + 'navbotleft.gif" WIDTH="1" HEIGHT="7"></TD>' + '<TD WIDTH="173" BACKGROUND="' + g_sNavIMGLoc + 'navbotbg.gif"><IMG SRC="' + g_sSpacerImg + '" WIDTH="5" HEIGHT="7"></TD>' + '<TD WIDTH="6"><IMG SRC="' + g_sNavIMGLoc + 'navbotright.gif" WIDTH="6" HEIGHT="7"></TD></TR>' + '</TABLE>';
    	d_navspacerow = '<TR><TD COLSPAN="3"><IMG SRC="' + g_sSpacerImg + '" WIDTH="1" HEIGHT="8"></TD></TR>';
    	if (navigator.userAgent.indexOf('Mac')==-1)
    	    {
    	    d_navClass = ((isIE)? 'CLASS="nav1ie"':'CLASS="nav1ns"');
    	    d_navClass2 = ((isIE)? 'CLASS="nav2ie"':'CLASS="nav2ns"');
    	    }
        else
            {
            d_navClass = ((isIE)? 'CLASS="mac1ie"':'CLASS="mac1ns"');
            d_navClass2 = ((isIE)? 'CLASS="mac2ie"':'CLASS="mac2ns"');
            }
        }
}

function endMenuInit()
{
    if ((document.js)&&(isIE))
        {
        xmargin=eval(document.body.leftMargin);
        ymargin=eval(document.body.topMargin);
        }

    if ((document.js)&&(isNS))
        {
        if (document.images.margincheck)
            {
            xmargin=document.images.margincheck.x-1;
            ymargin=document.images.margincheck.y-87; 
            }
        }

    if ((document.js)&&(isNS||isIE))
        {
        d_writeLayer( window,
                    'navconnect',
                    '<IMG SRC="' + g_sNavIMGLoc +'spffffcc.gif"' +
                    'WIDTH="3" HEIGHT="14">',
                    70,
                    d_hidden,
                    ( xmargin+(172-g_nMenuLeft)),
                    0,
                    0,
                    0 );

        createNavScroller(    1, 'up' );
        createNavScroller(    1, 'dn' );
        createNavScroller(    2, 'up' );
        createNavScroller(    2, 'dn' );
        createNavScroller(    3, 'up' );
        createNavScroller(    3, 'dn' );
        }
}

function imageGroup( mnuGRP )
{
    var a,i;

    this.total   = mnuGRP.total;
    this.name_on = new Array(0);
    this.name_off= new Array(0);
    this.url_on  = new Array(0); 
    this.url_off = new Array(0); 
    this.i       = new Object();
    
    for (i=0; i<this.total; i++)
        {
        this.name_on[i] = mnuGRP.items[i].nav_on;
        this.name_off[i] = mnuGRP.items[i].nav_off;
        this.url_on[i] = mnuGRP.items[i].url_on;
        this.url_off[i]= mnuGRP.items[i].url_off;
        }

    // The following images are added in, as they are always used
    // so, I dont want to force the inclusion in the menu building
    // aspect of the code.
    // and always build into the image group the arrow markers
    i++;
    this.name_on[i] = this.name_off[i] = 'navarrowblue';
    this.url_on[i]  = this.url_off[i]  = g_sNavArrowON;

    i++;
    this.name_on[i] = this.name_off[i] = 'navarrow';
    this.url_on[i]  = this.url_off[i]  = g_sNavArrowOFF;
                            
    i++;
    this.name_on[i] = this.name_off[i] = 'navbullet_on';
    this.url_on[i]  = this.url_off[i]  = g_sNavBulletON;

    i++;
    this.name_on[i] = this.name_off[i] = 'navbullet_off';
    this.url_on[i]  = this.url_off[i]  = g_sNavBulletOFF;
    
    this.total = i+1;
    this.cached = 0;
    this.rollovers = false;
    this.index = cacheArray.length;
    cacheArray[this.index] = this;
}

function d_loadImages()
{
    if (document.images)
        { 
        var j;
        for (j=0; j<cacheArray.length; j++)
            d_loadGroup(cacheArray[j]);
        
        if ((document.layers)&&(document.layers.cacher))
            document.layers.cacher.load(g_sCacherHTML,0);
        }
}

function d_loadGroup(obj)
{
    var k;
    for (k=0; k<obj.total; k++)
        d_loadImg(obj,k);
}

function d_loadImg(obj,n)
{
    obj.i[obj.name_on[n]] = new Image();
    var img=obj.i[obj.name_on[n]];
    img.group=obj.index;
    if (!document.layers)
        img.onload = d_countImg;
    img.src = obj.url_on[n];

    obj.i[obj.name_off[n]] = new Image();
    var img=obj.i[obj.name_off[n]];
    img.group=obj.index;
    if (!document.layers)
        img.onload = d_countImg;
    img.src = obj.url_off[n];
}

function d_cacheImages()
{
    var j; 
    for (j=0; j<cacheArray.length; j++)
        d_cacheGroup(cacheArray[j]);
}

function d_cacheGroup(obj)
{
    var k;
    for (k=0; k<obj.total; k++)
        {
        document.write('<IMG SRC="'+ obj.url_on[k] +'" BORDER="0" WIDTH="1" HEIGHT="1" onLoad="d_countImg('+obj.index+');">');
        document.write('<IMG SRC="'+ obj.url_off[k] +'" BORDER="0" WIDTH="1" HEIGHT="1" onLoad="d_countImg('+obj.index+');">');
        }
}

function d_countImg(n)
{
    if (n==null)
        n=this.group;
    var obj=cacheArray[n];
    obj.cached++;
    if (obj.cached==obj.total)
        obj.rollovers = true;
}

function d_swapOn(obj,who)
{
    if (obj.rollovers)
        document[who + '_bttn'].src = obj.i[who+'_on'].src;
}

function d_swapOff(obj,who)
{
    if (obj.rollovers)
        document[who + '_bttn'].src = obj.i[who+'_off'].src;
}

function d_navBullet(layerid,btn,n)
{
    var layer, img, who=layerid+btn;
	if (isIE) 
	    img=document.images[who];
	if (isNS)
	    {
	    layer=d_getLayer(layerid);
	    if (layer==null)
	        return;
        img=layer.document.images[who];
        }
    if (n==1)
        img.src = navPics.i.navbullet_on.src;
    else
        img.src = navPics.i.navbullet_off.src;
}
//******* End Rollover Functions ********//


//******* Basic DHTML Functions ********//
function d_getLayerObjTop(layer)
{
    if (layer==null)
        layer=this;
    if (isIE)
        return layer.style.pixelTop;
    if (isNS)
        return layer.top;
}

function d_equalize(layer)
{
    layer.getTop = d_getLayerObjTop;
    if (isNS)
        layer.style = layer;
}

function d_getEQLayer(spec)
{
    if (isIE)
        return document.all[spec].style;
    if (isNS)
        return d_getLayer(spec);
}

function d_getLayer(spec,base)
{
    var q=0; var temp=null;
    if (isIE)
        return document.all[spec]; 

	if (base==null) 
	    base=document;
    if (base.layers[spec]!=null)
        return base.layers[spec];
	for (q=0; q<base.layers.length; q++)
	    {
	    if(base.layers[q].document.layers.length>0)
	        {
	        temp = d_getLayer(spec,base.layers[q].document);
	        if (temp != null)
	            return temp; 
	        }
        }
	return null;
}

function d_beginLayer(base,theName,z,vis,l,t,w,h,extra)
{
	if (h==null)
	    h=0;
	if (w==null)
	    w='100%';
    if (w==0)
        w=1;
    if (t==null)
        t=0;
    if (l==null)
        l=0;
    l = l + g_nMenuLeft; // BG ADDED
    if (vis==null)
        vis=d_hidden;
    if (z==null)
        z=10;
    if (extra==null)
        extra='';
    if (isIE)
        var px = (isNaN(w))? '':'px';
	if (isIE)
	    document.writeln('<DIV ID="'+theName+'" STYLE="position:absolute; overflow:none; left:'+l+'px; top:'+t+'px; width:'+w+px+'; height:'+h+'px; visibility:'+vis+'; z-index:'+z+'" '+extra+'>');
	if (isNS)
	    base.document.writeln('<LAYER NAME="'+theName+'" left="'+l+'" top="'+t+'" width="'+w+'" height="'+h+'" visibility="'+vis+'" z-index="'+z+'" '+extra+'>');
}

function d_writeLayer(base,theName,content,z,vis,l,t,w,h,extra)
{
	d_beginLayer(base,theName,z,vis,l,t,w,h,extra);
	if (isIE)
	    document.writeln(content +'</DIV>');
	if (isNS)
	    base.document.writeln(content +'</LAYER>');
}

function d_endLayer(base)
{
    if (isIE)
        document.writeln('</DIV>'); 
    if (isNS)
        base.document.writeln('</LAYER>');
}

function d_loadChecker()
{
    if (dhtmlnav)
        d_initNav();
    else
        setTimeout('d_loadChecker()',100);
}

function navObject(name,fpos,imgGroup,startFunc,endFunc)
{
    this.name = name;
    this.fpos=fpos;
    this.ig=imgGroup;
    this.on = startFunc;
    this.off = endFunc;
}

function d_navOnFunc (who)
{
    d_swapOn(navPics,who);
    d_setConnect(this.args[1]);
}

function d_navOffFunc (who)
{
    d_swapOff(navPics,who);
}

function d_initNav()
{
    d_loadImages();
    if ((isIE)&&(document.all.iemargincheck))
        ymargin=document.all.iemargincheck.offsetTop-87;
}

function d_navEnter(who)
{
    if ((who==null)||(who==currentNav[0]))
        {
        clearTimeout(d_navTimer);
        if (isNS)
            {
            if (nsFix==1)
                nsFix=2;
            else nsFix=1;
            }
        }
}

function d_navExit(who)
{
    if (!navPics.rollovers)
        return;
    clearTimeout(d_popupTimer);
    if ((who!=null)&&(currentNav[0]!=who))
        return; 
    if (isNS)
        {
        if (nsFix==2)
            {
            nsFix=0;
            return;
            }
        nsFix=0;
        }
    clearTimeout(d_navTimer);
    d_navTimer = setTimeout("d_endNav();", 1000);
}

function d_navOver(who)
{
    if (isNS||isIE)
        d_startNav(who,cascadeNav,arguments);

    else 
        d_swapOn(cascadeNav.ig,who);
}

function d_navOut(who)
{
    if (isNS||isIE)
        d_navExit(who);
    else
        d_swapOff(cascadeNav.ig,who);
}

function d_findMouse(e)
{
    if (isNS)
        d_mouseY = e.pageY;
    if (isIE)
        d_mouseY = event.clientY + document.body.scrollTop;
}

// check rollovers (is nav loaded?), swaps button, sets d_popupTimer (delayed popup)
function d_startNav(who,obj,args)
{
    if (!navPics.rollovers)
        return;
    d_navEnter(who);
    if (who==currentNav[0])
        return;
    obj.tArgs=args;
    d_popupTimer=setTimeout("d_beginNav('"+who+"',"+obj.name+")",200);
}

// d_popupTimer called (mouse stayed over link for specified time) |  pop up nav and start mouse tracking
function d_beginNav(who,obj)
{
    d_navEnter();
    d_endNav();
    currentNav[0]=who;
    obj.args=obj.tArgs;
    NavObj=obj;
    d_popupNav('nav_'+who);
}

// ends current nav (if there is one)
function d_endNav()
{
    if (currentNav[0]==null)
        return;
    NavObj.off(currentNav[0]);
    NavObj=null; d_hideLev(1,'none');
    d_setConnect(0);
    currentNav[0] = null;
}

// delays hiding of other nav layers when rolling over links with no sub-levels
function d_setHideLev(num,except)
{
    d_popupTimer=setTimeout("d_hideLev("+num+",'"+except+"')",500);
}

// when rolling over new link, hides all nav layers deeper than current link except for its sub-level
function d_hideLev(num,except)
{
    if (num>3)
        return;
    var k=0;
    
    // checks currentNav array for popped-up layers deeper than new link, hides them 
    // and deletes from currentNav | if layer has used the scroll feature, reset its
    // clipping region and hide up/down scroll layers
    for (k=3; k>=num; k--)
        {
	    if ((currentNav[k]!=null)&&(currentNav[k]!=except))
	        {
	        var tLayer=d_getLayer(currentNav[k]);
	        tLayer.style.visibility=d_hidden;
	        if (k>1)
	            d_showHideArrow(currentNav[k],0,tLayer.lev);
            if (isIE)
                d_setLinkClass(currentNav[k]+'_link',0);
	        if (tLayer.clipped != null)
	            {
	            if (isIE)
                    tLayer.style.clip="rect(0 200 2000 0)";
                if (isNS)
                    {
                    tLayer.clip.top=0;
                    tLayer.clip.bottom=2000;
                    }
                d_getEQLayer('navscroll'+k+'up').visibility=d_hidden;
                d_getEQLayer('navscroll'+k+'dn').visibility=d_hidden;
                tLayer.clipped=null;
                }
            currentNav[k]=null;
            }
        }
}

function d_showHideArrow(who,show,lev)
{
    var tLayer = (isIE)? window:d_getLayer(currentNav[lev-1]);
    var img = (show==1)? navPics.i.navarrowblue:navPics.i.navarrow;
    
	if ((tLayer!=null)&&(tLayer.document.images[who+'_ar']))
	    tLayer.document.images[who+'_ar'].src = img.src;
}

function d_setLinkClass(who,onoff)
{
    if (!document.all[who])
        return;
    var lnk = document.all[who];
    if (!lnk.clsname)
        lnk.clsname = lnk.className;
    var cls = lnk.clsname;
    cls += (onoff==1)? 'on':'';
    lnk.className=cls;
}

// shows/hides and sets position of yellow channel layer between buttons and nav layers
function d_setConnect(menu)
{
    var nc = d_getEQLayer('navconnect');
    if (menu==0)
        {
        nc.visibility=d_hidden;
        return;
        }
    if (isNS)
        nc.top=((ymargin+(g_sNavSpacer*menu))-4)+g_nMenuTop;
    if (isIE)
        nc.top=((g_nIEMenuTop+ymargin) + (g_sNavIESpacer*(menu-1)));

    nc.visibility=d_visible;
} 

// pops up new nav layer
function d_popupNav(who,delay)
{
    if (delay!=null)
        {
        d_popupTimer=setTimeout("d_popupNav('"+who+"')",delay);
        return;
        } // if delay is given, come back later
	
	var tLayer = d_getLayer(who);
	if (tLayer==null)
	    return;
    if (who==currentNav[tLayer.lev])
        return;
    
    d_hideLev(tLayer.lev,who);
    currentNav[tLayer.lev]=who;
    d_setNavY(tLayer);
    tLayer.style.visibility=d_visible;
    if (tLayer.lev>1)
        {
        d_showHideArrow(who,1,tLayer.lev);
        if (isIE)
            d_setLinkClass(who+'_link',1);
        }
    else
        NavObj.on(currentNav[0]);
}

// calculates position of new layer based on window properties, mouse position, parent layer position, and new layer height | also determines if scroll layers are needed (it don't fit)
function d_setNavY(tLayer)
{
	if (isIE)
	    {
	    var st = document.body.scrollTop;
	    var wh = document.body.clientHeight;
	    var lh = tLayer.scrollHeight;
	    var pb = document.body.scrollHeight-58;
	    }
	if (isNS)
	    {
        var st = window.pageYOffset;
        var wh = window.innerHeight;
        var lh = tLayer.document.height;
        var pb = document.height-15-45;
        }
	
	var wb = wh+st;
	if ((isIE)&&(wb>pb))
	    wb=pb;
    var temp = d_getLayer(currentNav[tLayer.lev-1]);
    var prevTop=(temp==null)? 0:temp.getTop();
	if (tLayer.lev>1)
	    var y = d_mouseY-Math.round(lh/2);
    else
        var y = NavObj.fpos+ymargin;
	
	if (y<(prevTop+0)) 
	    y =prevTop+0;
	if ((y+lh)>wb)
	    y=wb-lh;
	if (y<(ymargin+67))
	    y=ymargin+67; //if ((y<82)&&(tLayer.lev>=1)) y=82;
	if (y<st) 
	    y=st;
    if( isNS )
        {
        var mnu = d_getEQLayer(tLayer.name);
        if( mnu.name.substr( 0, 3 ) == 'nav' )
            y = g_nMenuTop;

        if( y<0 )
            y=0;
        }
	tLayer.style.top=y;
	if ((y+lh)>wb)
	    {
	    // if layer doesn't fit set scroll layers and start using them
	    tLayer.clipped=1; 
		d_getEQLayer('navscroll'+tLayer.lev+'up').top=y;
		d_getEQLayer('navscroll'+tLayer.lev+'dn').top=wb-14;
		d_moveNav(tLayer.lev,0);
		}
}

// d_scrollNav(): starts scrolling of nav layer (called onmouseover of up/dn scroll layers)
function d_scrollNav(lev,s)
{
    clearInterval(d_moveNavTimer);
    if (lev==0)
        return;
    d_moveNavTimer = setInterval('d_moveNav('+lev+','+s+')',50);
}

// moves nav layer, set layer clip, hides/shows scroll layers (based on nav layer
// height and position of up/dn scroll layers set in d_setNavY)
function d_moveNav(lev,s)
{ 
	var who = d_getLayer(currentNav[lev]);
	if (who==null)
	    {
	    clearInterval(d_moveNavTimer);
	    return;
	    }
	
	var lh = (isIE)? who.scrollHeight:who.document.height;
	var up = d_getLayer('navscroll'+lev+'up');
	var dn = d_getLayer('navscroll'+lev+'dn');
	var y = who.getTop()+s;
	var uptop = up.getTop();
	var dnbot = dn.getTop()+14;
	
	if(y>uptop)
	    y=uptop;
    
    if((y+lh)<dnbot)
        y=dnbot-lh;
	
	up.style.visibility=(y<uptop)? d_visible:d_hidden;
	var topclip = (y<uptop)? (uptop-y+8):0;
	dn.style.visibility=((y+lh)>dnbot)? d_visible:d_hidden;
	var botclip = ((y+lh)>dnbot)? (dnbot-y-10):2000;
	who.style.top=y;
	
	if (isIE)
        who.style.clip = "rect("+topclip+" 200 "+botclip+" 0)";
    if (isNS)
        {
        who.clip.top=topclip;
        who.clip.bottom=botclip;
        }

	if (((s<0)&&((y+lh)==dnbot))||((s>0)&&(y==uptop)))
	    clearInterval(d_moveNavTimer);
}

// generate a nav layer from an array
function createNavLayer(lev,name)
{ 
	var j, tArray='', tLine='', url, submenu, clsname, txt;
	d_beginLayer(this,name,(60+2*lev),d_hidden,(xmargin-6+lev*180),0,173,0,'onmouseover="d_navEnter();" onmouseout="d_navExit();"');
	document.writeln(d_navtabletop);
	for (j=2; j<arguments.length; j++)
	    {
        tArray=arguments[j].split('|');
	  	url=tArray[1]; 
        if (url=='*')
            url=null;
        submenu = tArray[2];
	  	clsname = (url)? d_navClass:d_navClass2;
	  	txt=(url||submenu)? false:true;
	  	if (txt)
	  	    clsname = 'CLASS="nav3"';
		
		tLine='<TR><TD ALIGN="right" VALIGN="top"><IMG SRC=' + g_sSpacerLoc + ' WIDTH="11" HEIGHT="10" NAME="'+name+'_b'+(j-1)+'"></TD><TD><A '+ clsname +' HREF="' + ((url)? tArray[1]:'javascript: // no link') + '"';
		tLine+= ' onmouseover="';   if (!txt) tLine+= "d_navBullet('"+name+"','_b"+(j-1)+"',1); ";   tLine+= (submenu)? ('d_popupNav('+"'"+submenu+"'"+',200);" NAME="'+submenu+'_link"'):('d_setHideLev('+(lev+1)+','+"'none'"+');"');
		tLine+= ' onmouseout="'+ "d_navBullet('"+name+"','_b"+(j-1)+"',0); " + 'clearTimeout(d_popupTimer);">'+tArray[0]+'</A></TD><TD>'+ ((submenu)? '<IMG SRC="' + g_sNavArrow + '" WIDTH="9" HEIGHT="9" NAME="'+submenu+'_ar">':'') +'</TD></TR>' ;
		document.writeln(tLine+d_navspacerow);
		}
	document.writeln(d_navtablebot);
	d_endLayer(this);
	var layer = d_getLayer(name);
	d_equalize(layer);
	layer.lev=lev;
}

// generate an up or down scroll layer at given level
function createNavScroller(lev,which)
{ 
	if (which=='up')
	    {
	    var topbot='top';
	    var s=8;
	    var h=12;
	    }
    else
        {
        which='dn';
        var s=-8;
        var topbot='bot';
        var h=14;
        }
	
	d_beginLayer(this,'navscroll'+lev+which,(60+2*lev+1),d_hidden,(xmargin-6+lev*180),0,0,0,'onmouseover="d_scrollNav('+lev+','+s+'); d_navEnter();" onmouseout="d_scrollNav(0); d_navExit();"');
	document.writeln('<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="173"><TR>');
	document.writeln('<TD WIDTH="6"><IMG SRC="' + g_sNavIMGLoc + 'nav_s_'+topbot+'left.gif" WIDTH="6" HEIGHT="'+h+'"></TD>');
	document.writeln('<TD WIDTH="173" BGCOLOR="#FFFFCC" BACKGROUND="' + g_sNavIMGLoc + 'nav_s_'+topbot+'bg.gif" ALIGN="center"><IMG SRC="' + g_sNavIMGLoc + 'nav_s_'+which+'.gif" WIDTH="12" HEIGHT="'+h+'"></TD>');
	document.writeln('<TD WIDTH="6"><IMG SRC="' + g_sNavIMGLoc + 'nav_s_'+topbot+'right.gif" WIDTH="6" HEIGHT="'+h+'"></TD></TR></TABLE>');
	d_endLayer(this);
	d_equalize(d_getLayer('navscroll'+lev+which));
}

