Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   ASP (http://www.programmingforums.org/forum32.html)
-   -   Java Script/asp/dhtml (http://www.programmingforums.org/showthread.php?t=503)

shadowmaster Sep 10th, 2004 9:12 AM

I integrated a DHTML script into a page on my website. There is some kind of conflict occuring with another script somewhere.

I integrated the script to work with an image map, and the script works great when the url is clicked: http://www.all-pak.com/exemptdg.asp

However, when a user usues the menu on that page (Products/Dangerous Goods/Exempt Packs), the DHTML script would quits working.

I think that the reason that it is not working is that it is conflicting with another script somewhere. I am not a programmer, and any help anyone could provide me would be greatly appreciated. Thanks!


[b]Here is the code for http://www.all-pak.com/exemptdg.asp[b]

:

<%

if request.QueryString("navid")="51" then

secnavon = "style.backgroundColor='#ffbc00'"
thirdnavon = "style.backgroundColor='#041790'"
section = "2"
sectionon = "P7_autoLayers('0','submenu2','submenu13'); Menus.submenu2.show();Menus.submenu13.show()"
end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>All-Pak Exempt Packs</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="allpak.css" rel="stylesheet" type="text/css">

<script language="JavaScript" type="text/JavaScript">

<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
 if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
  document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
 else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
 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);
 if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.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 P7_autoLayers() { //v1.4 by PVII
 var g,b,k,f,args=P7_autoLayers.arguments;a=parseInt(args[0]);if(isNaN(a))a=0;
 if(!document.p7setc){p7c=new Array();document.p7setc=true;for(var u=0;u<10;u++){
 p7c[u]=new Array();}}for(k=0;k<p7c[a].length;k++){if((g=MM_findObj(p7c[a][k]))!=null){
 b=(document.layers)?g:g.style;b.visibility="hidden";}}for(k=1;k<args.length;k++){
 if((g=MM_findObj(args[k]))!=null){b=(document.layers)?g:g.style;b.visibility="visible";f=false;
 for(var j=0;j<p7c[a].length;j++){if(args[k]==p7c[a][j]) {f=true;}}
 if(!f){p7c[a][p7c[a].length++]=args[k];}}}
}
//-->
</script>
<script>
<!--

/*
Image w/ description tooltip- By Dynamic Web Coding (www.dyn-web.com)
Copyright 2002 by Sharon Paine
Visit http://www.dynamicdrive.com for this script
*/

/* IMPORTANT: Put script after tooltip div or
 put tooltip div just before </BODY>. */

var dom = (document.getElementById) ? true : false;
var ns5 = ((navigator.userAgent.indexOf("Gecko")>-1) && dom) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ns4 = (document.layers && !dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ns4 && !ie4 && !ie5) ? true : false;

// resize fix for ns4
var origWidth, origHeight;
if (ns4) {
        origWidth = window.innerWidth; origHeight = window.innerHeight;
        window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

// avoid error of passing event object in older browsers
if (nodyn) { event = "nope" }

/////////////////////// CUSTOMIZE HERE  ////////////////////
// settings for tooltip
// Do you want tip to move when mouse moves over link?
var tipFollowMouse= false;       
// Be sure to set tipWidth wide enough for widest image
var tipWidth= 400;
var offX= -50;        // how far from mouse to show tip
var offY= 40;
var tipFontFamily= "Verdana, arial, helvetica, sans-serif";
var tipFontSize= "8pt";
// set default text color and background color for tooltip here
// individual tooltips can have their own (set in messages arrays)
// but don't have to
var tipFontColor= "#000000";
var tipBgColor= "#DDECFF";
var tipBorderColor= "#000080";
var tipBorderWidth= 1;
var tipBorderStyle= "ridge";
var tipPadding= 4;

// tooltip content goes here (image, description, optional bgColor, optional textcolor)
var messages = new Array();
// multi-dimensional arrays containing:
// image and text for tooltip
// optional: bgColor and color to be sent to tooltip
messages[0] = new Array('exempt_66540.gif','Small Slip Cover Can, 4 oz. Amber NM Glass Bottle with 22-400 Melamine Green Plain Round F217/Teflon Lined Cap, PP Pouch; 12/case',"E7EFF7");
messages[1] = new Array('duck2.gif','Here is a duck on a light blue background.',"#DDECFF");
messages[2] = new Array('test.gif','Test description','black','white');
messages[3] = new Array('exempt_66460.gif','Small Slip Cover Can, 8 oz. Clear Graduated Round Glass Bottle with 58-400 Urea Green Plain Round F217/Teflon Lined Cap, PP Pouch; 12/case',"E7EFF7");

//////////////////// END OF CUSTOMIZATION AREA ///////////////////

// preload images that are to appear in tooltip
// from arrays above
if (document.images) {
        var theImgs = new Array();
        for (var i=0; i<messages.length; i++) {
        theImgs[i] = new Image();
 theImgs[i].src = messages[i][0];
 }
}

// to layout image and text, 2-row table, image centered in top cell
// these go in var tip in doTooltip function
// startStr goes before image, midStr goes between image and text
var startStr = '<table width="' + tipWidth + '"><tr><td align="center" width="100%"><img src="';
var midStr = '" border="0"></td></tr><tr><td valign="top">';
var endStr = '</td></tr></table>';

////////////////////////////////////////////////////////////
// initTip        - initialization for tooltip.
// Global variables for tooltip.
// Set styles for all but ns4.
// Set up mousemove capture if tipFollowMouse set true.
////////////////////////////////////////////////////////////
var tooltip, tipcss;
function initTip() {
        if (nodyn) return;
        tooltip = (ns4)? document.tipDiv.document: (ie4)? document.all['tipDiv']: (ie5||ns5)? document.getElementById('tipDiv'): null;
        tipcss = (ns4)? document.tipDiv: tooltip.style;
        if (ie4||ie5||ns5) {        // ns4 would lose all this on rewrites
 tipcss.width = tipWidth+"px";
 tipcss.fontFamily = tipFontFamily;
 tipcss.fontSize = tipFontSize;
 tipcss.color = tipFontColor;
 tipcss.backgroundColor = tipBgColor;
 tipcss.borderColor = tipBorderColor;
 tipcss.borderWidth = tipBorderWidth+"px";
 tipcss.padding = tipPadding+"px";
 tipcss.borderStyle = tipBorderStyle;
        }
        if (tooltip&&tipFollowMouse) {
 if (ns4) document.captureEvents(Event.MOUSEMOVE);
 document.onmousemove = trackMouse;
        }
}

window.onload = initTip;

/////////////////////////////////////////////////
// doTooltip function
//        Assembles content for tooltip and writes
//        it to tipDiv
/////////////////////////////////////////////////
var t1,t2;        // for setTimeouts
var tipOn = false;        // check if over tooltip link
function doTooltip(evt,num) {
        if (!tooltip) return;
        if (t1) clearTimeout(t1);        if (t2) clearTimeout(t2);
        tipOn = true;
        // set colors if included in messages array
        if (messages[num][2])        var curBgColor = messages[num][2];
        else curBgColor = tipBgColor;
        if (messages[num][3])        var curFontColor = messages[num][3];
        else curFontColor = tipFontColor;
        if (ns4) {
 var tip = '<table bgcolor="' + tipBorderColor + '" width="' + tipWidth + '" cellspacing="0" cellpadding="' + tipBorderWidth + '" border="0"><tr><td><table bgcolor="' + curBgColor + '" width="100%" cellspacing="0" cellpadding="' + tipPadding + '" border="0"><tr><td>'+ startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr + '</td></tr></table></td></tr></table>';
 tooltip.write(tip);
 tooltip.close();
        } else if (ie4||ie5||ns5) {
 var tip = startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr;
 tipcss.backgroundColor = curBgColor;
        tooltip.innerHTML = tip;
        }
        if (!tipFollowMouse) positionTip(evt);
        else t1=setTimeout("tipcss.visibility='visible'",100);
}

var mouseX, mouseY;
function trackMouse(evt) {
        mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
        mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
        if (tipOn) positionTip(evt);
}

/////////////////////////////////////////////////////////////
// positionTip function
// If tipFollowMouse set false, so trackMouse function
// not being used, get position of mouseover event.
// Calculations use mouseover event position,
// offset amounts and tooltip width to position
// tooltip within window.
/////////////////////////////////////////////////////////////
function positionTip(evt) {
        if (!tipFollowMouse) {
 mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
 mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
        }
        // tooltip width and height
        var tpWd = (ns4)? tooltip.width: (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
        var tpHt = (ns4)? tooltip.height: (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
        // document area in view (subtract scrollbar width for ns)
        var winWd = (ns4||ns5)? window.innerWidth-20+window.pageXOffset: document.body.clientWidth+document.body.scrollLeft;
        var winHt = (ns4||ns5)? window.innerHeight-20+window.pageYOffset: document.body.clientHeight+document.body.scrollTop;
        // check mouse position against tip and window dimensions
        // and position the tooltip
        if ((mouseX+offX+tpWd)>winWd)
 tipcss.left = (ns4)? mouseX-(tpWd+offX): mouseX-(tpWd+offX)+"px";
        else tipcss.left = (ns4)? mouseX+offX: mouseX+offX+"px";
        if ((mouseY+offY+tpHt)>winHt)
 tipcss.top = (ns4)? winHt-(tpHt+offY): winHt-(tpHt+offY)+"px";
        else tipcss.top = (ns4)? mouseY+offY: mouseY+offY+"px";
        if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}

function hideTip() {
        if (!tooltip) return;
        t2=setTimeout("tipcss.visibility='hidden'",100);
        tipOn = false;
}

//-->


</script>
<script language="JavaScript" src="allpack_dg.js"></script>


</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" <%if request.querystring("navid")="51" then %>onLoad="<%=sectionon%>"<% end if %> >
<table width="789" border="0" align="center" cellpadding="0" cellspacing="0">
 <tr align="left" valign="top">
  <td width="789" height="77" colspan="3" class="topbackground"><table width="789" height="77" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="182" align="left" valign="bottom"><img src="images/phone_number.gif" width="182" height="77" border="0"></td>
    <td width="420"></td>
    <td width="187" align="right" valign="top"><a href="index.asp"><img src="images/allpak_logo.gif" width="187" height="70" border="0"></a></td>
  </tr>
  </table></td>
 </tr>
 <tr>
  <td width="3" height="25" align="left" valign="top" class="leftnavline"><img src="images/spacer.gif" width="3" height="24" border="0"></td>
  <td width="783" height="25" align="left" valign="top" class="navtopbtmline">
        <!--begin all nav-->
        <!--#include file="nav_dg.asp"-->
        <!--end all nav-->
        <!--begin center section-->
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="left" valign="top">
 <!--begin content-->
  <!--start tips box-->    <!--end tips box-->
  <table width="265" border="0" cellpadding="0" cellspacing="0" align="right">
      <tr>
      <td>
        <!--start tips box-->
        <table width="265" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td colspan=3 height=258><img src="images/dangerous_goods_right.gif" width="265" height=258 border="0" align="bottom"></td>
        </tr>
        <tr>
          <td width=3><img src="images/spacer.gif" width="3" height="3" border="0"></td>
          <td height="250" colspan="2" align="left" valign="top" bgcolor="e6e8f4" class="tipsleftline"><table width="260" border="0" cellspacing="0" cellpadding="10">
            <tr>
            <td align="left" valign="top"><p><span class="tipsboxhead"><br>
              </span> </p>
              </td>
            </tr>
          </table>
          </td>
        </tr>
        <tr>
          <td width="4" height="3" align="right" valign="top"><img src="images/spacer.gif" width="4" height="3" border="0"></td>
          <td width="3" height="3" align="right" valign="top"><img src="images/tipsbox_corner.gif" width="3" height="3" border="0"></td>
          <td width=263 bgcolor="e6e8f4" class="tipsbottomline"><img src="images/spacer.gif" width="12" height="2" border="0"></td>
        </tr>
        </table>
        <!--end tips box-->
      </td>
      </tr>
    </table>
  <table width="500" border="0" cellspacing="0" cellpadding="10">
    <tr>
      <td class=sectionhead><span class="sectionhead"><b>DOT-E 9168 Exemption Shipping Package</b></span></td>
    </tr>
    </table>
  <table height="297" border="0" cellpadding="10" cellspacing="0" dwcopytype="CopyTableRow">
      <tr align="left" valign="top">
      <td height="34" colspan="2" class="pname"><b>DOT-E 9168 Exemption Shipping Package for up to 8 oz. </b></td>
      </tr>
      <tr align="left" valign="top">
      <td height="263"><img src="pix/products/e9168_8oz_small.jpg" width="181" height="168"></td>
      <td height="263"><p class="dg_products_text">This variety of Exemption package includes a Slip Cover Can and can be used to ship up to 8 ounces of liquid or .7 kilograms of solid material. <br>
        <br>
        *Available without bottle and/or absorbent. Contact <a href="mailto:dangerousgoods@all-pak.com">All-Pak Sales Representative</a> for more info. </p>
        <p class="dg_products_text">Container options for this package: <br>
          <br>
          <img src="../dg_bottles.jpg" width="315" height="118" border="0" usemap="#Map"><br>
          </p></td>
      </tr>
    </table>
    <p></p>
  </td>
  </tr>
  </table>
        <!--end center section-->
        </td>
 
 </tr>
 <tr>
 <td width="3" height="3"><img src="images/btm_left_corner.gif" width="3" height="3" border="0"></td>
 <td class="bottomline" width="783"><img src="images/spacer.gif" width="12" height="2" border="0"></td>
 <td width="3" height="3"><img src="images/btm_right_corner.gif" width="3" height="3" border="0"></td>
 </tr>
</table>
<br>
<!--#include file="bottomnav.asp" -->
<map name="Map">
<area shape="rect" coords="0,17,39,113" onmouseover="doTooltip(event,0)" onmouseout="hideTip()">
<area shape="rect" coords="260,1,313,117" onmouseover="doTooltip(event,3)" onmouseout="hideTip()">
</map>
 
<div id="tipDiv" style="position:absolute; visibility:hidden; z-index:100"></div>
</body>
</html>


Here is the code for the navigation include file nav_dg.asp

[code]<%
section = request.QueryString("navid")
if not request.QueryString("navid")<>"" then
section = "2"


end if


secnavon = "style.backgroundColor='#ffbc00'"
secnavoff = "style.backgroundColor='#041790'"

thirdnavon = "style.backgroundColor='#041790'"
thirdnavoff = "style.backgroundColor='#ffbc00'"

if request.QueryString("navid")="1" then
section="2"
abouton = "bgcolor=#041790"

elseif request.QueryString("navid")="2" then
section="2"
productson = "bgcolor=#041790"

elseif request.QueryString("navid")="3" then
section="2"
orderingon = "bgcolor=#041790"

elseif request.QueryString("navid")="4" then
section="2"
techinfoon = "bgcolor=#041790"

elseif request.QueryString("navid")="5" then
section="2"
newson = "bgcolor=#041790"

elseif request.QueryString("navid")="6" then
section="2"
contacton = "bgcolor=#041790"

elseif request.QueryString("navid")="7" then
section="2"
productson = "bgcolor=#041790"
bagson = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="8" then
section="2"
productson = "bgcolor=#041790"
canson = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="9" then
section="2"
productson = "bgcolor=#041790"
cleanon = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="10" then
section="2"
productson = "bgcolor=#041790"
closureon = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="11" then
section="2"
productson = "bgcolor=#041790"
drumson = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="12" then
section="2"
productson = "bgcolor=#041790"
glassconon = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="13" then
section="2"
productson = "bgcolor=#041790"
plasticconon = "bgcolor=#ffbc00"

' dg sections
elseif request.QueryString("navid")="14" then
section="2"
productson = "bgcolor=#041790"
dgon = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="51" then
section="2"
productson = "bgcolor=#041790"
exemptdgon = "bgcolor=#041790"
dgon = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="52" then
section="2"
productson = "bgcolor=#041790"
singledgon = "bgcolor=#041790"
dgon = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="53" then
section="2"
productson = "bgcolor=#041790"
multipledgon = "bgcolor=#041790"
dgon = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="54" then
section="2"
productson = "bgcolor=#041790"
paintdgon = "bgcolor=#041790"
dgon = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="55" then
section="2"
productson = "bgcolor=#041790"
infectdgon = "bgcolor=#041790"
dgon = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="56" then
section="2"
productson = "bgcolor=#041790"
excepteddgon = "bgcolor=#041790"
dgon = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="15" then
section="2"
productson = "bgcolor=#041790"
otheron = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="16" then
section="2"
productson = "bgcolor=#041790"
closespecon = "bgcolor=#041790"
closureon = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="17" then
section="2"
productson = "bgcolor=#041790"
thermopon = "bgcolor=#041790"
closureon = "bgcolor=#ffbc00"
elseif request.QueryString("navid")="18" then
section="2"
productson = "bgcolor=#041790"
thermoseton = "bgcolor=#041790"
closureon = "bgcolor=#ffbc00"
elseif request.QueryString("navid")="19" then
section="2"
productson = "bgcolor=#041790"
whtmetalon = "bgcolor=#041790"
closureon = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="20" then
section="2"
productson = "bgcolor=#041790"
amberglasson = "bgcolor=#041790"
glassconon = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="21" then
section="2"
productson = "bgcolor=#041790"
clearglasson = "bgcolor=#041790"
glassconon = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="22" then
section="2"
productson = "bgcolor=#041790"
pcglasson = "bgcolor=#041790"
glassconon = "bgcolor=#ffbc00"

' Working on Press Relesae Section
elseif request.QueryString("navid")="44" then
section="2"
newson = "bgcolor=#041790"
presson = "bgcolor=#041790"

elseif request.QueryString("navid")="23" then
section="2"
productson = "bgcolor=#041790"
pcclearon = "bgcolor=#041790"
plasticconon = "bgcolor=#ffbc00"

' Start of code added by Jeff.
'
' The code above this ("23") is for Products/Plastic Containers/Clear.
' We're going to add in LDPE here as 43, since that's the first unused number.
elseif request.QueryString("navid")="43" then
section="2"
productson = "bgcolor=#041790"
pcldpeon = "bgcolor=#041790"
plasticconon = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="24" then
section="2"
productson = "bgcolor=#041790"
pcnon = "bgcolor=#041790"
plasticconon = "bgcolor=#ffbc00"
elseif request.QueryString("navid")="25" then
section="2"
productson = "bgcolor=#041790"
pcnaturalon = "bgcolor=#041790"
plasticconon = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="26" then
section="2"
productson = "bgcolor=#041790"
pcspecon = "bgcolor=#041790"
plasticconon = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="27" then
section="2"
productson = "bgcolor=#041790"
pcwhton = "bgcolor=#041790"
plasticconon = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="28" then
section="2"
productson = "bgcolor=#041790"
specmailon = "bgcolor=#041790"
otheron = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="29" then
section="2"
orderingon = "bgcolor=#041790"
ncaon = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="30" then
section="2"
orderingon = "bgcolor=#041790"
caon = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="31" then
section="2"
orderingon = "bgcolor=#041790"
qron = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="32" then
section="2"
orderingon = "bgcolor=#041790"
rcon = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="33" then
section="2"
newson = "bgcolor=#041790"
pron = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="34" then
section="2"
techinfoon = "bgcolor=#041790"
calon = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="35" then
section="2"
techinfoon = "bgcolor=#041790"
capneckon = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="36" then
section="2"
techinfoon = "bgcolor=#041790"
glosson = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="37" then
section="2"
techinfoon = "bgcolor=#041790"
lineron = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="38" then
section="2"
techinfoon = "bgcolor=#041790"
pbdon = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="39" then
section="2"
techinfoon = "bgcolor=#041790"
closuregloss = "bgcolor=#041790"
glosson = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="40" then
section="2"
techinfoon = "bgcolor=#041790"
glassgloss = "bgcolor=#041790"
glosson = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="41" then
section="2"
techinfoon = "bgcolor=#041790"
metalgloss = "bgcolor=#041790"
glosson = "bgcolor=#ffbc00"

elseif request.QueryString("navid")="42" then
section="2"
techinfoon = "bgcolor=#041790"
plasticgloss = "bgcolor=#041790"
glosson = "bgcolor=#ffbc00"

end if



select case section

'case "1"
'about us
'secnav="test1"
'thirdnav="third nav 1"

case "2"
'products
secnav2="<table width=792 border=0 cellspacing=0 cellpadding=0><tr>" &_
"<td id=bag align=center class=secnav "&bagson&" onMouseOver=""bag."&secnavon&";can."&secnavoff&";clean."&secnavoff&";closure."&secnavoff&";drum."&secnavoff&";glass."&secnavoff&";plastic."&secnavoff&";dg."&secnavoff&";other."&secnavoff&"; P7_autoLayers('0','submenu10'); Menus.submenu10.show()""><a class=secnavli href=bags.asp?navid=7>Bags</a></td>" &_
"<td width=1 bgcolor=""#ffffff""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=can align=center class=secnav "&canson&" onMouseOver=""bag."&secnavoff&";can."&secnavon&";clean."&secnavoff&";closure."&secnavoff&";drum."&secnavoff&";glass."&secnavoff&";plastic."&secnavoff&";dg."&secnavoff&";other."&secnavoff&"; P7_autoLayers('0','submenu10'); Menus.submenu10.show()""><a class=secnavli href=cans.asp?navid=8>Cans</a></td>"&_
"<td width=1 bgcolor=""#ffffff""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=clean align=center class=secnav "&cleanon&" onMouseOver=""bag."&secnavoff&";can."&secnavoff&";clean."&secnavon&";closure."&secnavoff&";drum."&secnavoff&";glass."&secnavoff&";plastic."&secnavoff&";dg."&secnavoff&";other."&secnavoff&"; P7_autoLayers('0','submenu10'); Menus.submenu10.show()""><a class=secnavli href=cleansterile.asp?navid=9>Cleaning &amp; Sterilization</a></td>"&_
"<td width=1 bgcolor=""#ffffff""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=closure align=center class=secnav "&closureon&" onMouseOver=""bag."&secnavoff&";can."&secnavoff&";clean."&secnavoff&";closure."&secnavon&";drum."&secnavoff&";glass."&secnavoff&";plastic."&secnavoff&";dg."&secnavoff&";other."&secnavoff&"; P7_autoLayers('0','submenu6'); Menus.submenu6.show()""><a class=secnavli href=closures.asp?navid=10>Closures</a></td>" &_
"<td width=1 bgcolor=""#ffffff""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=drum align=center class=secnav "&drumson&" onMouseOver=""bag."&secnavoff&";can."&secnavoff&";clean."&secnavoff&";closure."&secnavoff&";drum."&secnavon&";glass."&secnavoff&";plastic."&secnavoff&";dg."&secnavoff&";other."&secnavoff&"; P7_autoLayers('0','submenu10'); Menus.submenu10.show()""><a class=secnavli href=drumsandpails.asp?navid=11>Drums &amp; Pails</a></td>" &_
"<td width=1 bgcolor=""#ffffff""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=glass align=center class=secnav "&glassconon&" onMouseOver=""bag."&secnavoff&";can."&secnavoff&";clean."&secnavoff&";closure."&secnavoff&";drum."&secnavoff&";glass."&secnavon&";plastic."&secnavoff&";dg."&secnavoff&";other."&secnavoff&"; P7_autoLayers('0','submenu7'); Menus.submenu7.show()""><a class=secnavli href=glasscontainers.asp?navid=12>Glass Containers</a></td>"&_
"<td width=1 bgcolor=""#ffffff""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=plastic align=center class=secnav "&plasticconon&" onMouseOver=""bag."&secnavoff&";can."&secnavoff&";clean."&secnavoff&";closure."&secnavoff&";drum."&secnavoff&";glass."&secnavoff&";plastic."&secnavon&";dg."&secnavoff&";other."&secnavoff&"; P7_autoLayers('0','submenu8'); Menus.submenu8.show()""><a class=secnavli href=plasticcontainers.asp?navid=13>Plastic Containers</a></td>" &_
"<td width=1 bgcolor=""#ffffff""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=dg align=center class=secnav "&dgon&" onMouseOver=""bag."&secnavoff&";can."&secnavoff&";clean."&secnavoff&";closure."&secnavoff&";drum."&secnavoff&";glass."&secnavoff&";plastic."&secnavoff&";dg."&secnavon&";other."&secnavoff&"; P7_autoLayers('0','submenu13'); Menus.submenu13.show()""><a class=secnavli href=hazardouspackaging.asp?navid=14>Dangerous Goods</a></td>"&_
"<td width=1 bgcolor=""#ffffff""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=other align=center class=secnav "&otheron&" onMouseOver=""bag."&secnavoff&";can."&secnavoff&";clean."&secnavoff&";closure."&secnavoff&";drum."&secnavoff&";glass."&secnavoff&";plastic."&secnavoff&";dg."&secnavoff&";other."&secnavon&"; P7_autoLayers('0','submenu9'); Menus.submenu9.show()""><a class=secnavli href=other.asp?navid=15>Other</a></td></tr></table>"

'ordering
secnav3="<table border=""0"" cellspacing=""0"" cellpadding=""0""><tr>" &_
"<td id=newcust align=center class=secnav "&ncaon&" onMouseOver=""newcust."&secnavon&";credit."&secnavoff&";quote."&secnavoff&";request."&secnavoff&"; P7_autoLayers('0','submenu10'); Menus.submenu10.show()""><a class=secnavli href=""newcustaccnt.asp?navid=29"">New Customer Account</a></td>" &_
"<td width=1 bgcolor=""#ffffff""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=credit align=center class=secnav "&caon&" onMouseOver=""newcust."&secnavoff&";credit."&secnavon&";quote."&secnavoff&";request."&secnavoff&"; P7_autoLayers('0','submenu10'); Menus.submenu10.show()""><a class=secnavli href=""creditapp.asp?navid=30"">Credit Application</a></td>"&_
"<td width=1 bgcolor=""#ffffff""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=quote align=center class=secnav "&qron&" onMouseOver=""newcust."&secnavoff&";credit."&secnavoff&";quote."&secnavon&";request."&secnavoff&"; P7_autoLayers('0','submenu10'); Menus.submenu10.show()""><a class=secnavli href=""quoterequest.asp?navid=31"">Quote Request</a></td>"&_
"<td width=1 bgcolor=""#ffffff""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=request align=center class=secnav "&rcon&" onMouseOver=""newcust."&secnavoff&";credit."&secnavoff&";quote."&secnavoff&";request."&secnavon&"; P7_autoLayers('0','submenu10'); Menus.submenu10.show()""><a class=secnavli href=""requestcatalog.asp?navid=32"">Request Catalog</a></td>" &_
"</tr></table>"



'tech info
secnav4="<table border=0 cellpadding=0 cellspacing=0><tr>"&_
"<td id=convers align=center class=secnav "&calon&" onMouseOver=""convers."&secnavon&";capneck."&secnavoff&";glossary."&secnavoff&";liner."&secnavoff&";pbd."&secnavoff&";P7_autoLayers('0','submenu10'); Menus.submenu10.show()""><a class=secnavli href=""conversion.asp?navid=34"">Conversion Calculator</a></td>"&_
"<td width=1 bgcolor=""#041790""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=capneck align=center class=secnav "&capneckon&" onMouseOver=""convers."&secnavoff&";capneck."&secnavon&";glossary."&secnavoff&";liner."&secnavoff&";pbd."&secnavoff&";P7_autoLayers('0','submenu10'); Menus.submenu10.show()""><a class=secnavli href=""capneck.asp?navid=35"">Cap and Neck Finishes</a></td>"&_
"<td width=1 bgcolor=""#041790""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=glossary align=center class=secnav "&glosson&" onMouseOver=""convers."&secnavoff&";capneck."&secnavoff&";glossary."&secnavon&";liner."&secnavoff&";pbd."&secnavoff&";P7_autoLayers('0','submenu12'); Menus.submenu12.show()""><a class=secnavli href=""glossary.asp?navid=36"">Glossary</a></td>"&_
"<td width=1 bgcolor=""#041790""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=liner align=center class=secnav "&lineron&" onMouseOver=""convers."&secnavoff&";capneck."&secnavoff&";glossary."&secnavoff&";liner."&secnavon&";pbd."&secnavoff&";P7_autoLayers('0','submenu10'); Menus.submenu10.show()""><a class=secnavli href=""Linerdesc.asp?navid=37"">Liner Descriptions</a></td>"&_
"<td width=1 bgcolor=""#041790""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=pbd align=center class=secnav "&pbdon&" onMouseOver=""convers."&secnavoff&";capneck."&secnavoff&";glossary."&secnavoff&";liner."&secnavoff&";pbd."&secnavon&";P7_autoLayers('0','submenu10'); Menus.submenu10.show()""><a class=secnavli href=""plasticbprops.asp?navid=38"">Plastic Bottle Properties</a></td>"&_
"</tr></table>"

'news
secnav5 ="<table border=0 cellpadding=0 cellspacing=0><tr>"&_
"<td id=press align=center class=secnav "&newson&" onMouseOver=""press."&secnavon&""" onMouseOut=""press."&secnavoff&"""><a class=secnavli href=""press.asp?navid=44"">Press Releases</a></td>"&_
"<td width=1><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"</tr></table>"

'closures
thirdnav6 ="<table border=0 cellpadding=0 cellspacing=0><tr>"&_
"<td id=spec align=center class=thirdnav "&closespecon&" onMouseOver=""spec."&thirdnavon&";thermop."&thirdnavoff&";thermoset."&thirdnavoff&";whtmetal."&thirdnavoff&"""><a class=thirdnav href=""specialtyclosures.asp?navid=16"">Specialty</a></td>"&_
"<td width=1 bgcolor=""#041790""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=thermop align=center class=thirdnav "&thermopon&" onMouseOver=""spec."&thirdnavoff&";thermop."&thirdnavon&";thermoset."&thirdnavoff&";whtmetal."&thirdnavoff&"""><a class=thirdnav href=""thermoplasticclosures.asp?navid=17"">Thermoplastic</a></td>"&_
"<td width=1 bgcolor=""#041790""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=thermoset align=center class=thirdnav "&thermoseton&" onMouseOver=""spec."&thirdnavoff&";thermop."&thirdnavoff&";thermoset."&thirdnavon&";whtmetal."&thirdnavoff&"""><a class=thirdnav href=""thermosetclosures.asp?navid=18"">Thermoset</a></td>"&_
"<td width=1 bgcolor=""#041790""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=whtmetal align=center class=thirdnav "&whtmetalon&" onMouseOver=""spec."&thirdnavoff&";thermop."&thirdnavoff&";thermoset."&thirdnavoff&";whtmetal."&thirdnavon&"""><a class=thirdnav href=""whitemetalclosures.asp?navid=19"">White Metal</a></td>"&_
"</tr></table>"

'glass
thirdnav7 ="<table border=0 cellpadding=0 cellspacing=0><tr>"&_
"<td id=amber align=center class=thirdnav "&amberglasson&" onMouseOver=""amber."&thirdnavon&";clearw."&thirdnavoff&";plasticw."&thirdnavoff&"""><a class=thirdnav href=""amberglass.asp?navid=20"">Amber</a></td>"&_
"<td width=1 bgcolor=""#041790""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=clearw align=center class=thirdnav "&clearglasson&" onMouseOver=""amber."&thirdnavoff&";clearw."&thirdnavon&";plasticw."&thirdnavoff&"""><a class=thirdnav href=""clearglass.asp?navid=21"">Clear</a></td>"&_
"<td width=1 bgcolor=""#041790""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=plasticw align=center class=thirdnav "&pcglasson&" onMouseOver=""amber."&thirdnavoff&";clearw."&thirdnavoff&";plasticw."&thirdnavon&"""><a class=thirdnav href=""plasticglass.asp?navid=22"">Plastic Coated</a></td>"&_
"</tr></table>"

'plastic
thirdnav8 ="<table border=0 cellpadding=0 cellspacing=0><tr>"&_
"<td id=ldpe align=center class=thirdnav "&pcldpeon&" onMouseOver=""pclear."&thirdnavoff&";ldpe."&thirdnavon&";nalgene."&thirdnavoff&";natural."&thirdnavoff&";pspec."&thirdnavoff&";pwhite."&thirdnavoff&"""><a class=thirdnav href=""ldpe.asp?navid=43"">LDPE and PET</a></td>"&_
"<td width=1 bgcolor=""#041790""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=nalgene align=center class=thirdnav "&pcnon&" onMouseOver=""pclear."&thirdnavoff&";ldpe."&thirdnavoff&";nalgene."&thirdnavon&";natural."&thirdnavoff&";pspec."&thirdnavoff&";pwhite."&thirdnavoff&"""><a class=thirdnav href=""nalgeneplastic.asp?navid=24"">Nalgene</a></td>"&_
"<td width=1 bgcolor=""#041790""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=natural align=center class=thirdnav "&pcnaturalon&" onMouseOver=""pclear."&thirdnavoff&";ldpe."&thirdnavoff&";nalgene."&thirdnavoff&";natural."&thirdnavon&";pspec."&thirdnavoff&";pwhite."&thirdnavoff&"""><a class=thirdnav href=""naturalplastic.asp?navid=25"">Natural HDPE</a></td>"&_
"<td width=1 bgcolor=""#041790""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=pclear align=center class=thirdnav "&pcclearon&" onMouseOver=""pclear."&thirdnavon&";ldpe."&thirdnavoff&";nalgene."&thirdnavoff&";natural."&thirdnavoff&";pspec."&thirdnavoff&";pwhite."&thirdnavoff&"""><a class=thirdnav href=""clearplastic.asp?navid=23"">PVC and Styrene</a></td>"&_
"<td width=1 bgcolor=""#041790""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=pspec align=center class=thirdnav "&pcspecon&" onMouseOver=""pclear."&thirdnavoff&";ldpe."&thirdnavoff&";nalgene."&thirdnavoff&";natural."&thirdnavoff&";pspec."&thirdnavon&";pwhite."&thirdnavoff&"""><a class=thirdnav href=""specialtyplastic.asp?navid=26"">Specialty</a></td>"&_
"<td width=1 bgcolor=""#041790""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=pwhite align=center class=thirdnav "&pcwhton&" onMouseOver=""pclear."&thirdnavoff&";ldpe."&thirdnavoff&";nalgene."&thirdnavoff&";natural."&thirdnavoff&";pspec."&thirdnavoff&";pwhite."&thirdnavon&"""><a class=thirdnav href=""whiteplastic.asp?navid=27"">White HDPE</a></td>"&_
"</tr></table>"

'dg
thirdnav13 ="<table border=0 cellpadding=0 cellspacing=0><tr>"&_
"<td id=exemptdg align=center class=thirdnav "&exemptdgon&" onMouseOver=""exemptdg."&thirdnavon&";singledg."&thirdnavoff&";multipledg."&thirdnavoff&";paintdg."&thirdnavoff&";infectdg."&thirdnavoff&";excepteddg."&thirdnavoff&"""><a class=thirdnav href=""exemptdg.asp?navid=51"">Exemption Packs</a></td>"&_
"<td width=1 bgcolor=""#041790""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=singledg align=center class=thirdnav "&singledgon&" onMouseOver=""exemptdg."&thirdnavoff&";singledg."&thirdnavon&";multipledg."&thirdnavoff&";paintdg."&thirdnavoff&";infectdg."&thirdnavoff&";excepteddg."&thirdnavoff&"""><a class=thirdnav href=""singledg.asp?navid=52"">Single Bottle</a></td>"&_
"<td width=1 bgcolor=""#041790""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=multipledg align=center class=thirdnav "&multipledgon&" onMouseOver=""exemptdg."&thirdnavoff&";singledg."&thirdnavoff&";multipledg."&thirdnavon&";paintdg."&thirdnavoff&";infectdg."&thirdnavoff&";excepteddg."&thirdnavoff&"""><a class=thirdnav href=""multipledg.asp?navid=53"">Multiple Bottle</a></td>"&_
"<td width=1 bgcolor=""#041790""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=paintdg align=center class=thirdnav "&paintdgon&" onMouseOver=""exemptdg."&thirdnavoff&";singledg."&thirdnavoff&";multipledg."&thirdnavoff&";paintdg."&thirdnavon&";infectdg."&thirdnavoff&";excepteddg."&thirdnavoff&"""><a class=thirdnav href=""paintdg.asp?navid=54"">Paint Can</a></td>"&_
"<td width=1 bgcolor=""#041790""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=infectdg align=center class=thirdnav "&infectdgon&" onMouseOver=""exemptdg."&thirdnavoff&";singledg."&thirdnavoff&";multipledg."&thirdnavoff&";paintdg."&thirdnavoff&";infectdg."&thirdnavon&";excepteddg."&thirdnavoff&"""><a class=thirdnav href=""infectdg.asp?navid=55"">Infectious and Diagnostic</a></td>"&_
"<td width=1 bgcolor=""#041790""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=excepteddg align=center class=thirdnav "&excepteddgon&" onMouseOver=""exemptdg."&thirdnavoff&";singledg."&thirdnavoff&";multipledg."&thirdnavoff&";paintdg."&thirdnavoff&";infectdg."&thirdnavoff&";excepteddg."&thirdnavon&"""><a class=thirdnav href=""excepteddg.asp?navid=56"">Excepted Qty</a></td>"&_
"</tr></table>"

'other
thirdnav9 ="<table border=0 cellpadding=0 cellspacing=0><tr>"&_
"<td id=specmail align=center class=thirdnav "&specmailon&" onMouseOver=""specmail."&thirdnavon&"""><a class=thirdnav href=""specimenmailers.asp?navid=28"">Specimen Mailers</a></td>"&_
"<td width=1><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"</tr></table>"

'glossarys
thirdnav12 ="<table border=0 cellpadding=0 cellspacing=0><tr>"&_
"<td id=closegloss align=center class=thirdnav "&closuregloss&" onMouseOver=""closegloss."&thirdnavon&";glassgloss."&thirdnavoff&";metalgloss."&thirdnavoff&";plasticgloss."&thirdnavoff&"""><a class=thirdnav href=""closuresgloss.asp?navid=39"">Closures</a></td>"&_
"<td width=1 bgcolor=""#041790""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=glassgloss align=center class=thirdnav "&glassgloss&" onMouseOver=""closegloss."&thirdnavoff&";glassgloss."&thirdnavon&";metalgloss."&thirdnavoff&";plasticgloss."&thirdnavoff&"""><a class=thirdnav href=""glassgloss.asp?navid=40"">Glass Containers</a></td>"&_
"<td width=1 bgcolor=""#041790""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=metalgloss align=center class=thirdnav "&metalgloss&" onMouseOver=""closegloss."&thirdnavoff&";glassgloss."&thirdnavoff&";metalgloss."&thirdnavon&";plasticgloss."&thirdnavoff&"""><a class=thirdnav href=""metalgloss.asp?navid=41"">Metal Containers</a></td>"&_
"<td width=1 bgcolor=""#041790""><img src=/images/spacer.gif width=1 border=0 height=24></td>" &_
"<td id=plasticgloss align=center class=thirdnav "&plasticgloss&" onMouseOver=""closegloss."&thirdnavoff&";glassgloss."&thirdnavoff&";metalgloss."&thirdnavoff&";plasticgloss."&thirdnavon&"""><a class=thirdnav href=""plasticgloss.asp?navid=42"">Plastic Containers</a></td>"&_
"</tr></table>"

end select

navon = "style.backgroundColor='#041790'"
navoff = "style.backgroundColor='#ffffff'"

navton = "style.color='#ffffff'"
navtoff = "style.color='#666666'"
%>
<table width="793" height="23" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td id="about" width="80" class="navrghthline" <%=abouton%> onClick="about.<%=navon%>" onMouseOver="about.<%=navton%>; about.<%=navon%>; products.<%=navoff%>; ordering.<%=navoff%>; news.<%=navoff%>; tech.<%=navoff%>; contact.<%=navoff%>; P7_autoLayers('0','submenu11'); Menus.submenu11.show&#

Pizentios Sep 10th, 2004 12:00 PM

looks like itès working to me.

shadowmaster Sep 10th, 2004 12:31 PM

Thank you for responding...

You are right. It does work when you view the link that I gave you:

However, it does not work when a user would use the menu to get to this page. The menu array uses "navid"s to know what menus, submenus, and items to reload when a page is clicked.

If a menu item is clicked on within the navigation array, the following url is placed in the address bar, which is used to reload the appropriate menu path.

http://www.all-pak.com/exemptdg.asp?navid=51

See the difference in the URL's? I don't understand the why the addition of the "navid" string in the url would make a difference in why the DHTML script doesn't work, but it does.

Thanks for your help


All times are GMT -5. The time now is 5:00 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC