var intParentID=0;
var intCurrentID=0;
var intSecondMenuCount=0;

function SetMenuSystem(intNewParentID,intNewCurrentID) {
   intParentID = intNewParentID;
   intCurrentID = intNewCurrentID;
}

function WriteTopMenuCell(strCatName,intCatID,blnIsParent,intStyle) {
   var classname = 'TopMenuNormal' + intStyle;
   var classtext = 'greymenu';
   var strIsParent = 'false';
   if (blnIsParent)
      strIsParent = 'true';
   if ((blnIsParent && (intCatID == intParentID)) || (!blnIsParent && (intCatID == intCurrentID))) {
      classname = 'TopMenuSelected' + intStyle;
      classtext = 'greymenuBold';
      }
   document.write('<TD WIDTH=152 CLASS="' + classname + '" onMouseOver="TopMenuMouseOver(this,' + intCatID + ',true,' + strIsParent + ',' + intStyle + ')" onMouseOut="TopMenuMouseOver(this,' + intCatID + ',false,' + strIsParent + ',' + intStyle + ')">');
   document.write('<P CLASS="Menu"><IMG HEIGHT=8 WIDTH=6 SRC="./point.gif" VSPACE=0 HSPACE=3 ALIGN="MIDDLE" BORDER=0 ALT=""> <A CLASS="LinkHidden" HREF="eStore,wciCatalogue,type-C,ID-' + intCatID + '.html"><span class=' + classtext + '>' + strCatName + '</span></A></P>');
   document.write('</TD>');
}

function TopMenuMouseOver(objThis,intCatID,blnFocus,blnIsParent,intStyle) {
   var classname = 'TopMenuNormal' + intStyle;
   if ((blnIsParent && (intCatID == intParentID)) || (!blnIsParent && (intCatID == intCurrentID))) {
      classname = 'TopMenuSelected' + intStyle;
      }
   if (blnFocus == true) {
      objThis.className = 'TopMenuOver' + intStyle;
      }
   else {
      objThis.className = classname;
      }
}

function WriteMenuCell(strCatName,intCatID,intStyle) {
   var classname = 'SecondMenuEven' + intStyle;
   var classtext = 'sousrayon';
   var strIsOdd = 'false';
   intSecondMenuCount +=1;
   if ((intSecondMenuCount % 2) == 1) {
      strIsOdd = 'true';
      classname = 'SecondMenuOdd' + intStyle;
      }
   if (intCatID == intCurrentID) {
      classname = 'SecondMenuSelected' + intStyle;
      classtext = 'sousrayonBold';
      }
   document.write('<TD CLASS="' + classname + '" onMouseOver="SecondMenuMouseOver(this,' + intCatID + ',true,' + strIsOdd + ',' +  + intStyle + ')" onMouseOut="SecondMenuMouseOver(this,' + intCatID + ',false,' + strIsOdd + ',' + intStyle + ')">');
   document.write('<P CLASS="' + classtext + '"><A CLASS="LinkHidden" HREF="eStore,wciCatalogue,type-C,ID-' + intCatID + '.html"><span class=' + classtext + '>' + strCatName + '</span></A></P>');
   document.write('</TD>');
}

function SecondMenuMouseOver(objThis,intCatID,blnFocus,blnIsOdd,intStyle) {
   var classname = 'SecondMenuEven' + intStyle;
   if (blnIsOdd == true)
      classname = 'SecondMenuOdd' + intStyle;
   if (intCatID == intCurrentID) {
      classname = 'SecondMenuSelected' + intStyle;
      }
   if (blnFocus == true) {
      objThis.className = 'SecondMenuOver' + intStyle;
      }
   else {
      objThis.className = classname;
      }
}

function WriteCustomField(varname,value,url)
   {
      url = url.replace(".asp","");

      if (varname=='AussiDVD' && value!="" && value!="0")
         document.write("<A HREF='" + url + ",wciCatalogue,type-p,id-" + value + ",LoadCat-1.html'>Also available in DVD</A><BR>");
      else if (varname=='AussiVHS' && value!="" && value!="0")
         document.write("<A HREF='" + url + ",wciCatalogue,type-p,id-" + value + ",LoadCat-1.html'>Also available in VHS</A><BR>");
      else if (varname=='AussiFR' && value!="" && value!="0")
         document.write("<A HREF='" + url + ",wciCatalogue,type-p,id-" + value + ",LoadCat-1.html'>Also available in French</A><BR>");
      else if (varname=='AussiEN' && value!="" && value!="0")
         document.write("<A HREF='" + url + ",wciCatalogue,type-p,id-" + value + ",LoadCat-1.html'>Also available in English</A><BR>");
      else if (varname=='VoirLHOP' && value!="" && value!="0")
         document.write("<A HREF='" + url + ",wciCatalogue,type-p,id-" + value + ",LoadCat-1.html'>Also available on the Little House on the Prairie site</A><BR>");
      else if (varname=='VoirBH' && value!="" && value!="0")
         document.write("<A HREF='" + url + ",wciCatalogue,type-p,id-" + value + ",LoadCat-1.html'>Also available in French on the Belles Histoires site</A><BR>");
   }
