function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
  return false;
}

function _popUpPage(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function popUpPage(theURL,winName,features) { //Quirksmode.org
  newwindow=window.open(theURL,winName,features);
  if(window.focus){newwindow.focus()}
  return false;
}



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function isOrder(passedVal){
        if(passedVal ==""){
          return false
        }
        return true
}

function isSelected(passedVal){
        if(passedVal ==""){//"choose one" has no val associated with it!
              return false
        }
        return true
}

function isEmpty(passedVal){
   //if(passedVal =="0"){//"choose one" has no val associated with it. Well maybe it has!!!
           if (!isNum(passedVal)){
              return false
        }
        return true
}


function isNum(passedVal){
        if(passedVal== ""){
          return false
        }
        for (i=0; i<passedVal.length; i++){
          if (passedVal.charAt(i) < "0") {
                return false
          }
          if (passedVal.charAt(i) > "9") {
                return false
          }
        }
        return true
}

function isDay(passedVal){
    if (!isNum(passedVal)){
                alert("You must choose a day ")
                orderForm.day.focus()
                orderForm.day.focus()
                return false
        }
    return true
}

function isMonth(passedVal){
    if (!isNum(passedVal)){
                alert("You must choose a month ")
                orderForm.month.focus()
                orderForm.month.focus()
        return false
        }
    return true
}

function isYear(passedVal){
    if (!isNum(passedVal)){
                alert("You must choose a Year ")
                orderForm.year.focus()
                orderForm.year.focus()
                return false
        }
    return true
}




function validEmail(email){
        invalidChars = "/:,;"

        if (email ==""){
          return false
        }
        for (i=0;i<invalidChars.length; i++){
         badChar = invalidChars.charAt(i)
         if (email.indexOf(badChar,0) > -1){
                return false
         }
        }
        atPos = email.indexOf("@",1)
        if (atPos == -1){
                return false
        }
        if (email.indexOf("@",atPos+1) != -1){
                return false
        }

        periodPos = email.indexOf(".", atPos)
        if (periodPos == -1){
                return false
        }
        if(periodPos+3 > email.length){
                return false
        }
        return true
}

function old_submitSpares(orderForm){
    if (!isNum(orderForm.qty.value)){
                alert("You must supply a quantity ")
                orderForm.qty.focus()
                orderForm.qty.focus()
                return false
        }
}


function oldSubmitOrder1(orderForm){
        if (!validEmail(orderForm.contactEmail.value)){
                alert("Invalid email adress")
                orderForm.contactEmail.focus()
                orderForm.contactEmail.focus()
                return false
        }
}

function old_submitCommercial(orderForm){
        if (!isOrder(orderForm.orderNo.value)){
                alert("You must supply an order number or reference")
                orderForm.orderNo.focus()
                orderForm.orderNo.focus()
                return false
        }
    if(!isDay(orderForm.day.value))return false
    if(!isMonth(orderForm.month.value))return false
    if(!isYear(orderForm.year.value))return false
    return true
}

function submitCommercial(orderForm){
        //I found that mozila didnt stop on false unless structured like this!
        if (!isOrder(orderForm.orderNo.value)){
                alert("You must supply an order number or reference")
                orderForm.orderNo.focus()
                orderForm.orderNo.focus()
                return false
        }
    if (!isNum(orderForm.day.value)){
                alert("You must choose a day ")
                orderForm.day.focus()
                orderForm.day.focus()
                return false
        }
    if (!isNum(orderForm.month.value)){
                alert("You must choose a month ")
                orderForm.month.focus()
                orderForm.month.focus()
                return false
        }
    if (!isNum(orderForm.year.value)){
                alert("You must choose a year ")
                orderForm.year.focus()
                orderForm.year.focus()
                return false
        }
    return true
}

function submitAddress(orderForm){
//        if(document.layers)           //NN4+
//    {
//       document.layers[szDivID].visibility = iState ? "show" : "hide";
//    }
//    else if(document.getElementById)          //gecko(NN6) + IE 5+
//    {
//        var obj = document.getElementById(szDivID);
//        if(obj.style.display =="block")iState = 1;
//    }
//    else if(document.all)        // IE 4
//    {
//        document.all[szDivID].style.display = iState ? "none" : "block";
//    }



      thisMenu = eval("document.all.hidden_layer2a.style")
      if(thisMenu.display =="block"){
         //if(orderForm.delAddress.display){//I currently only test the pulldown otherwise if its hidden this would fail
         if (!isEmpty(orderForm.delAddress.value)){
           alert("You must select a delivery address")
           orderForm.delAddress.focus()
           orderForm.delAddress.focus()
           return false
         }
         alert(orderForm.delAddress.value)
      }

      //if(orderForm.delAddress.visible){
      if(orderForm.delAddress.display){//I currently only test the pulldown otherwise if its hidden this would fail

         if (!isEmpty(orderForm.delAddress.value)){
         //if (orderForm.delAddress.value == "choose one"){
           alert("You must select a delivery address")
           orderForm.delAddress.focus()
           orderForm.delAddress.focus()
           return false
         }
         alert("boo..." + orderForm.delAddress.value)
      }

      if(orderForm.invAddress) {//I can turn this elemnt off in php!
         if(orderForm.invAddress.visible){
          alert("hello inv address")
            if (!isEmpty(orderForm.invAddress.value)){
              alert("You must select an invoice address")
              orderForm.invAddress.focus()
              orderForm.invAddress.focus()
              return false
            }
            alert(orderForm.delAddress.value)
         }
      }
}

function submitDelivery(orderForm){
}



function submitSpec(orderForm){
        if (!isNum(orderForm.numberOfCRU.value)){
                alert("You must supply a number for the number of CRUs")
                orderForm.numberOfCRU.focus()
                orderForm.numberOfCRU.focus()
                return false
        }
}

function newWindow(techDoc){
        bookWindow = window.open(techDoc, 'bookWin', 'width=300,height=300, scrollbars=yes, toolbars=yes resizable=yes')
        bookWindow.focus()
}

function old_toggleMenu(currMenu){
        if(document.all){
            thisMenu = eval("document.all." + currMenu + ".style")
        thatMenu = eval("document.all." + currMenu + "a.style")
        if(thisMenu.display =="block"){
                thisMenu.display = "none"
            thatMenu.display = "block"
        }
        else{
                thisMenu.display = "block"
            thatMenu.display = "none"
        }
        return false
    }
    else{
            return true
    }
}





function _toggleMenu(szDivID) // 1 visible, 0 hidden
{
  //changed to this type of script so it works with othe browsers.
  //use display rather than visibility as IE doesnt shrink the space with visibility
  //based on script by from  Manish Hatwalne  http://www.geocities.com/technofundo/tech/js/showhide.html
  //added the toggle states 150304 so this works with mozila and opera

 //found this doesnt work for ie5.5. 210504

    if(document.layers)           //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
       //document.layers[szDivID+"a"].visibility != iState ? "show" : "hide";
    }
    else if(document.getElementById)          //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        if(obj.style.display =="block")iState = 1;
        else iState = 0;
        //obj.style.visibility = iState ? "visible" : "hidden";
        obj.style.display = iState ? "none" : "block";
        var obj = document.getElementById(szDivID+"a");
        obj.style.display = iState ?  "block" : "none" ;

    }
    else if(document.all)        // IE 4
    {
        //document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
        //document.all[szDivID+"a"].style.visibility = iState ? "visible" : "hidden";

        document.all[szDivID].style.display = iState ? "none" : "block";
        document.all[szDivID+"a"].style.display = iState ?  "block" : "none" ;
    }

}

function toggleMenu(szDivID) // 1 visible, 0 hidden
{
  //changed to this type of script so it works with othe browsers.
  //use display rather than visibility as IE doesnt shrink the space with visibility
  //based on script by from  Manish Hatwalne  http://www.geocities.com/technofundo/tech/js/showhide.html
  //added the toggle states 150304 so this works with mozila and opera

 //found this doesnt work for ie5.5. 210504. This was due to not having the return statements in
 //which caused the page to reload

    if(document.layers)           //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
       document.layers[szDivID+"a"].visibility != iState ? "show" : "hide";
       return false
    }
    else if(document.getElementById)          //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        //if(obj.style.display =="block")iState = 1;
        //else iState = 0;
        iState = 0;
        obj.style.display = iState ? "none" : "block";
        var obj = document.getElementById(szDivID+"a");
        obj.style.display = iState ?  "block" : "none" ;

       return false
    }
    else if(document.all)        // IE 4
    {
        document.all[szDivID].style.display = "block" ? "none" : "block";
        document.all[szDivID+"a"].style.display = "block" ?  "block" : "none" ;
        return false
    }
    else
    return true
}

function expandingMenu(szDivID) // 1 visible, 0 hidden
{
  //changed to this type of script so it works with othe browsers.
  //use display rather than visibility as IE doesnt shrink the space with visibility
  //based on script by from  Manish Hatwalne  http://www.geocities.com/technofundo/tech/js/showhide.html
  //added the toggle states 150304 so this works with mozila and opera

 //found this doesnt work for ie5.5. 210504. This was due to not having the return statements in
 //which caused the page to reload
 //created a new version 180205 as I dont need to toggle second layer.

    if(document.layers)           //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
       return false
    }
    else if(document.getElementById)          //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        if(obj.style.display =="block")iState = 1;
        else iState = 0;
        obj.style.display = iState ? "none" : "block";
       return false
    }
    else if(document.all)        // IE 4
    {
        document.all[szDivID].style.display = "block" ? "none" : "block";
        return false
    }
    else
    return true
}


function popup(z){
        alert(z)
}



function mailpage()
{
s = new String(document.title)
myTitle = s.replace("&", "and")
mail_str = "mailto:?subject=Useful link - " + myTitle;
mail_str += "&body=I thought you might be interested in this link. '" + myTitle;
mail_str += "'. You can view it at, " + location.href + "\n\n";
location.href = mail_str;
}



<!-- Expanding Menu Script Starts Here -->
<!-- Place in HEAD section of Page -->

function clickHandler(e) {
  var targetId, mysrcElement, targetElement;
  srcElement = Eve(e)

//alert("hello" + srcElement.className);

  if (srcElement.className == "Outline") {
  //I need to split the id at the : and then prefix ul:
  //This is a bit hard wired but becasue the ID is created dynamically this is the simplest so far...
    var b = srcElement.id;
    var temp = new Array();
    temp = b.split(':');
//targetId = temp[1]*1 + 0.1;
//targetId = temp[0]+":" + Math.round (targetId*100)/100;
////targetId = "ul:" + Math.round (targetId*100)/100;
//targetId = targetId +'0';

    targetId = temp[0];
    targetId = targetId +':_open';

     //targetId = srcElement.id + "d";
     if(document.all)targetElement = document.all(targetId);
     if(document.getElementById)targetElement = document.getElementById(targetId);
     if (targetElement.style.display == "none") {
        targetElement.style.display = "";
        srcElement.src = "/images/arrow_d_l_green.gif";
     } else {
        targetElement.style.display = "none";
        srcElement.src = "/images/arrow_r_l_green.gif";
     }
  }

  if (srcElement.className == "menu-link-popup"){
    //this opens a popup window based on the class name
    //future improvements could be to just test for "popup" and pass in fetures list
    //but KIS for now.
    theURL = srcElement.href;
    winName = "popup";
    features = "status=no,scrollbars=yes,toolbar=yes,resizable=yes,menubar=yes";
//alert(theURL);
    popUpPage(theURL,winName,features);
    return false;
  }
}



function hoverHandler(e) {
  var targetId, mysrcElement, targetElement, fileName;
  srcElement = Eve(e);

  if (srcElement.className == "doc-link-rollover") {
   // fileName =  srcElement.href;
    fileName =  srcElement.name;//need this when I need an image file rollover instead of the filename
    fileName = "/public_library/"+fileName;
//alert(fileName);
    var temp = new Array();
    var b = srcElement.id;
    //temp = b.split(':');
    //targetId = temp[0];
    //changed to this for latest cms engine!
    temp = b.split('-');
    targetId = temp[0]+"-"+temp[1]+"-00-img-img";
    targetId = temp[0]+"-"+temp[1]+"-img-img";
    if(document.all)targetElement = document.all(targetId);
    if(document.getElementById)targetElement = document.getElementById(targetId);
    targetElement.src = fileName;
   }
}



function Eve(e){
    var targ;
	if (!e) var e = window.event;
	if (e.target) targ = e.target;
	else if (e.srcElement) targ = e.srcElement;
	if (targ.nodeType == 3) // defeat Safari bug
		targ = targ.parentNode;
    return (targ);
}




document.onclick = clickHandler;
document.onmouseover = hoverHandler;








