/*
  $Id: general.js,v 1.3 2005/02/25 18:09:43 starky Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

function SetFocus(TargetFormName) {
  var target = 0;
  if (TargetFormName != "") {
    for (i=0; i<document.forms.length; i++) {
      if (document.forms[i].name == TargetFormName) {
        target = i;
        break;
      }
    }
  }

  var TargetForm = document.forms[target];
    
  for (i=0; i<TargetForm.length; i++) {
    if ( (TargetForm.elements[i].type != "image") && (TargetForm.elements[i].type != "hidden") && (TargetForm.elements[i].type != "reset") && (TargetForm.elements[i].type != "submit") ) {
      TargetForm.elements[i].focus();

      if ( (TargetForm.elements[i].type == "text") || (TargetForm.elements[i].type == "password") ) {
        TargetForm.elements[i].select();
      }

      break;
    }
  }
}

function RemoveFormatString(TargetElement, FormatString) {
  if (TargetElement.value == FormatString) {
    TargetElement.value = "";
  }

  TargetElement.select();
}

function CheckDateRange(from, to) {
  if (Date.parse(from.value) <= Date.parse(to.value)) {
    return true;
  } else {
    return false;
  }
}

function IsValidDate(DateToCheck, FormatString) {
  var strDateToCheck;
  var strDateToCheckArray;
  var strFormatArray;
  var strFormatString;
  var strDay;
  var strMonth;
  var strYear;
  var intday;
  var intMonth;
  var intYear;
  var intDateSeparatorIdx = -1;
  var intFormatSeparatorIdx = -1;
  var strSeparatorArray = new Array("-"," ","/",".");
  var strMonthArray = new Array("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec");
  var intDaysArray = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

  strDateToCheck = DateToCheck.toLowerCase();
  strFormatString = FormatString.toLowerCase();
  
  if (strDateToCheck.length != strFormatString.length) {
    return false;
  }

  for (i=0; i<strSeparatorArray.length; i++) {
    if (strFormatString.indexOf(strSeparatorArray[i]) != -1) {
      intFormatSeparatorIdx = i;
      break;
    }
  }

  for (i=0; i<strSeparatorArray.length; i++) {
    if (strDateToCheck.indexOf(strSeparatorArray[i]) != -1) {
      intDateSeparatorIdx = i;
      break;
    }
  }

  if (intDateSeparatorIdx != intFormatSeparatorIdx) {
    return false;
  }

  if (intDateSeparatorIdx != -1) {
    strFormatArray = strFormatString.split(strSeparatorArray[intFormatSeparatorIdx]);
    if (strFormatArray.length != 3) {
      return false;
    }

    strDateToCheckArray = strDateToCheck.split(strSeparatorArray[intDateSeparatorIdx]);
    if (strDateToCheckArray.length != 3) {
      return false;
    }

    for (i=0; i<strFormatArray.length; i++) {
      if (strFormatArray[i] == 'mm' || strFormatArray[i] == 'mmm') {
        strMonth = strDateToCheckArray[i];
      }

      if (strFormatArray[i] == 'dd') {
        strDay = strDateToCheckArray[i];
      }

      if (strFormatArray[i] == 'yyyy') {
        strYear = strDateToCheckArray[i];
      }
    }
  } else {
    if (FormatString.length > 7) {
      if (strFormatString.indexOf('mmm') == -1) {
        strMonth = strDateToCheck.substring(strFormatString.indexOf('mm'), 2);
      } else {
        strMonth = strDateToCheck.substring(strFormatString.indexOf('mmm'), 3);
      }

      strDay = strDateToCheck.substring(strFormatString.indexOf('dd'), 2);
      strYear = strDateToCheck.substring(strFormatString.indexOf('yyyy'), 2);
    } else {
      return false;
    }
  }

  if (strYear.length != 4) {
    return false;
  }

  intday = parseInt(strDay, 10);
  if (isNaN(intday)) {
    return false;
  }
  if (intday < 1) {
    return false;
  }

  intMonth = parseInt(strMonth, 10);
  if (isNaN(intMonth)) {
    for (i=0; i<strMonthArray.length; i++) {
      if (strMonth == strMonthArray[i]) {
        intMonth = i+1;
        break;
      }
    }
    if (isNaN(intMonth)) {
      return false;
    }
  }
  if (intMonth > 12 || intMonth < 1) {
    return false;
  }

  intYear = parseInt(strYear, 10);
  if (isNaN(intYear)) {
    return false;
  }
  if (IsLeapYear(intYear) == true) {
    intDaysArray[1] = 29;
  }

  if (intday > intDaysArray[intMonth - 1]) {
    return false;
  }
  
  return true;
}

function IsLeapYear(intYear) {
  if (intYear % 100 == 0) {
    if (intYear % 400 == 0) {
      return true;
    }
  } else {
    if ((intYear % 4) == 0) {
      return true;
    }
  }

  return false;
}

// PopOutTextMenu: v1.2
 
var ie,ns6,ns,opera,ismac; 
var menuid,d6,c2ref; 
var c1,c2,c3; 
var globalsdefined=false; 
var debugstr=""; 
var debug=false; 


function addtodebug(str){ 

debugstr += str+'\n'; 

}; 


function showdebug(){ 

alert(debugstr+'\n'); 
debugstr=""; 

}; 



function d3(ginfref,top,c4,sub,c9){ 

this.d4=ginfref; 
this.d5=top; 
this.c4=c4; 
this.submenu=0; 
this.sub=sub; 
this.c9=c9; 
this.d1=0; 
this.d2=0; 
this.b1=0; 
this.a8=0; 
this.a9=0; 

}; 



function a0(){ 

this.b2=0; 
this.b3=0; 
this.b4=0; 
this.b5=0; 
this.b8=0; 
this.b9=0; 
this.b7=0; 
this.b6=0; 

}; 



function defineglobals(){ 

if(globalsdefined==true) return; 

ie=(document.all != (void 0)); 
ns6=(document.getElementById&&!document.all); 
ns=(document.layers != (void 0)); 
ismac=(navigator.appVersion.indexOf("Mac") != -1); 
opera=false; 

if(ie){ 

var agent=navigator.userAgent.toLowerCase(); 
opera=(agent.indexOf("opera") != -1); 

}; 


c1=new Array(); 
c3=new Array(); 
c2 = new Array(); 
menuid=1; 
d6=1; 
c2ref=1; 

}; 





function showrootmenu(c8){ 

if(ie){ 

mnn=eval('vrsub'+c8); 
mnn.style.visibility="visible"; 
} 

else if(ns6){ 

mnn=document.getElementById('vrsub'+c8); 
mnn.style.visibility="visible"; 
} 

else if(ns){

 mnn=eval('document.layers.vrsub'+c8); 
mnn.visibility="show"; 
}; 
}; 




function c6(c8, whichmenu){ 

c8=c3[c8].sub; 

while(c8 != 0){ 

if(c3[c8].c4 == whichmenu) return true; 

c8=c3[c8].sub; 

}; 

return false; 

}; 




function c7(c8, whichitem){ 

while(whichitem != 0){ 

if(whichitem == c8) return true; 
whichitem=c3[whichitem].d5; 
}; 

return false; 

}; 




function c5(c8){ 

var loindex=65535, hiindex=0, tm = new Array(), thetop, ii; 

for(ii=c2[c3[c8].d4].b8;ii <= c2[c3[c8].d4].b9;ii++){ 

if(c3[ii].c4 < loindex) loindex=c3[ii].c4; 
if(c3[ii].c4 > hiindex) hiindex=c3[ii].c4; 
if(c3[ii].d5 == 0) thetop = ii; 
if(c7(ii, c2[c3[c8].d4].b5)){ 
tm[c3[ii].c4]=true; 
} 

else if(c2[c3[c8].d4].b4 != 0 && c3[ii].c4 == c3[c2[c3[c8].d4].b5].submenu) tm[c3[ii].c4]=true;

 }; 

tm[c2[c3[c8].d4].b4]=true; 

for(ii=loindex;ii <= hiindex;ii++){ 

if(tm[ii]==true){ 

mnn=eval('document.layers.vrsub'+ii); 

if(mnn.visibility != "show") mnn.visibility="show"; 

} 

else{ 

if(ii != c3[thetop].c4){

 mnn=eval('document.layers.vrsub'+ii); 

if(mnn.visibility != "hide") mnn.visibility="hide"; 
};

 }; 

}; 

}; 






function a6(c8){ 

c2[c3[c8].d4].b4=c3[c8].c4; 

if(ns){ c5(c8); } 

else{ 

while(c3[c8].d5 != 0){ 

if(ie){ mnn=eval('vrsub'+c3[c8].c4); mnn.style.visibility="visible"; } 

else if(ns6){ 

mnn=document.getElementById('vrsub'+c3[c8].c4); if(mnn.style.visibility!="visible") mnn.style.visibility="visible"; 

} 

c8=c3[c8].d5; 

} 

}; 

};





function a5(c8){ 

while(c3[c8].d5 != 0){ 

if(c3[c8].c4 != c2[c3[c8].d4].b4){ 

if(ie){ 

mnn=eval('vrsub'+c3[c8].c4); 
mnn.style.visibility="hidden"; 

} 

else if(ns6){ 

mnn=document.getElementById('vrsub'+c3[c8].c4); 

if(mnn.style.visibility!="hidden") mnn.style.visibility="hidden";

 } 

else if(ns){ 

mnn=eval('document.layers.vrsub'+c3[c8].c4); 
mnn.visibility="hide";

} 

} 

else break; 

c8=c3[c8].d5; 

}; 

}; 





function a4(c8){ 
 var tmi=c8; 
 c2[c3[c8].d4].b5=c8; 
 if(c3[c8].sub != 0){ 
  if(ie){ 
   var mnp=eval('vrsub'+c3[c8].c4); 
   var offsetleft=0, offsettop=0; 
   if(ismac){ 
    offsettop=mnp.style.pixelTop; 
    offsetleft=mnp.style.pixelLeft; 
   } 
   else{ 
    do{ 
     offsetleft += mnp.offsetLeft; 
     offsettop += mnp.offsetTop; 
     mnp=mnp.offsetParent; 
    }while (mnp != null); 
 } 
 mnn=eval('vrsub'+c3[c3[c8].sub].c4);    // +8 - Starky
 mnn.style.pixelTop=offsettop+(c3[c8].c9*(8+c3[c8].d1))+c2[c3[c8].d4].b3; 
 mnn.style.pixelLeft=offsetleft+c3[c8].d2+c3[c8].a9-c2[c3[c8].d4].b2; 
 mnn.style.visibility="visible"; 
} 

else if(ns){ 

mnn=eval('document.layers.vrsub'+c3[c3[c8].sub].c4); 
mnp=eval('document.layers.vrsub'+c3[c8].c4); 
mnn.top=mnp.pageY+(c3[c8].c9*c3[c8].d1)+c2[c3[c8].d4].b3; 
mnn.left=mnp.pageX + mnp.clip.right-c2[c3[c8].d4].b2-c3[c8].a8; 
mnn.visibility="show"; 

for(ii=c2[c3[c8].d4].b8;ii <= c2[c3[c8].d4].b9;ii++){ 

if(c3[ii].sub!=0&&c3[c8].c4==c3[ii].c4&&ii!=c8){ 

mnn=eval('document.layers.vrsub'+c3[c3[ii].sub].c4); 
mnn.visibility="hide"; 

} 

} 

} 

else if(ns6){ 

mnn=document.getElementById('vrsub'+c3[c3[c8].sub].c4); 
mnp=document.getElementById('vrsub'+c3[c8].c4); 
mnn.style.top=mnp.offsetTop+(c3[c8].c9*c3[c8].d1)+c2[c3[c8].d4].b3; 
mnn.style.left=mnp.offsetLeft+c3[c8].d2+c3[c8].a9-c2[c3[c8].d4].b2; 
mnn.style.visibility="visible"; 

} 

}; 

}; 





function a7(c8){ 

if(c3[c8].sub != 0){ 

if(ie){ 

mnn=eval('vrsub'+c3[c3[c8].sub].c4); 
mnn.style.visibility="hidden"; 

} 

else if(ns){ 

mnn=eval('document.layers.vrsub'+c3[c3[c8].sub].c4); 
mnn.visibility="hide"; 

} 

else if(ns6){ 

mnn=document.getElementById('vrsub'+c3[c3[c8].sub].c4); 
mnn.style.visibility="hidden"; 
c2[c3[c8].d4].b5=0; 

}; 

}; 

}; 






function POTMenu(){ 

POTMenu.prototype.addMenu=function(mid,mtext,mlink){ 
 if(c1[mid]) alert('Menu id '+mid+' is already defined.'); 
 if(c0==true) alert('You have to define all the main menus before defining the sub menus'); 
 d6++; 
 c3[d6]=new d3(this.f3,0,menuid,0,this.nomenus); 
 c3[d6].d1=this.mainmenuh+this.mainspacery;
 c3[d6].d2=this.g3; 
 c3[d6].b1=this.imgheight; 
 c3[d6].a8=this.f9; 
 c3[d6].a9=this.f8; 
 c1[mid]=d6; 
 this.nomenus++; 

 if(d6>this.firstmenuitem&&this.mainspacery>0){ 
  this.menutext += '<tr><td width="'+this.g3+'" height="'+this.mainspacery+'">'; 
  this.menutext += '<img border="0" src="'+this.mainspacer+'" width="'+this.g3+'" height="'+this.mainspacery+'">'; 
  this.menutext += '</td></tr>'; 
 }; 

 if(ie){ 
  this.menutext += '<tr><td width="'+this.g3+'" height="'+this.mainmenuh+'" bgcolor="'+this.maincbgcolor+'">'; 
  this.menutext += '<div  id="imx'+d6+'" onMouseover="a4('+d6+')" onMouseout="a7('+d6+')" STYLE="position:relative; width:'+this.g3+'; z-index: 6">'; 
  this.menutext += '<img align="absmiddle" border="0" src="'+this.mainpreim+'" width="'+this.mainpreimx+'" height="'+this.mainpreimy+'">'; 
  if(mlink != "") this.menutext += '<a  href="'+mlink+'">'; 
  this.menutext += mtext; 
  if(mlink != "") this.menutext += '</a>'; 
  this.menutext += '</div></td></tr>'; 
 } 
 else if(ns){ 
  this.menutext += '<tr><td valign="center"  width="'+this.g3+'" height="'+this.mainmenuh+'" bgcolor="'+this.maincbgcolor+'">'; 
  this.menutext += '<ilayer visibility="show"><layer width="'+this.g3+'" height="'+this.mainmenuh+'" onmouseover="a4('+d6+');" onMouseout="c2[c3['+d6+'].d4].b6=setTimeout(\'a7('+d6+')\',100);">'; 
  if(this.nnmainheight > 0) this.menutext += '<img align="textbottom" border="0" src="'+this.mainpreim+'" width="'+this.g3+'" height="'+this.nnmainheight+'"><br>'; 
  this.menutext += '&nbsp;'; 
  if(mlink != "") this.menutext += '<a  href="'+mlink+'">'; 
  this.menutext += mtext; if(mlink != "") this.menutext += '</a>'; 
  this.menutext += '</layer></ilayer></td></tr>'; 
 } 
 else if(ns6){ 
  this.menutext += '<tr><td valign="top" width="'+this.g3+'" height="'+this.mainmenuh+'" bgcolor="'+this.maincbgcolor+'">'; 
  this.menutext += '<div  id="noimx'+d6+'" onMouseover="a4('+d6+')" onMouseout="a7('+d6+')" STYLE="position:relative; visibility: visible">'; 
  this.menutext += '<img name="imx'+d6+'" align="absmiddle" border="0" src="'+this.mainpreim+'" width="'+this.mainpreimx+'" height="'+this.mainpreimy+'">'; 
  if(mlink != "") this.menutext += '<a  href="'+mlink+'">'; 
  this.menutext += mtext; 
  if(mlink != "") this.menutext += '</a>'; 
  this.menutext += '</div></td></tr>'; 
 }; 
}; 

POTMenu.prototype.addSubMenu=function(mid, submid, mtext, murl){ 

 if(!c1[mid]) alert('No menu named '+mid+' has been defined.'); 

 d6++; 

 if(this.g4 != mid){ 
  if(this.g4!=null){ 
   var d1=((this.nomenus-1)*this.subspacery)+this.nomenus*this.subcheight; 

   this.d7 += '</table></td><td><img src="'+this.f1+'" border="0" width="'+this.f1width+'" height="'+d1+'"></td></tr>'; 
   this.d7 += '<tr><td colspan="3"><img src="'+this.h2+'" border="0" width="'+this.a2+'" height="'+this.g2+'">'; 
   this.d7 += '<img src="'+this.h5+'" border="0" width="'+(this.subcwidth-this.subba)+'" height="'+this.g2+'">'; 
   this.d7 += '<img src="'+this.h1+'" border="0" width="'+this.a1+'" height="'+this.g2+'"></td></tr></table>'; 

   if(ns) this.d7 += '</layer>'; 

   else this.d7 += '</div>'; 

   this.d7=this.d7.replace("imgplaceholder", d1-this.d9); 
  this.nomenus=0; 
  } 

  menuid++; 

  this.g4=mid; 

  if(ie) this.d7 += '<div  id="vrsub'+menuid+'" onMouseover="a6('+d6+')" onMouseout="c2[c3['+d6+'].d4].b4=0;a5('+d6+')" style="position:absolute; z-index:2; visibility: hidden;">'; 
  else if(ns6) this.d7 += '<div  id="vrsub'+menuid+'" onMouseover="a6('+d6+')" onMouseout="c2[c3['+d6+'].d4].b4=0;a5('+d6+')" style="position:absolute; z-index:2; top:-400;left:-400;visibility: hidden;">'; 
  else if(ns) this.d7 += '<layer id="vrsub'+menuid+'" onMouseover="clearTimeout(c2[c3['+d6+'].d4].b6);clearTimeout(c2[c3['+d6+'].d4].b7);a6('+d6+')" onMouseout="c2[c3['+d6+'].d4].b4=0;c2[c3['+d6+'].d4].b7=setTimeout(\'a5('+d6+')\',100)" visibility="hide">'; 

  this.d7 += '<table border="0" cellspacing="0" cellpadding="0"><tr><td colspan="3">'; 
  this.d7 += '<img src="'+this.h4+'" border="0" width="'+this.a2+'" height="'+this.g2+'">'; 
  this.d7 += '<img src="'+this.h6+'" border="0" width="'+(this.subcwidth-this.subba)+'" height="'+this.g2+'">'; 
  this.d7 += '<img src="'+this.h3+'" border="0" width="'+this.a1+'" height="'+this.g2+'"></td></tr><tr><td>'; 

  if(this.d9 !=0) this.d7 += '<img src="'+this.f2+'" border="0" width="'+this.h8+'" height="'+this.d9+'"><br>'; 
  this.d7 += '<img src="'+this.h9+'" border="0" width="'+this.h8+'" height="imgplaceholder"></td><td><table border="0" cellspacing="0" cellpadding="0">'; 
 } 
 else{ 
  if(this.subspacery>0){ 
   this.d7 += '<tr><td width="'+this.subcwidth+'" height="'+this.subspacery+'">'; 
   this.d7 += '<img border="0" src="'+this.subspacer+'" width="'+this.subcwidth+'" height="'+this.subspacery+'">'; 
   this.d7 += '</td></tr>'; 
 } 
} 
//
 this.d7 += '<tr><td  valign="center" width="'+this.subcwidth+'" height="'+this.subcheight+'" bgcolor="'+this.subcbgcolor+'">'; 

 if(ie){ 
  this.d7 += '<div  id="imx'+d6+'" onMouseover="a4('+d6+')" onMouseout="a7('+d6+')" STYLE="position:relative; width:'+this.subcwidth+'; z-index: 6">'; 
  this.d7 += '<img align="absmiddle" border="0" src="'+this.subpreim+'" width="'+this.subpreimx+'" height="'+this.subpreimy+'">'; 
  if(murl != "") this.d7 += '<a  href="'+murl+'">'; 
  this.d7 += mtext; 
  if(murl != "") this.d7 += '</a>'; this.d7 += '</div>'; 
 } 
 else if(ns6){ 
  this.d7 += '<div id="noimx'+d6+'" onMouseover="a4('+d6+')" onMouseout="a7('+d6+')" STYLE="position:relative; width:'+this.subcwidth+';">'; 
  this.d7 += '<img align="absmiddle" border="0" src="'+this.subpreim+'" width="'+this.subpreimx+'" height="'+this.subpreimy+'">'; 
  if(murl != "") this.d7 += '<a  href="'+murl+'">'; 
  this.d7 += mtext; if(murl != "") this.d7 += '</a>'; 
  this.d7 += '</div>'; 
 } 
 else{ 
  this.d7 += '<ilayer id="imx'+d6+'"><layer width="'+this.subcwidth+'" height="'+this.subcheight+'" onMouseover="a4('+d6+')" onMouseout="c2[c3['+d6+'].d4].b6=setTimeout(\'a7('+d6+')\',100)">'; 
  if(this.nnsubheight > 0) this.d7 += '<img align="textbottom" border="0" src="'+this.mainpreim+'" width="'+this.g3+'" height="'+this.nnsubheight+'"><br>'; 
  this.d7 += '&nbsp;'; if(murl != "") this.d7 += '<a  href="'+murl+'">'+mtext+'</a>'; else this.d7 += mtext;this.d7 += '</layer></ilayer>'; }; 
  this.d7 += '</td></tr>'; 
  if(submid!="") c1[submid]=d6; 
  c3[d6]=new d3(this.f3,c1[mid],menuid,0,this.nomenus); 
  c3[c1[mid]].sub=d6; 
  c3[c1[mid]].submenu=menuid; 
  c3[d6].d1=this.subcheight+this.subspacery; 
  c3[d6].d2=this.subcwidth; 
  c3[d6].b1=this.g2; 
  c3[d6].a8=this.f1width; 
  c3[d6].a9=this.h8; this.nomenus++; 
 }; 

POTMenu.prototype.startMenu=function(){ 
 defineglobals(); 
 c2[c2ref]=new a0(); 
 this.f3=c2ref; 
 c2ref++; menuid++; 
 c2[this.f3].b2=this.b2; 
 c2[this.f3].b3=this.b3; 

 this.rootmenu=menuid; 
 this.firstmenuitem=d6+1; 

 c2[this.f3].b8=this.firstmenuitem; 

 if(opera) this.menutext += '<div id="vrsub'+menuid+'" STYLE="position:relative;">'; 
 else if(ie){ 
  if(ismac) this.menutext += '<div id="theroot" STYLE="position:absolute; visibility: hidden;">'; 
   this.menutext += '<div id="vrsub'+menuid+'" STYLE="position:absolute; visibility: hidden;">'; 
  } 
 else if(ns6){ 
  this.menutext += '<div id="vrsub'+menuid+'" STYLE="position:absolute; visibility: hidden;">'; 
 } 
 else if(ns){ 
  this.menutext += '<ilayer id="vrsub'+menuid+'" visibility="show"><layer>'; 
 }; 

 this.menutext += '<table class=catalog_menu border="0" cellspacing="0" cellpadding="0">'; //<tr><td colspan="3">'; 
/* this.menutext += '<img src="'+this.f7+'" border="0" width="'+this.imgcornerleft+'" height="'+this.imgheight+'">'; 
 this.menutext += '<img src="'+this.imgtop+'" border="0" width="'+(this.g3-this.mainba)+'" height="'+this.imgheight+'">'; 
 this.menutext += '<img src="'+this.f6+'" border="0" width="'+this.imgcornerright+'" height="'+this.imgheight+'"></td></tr><tr><td>'; 
 this.menutext += '<img src="'+this.imgleft+'" border="0" width="'+this.f8+'" height="imgplaceholder">'; 
 this.menutext += '</td><td><table  border="0" cellspacing="0" cellpadding="0">'; */
}; 

POTMenu.prototype.showMainMenu=function(){ 
 var d1=((this.nomenus-1)*this.mainspacery)+this.nomenus*this.mainmenuh; 
 this.menutext += '</table>'; //</td><td><img src="'+this.imgright+'" border="0" width="'+this.f9+'" height="'+d1+'"></td></tr>'; 
/* this.menutext += '<tr><td colspan="3"><img src="'+this.f5+'" border="0" width="'+this.imgcornerleft+'" height="'+this.imgheight+'">'; 
 this.menutext += '<img src="'+this.imgbottom+'" border="0" width="'+(this.g3-this.mainba)+'" height="'+this.imgheight+'">'; 
 this.menutext += '<img src="'+this.f4+'" border="0" width="'+this.imgcornerright+'" height="'+this.imgheight+'"></td></tr></table>'; 
*/
 if(ie||ns6) this.menutext += '</div>'; 
 else if(ns) this.menutext += '</layer></ilayer>'; 
 document.write(this.menutext.replace("imgplaceholder", d1)); this.nomenus=0; 
}; 

POTMenu.prototype.showMenu=function(){ 
 var d1=((this.nomenus-1)*this.subspacery)+this.nomenus*this.subcheight; 

 this.d7 += '</table></td><td><img src="'+this.f1+'" border="0" width="'+this.f1width+'" height="'+d1+'"></td></tr>'; 
 this.d7 += '<tr><td colspan="3"><img src="'+this.h2+'" border="0" width="'+this.a2+'" height="'+this.g2+'"><img src="'+this.h5+'" border="0" width="'+(this.subcwidth-this.subba)+'" height="'+this.g2+'"><img src="'+this.h1+'" border="0" width="'+this.a1+'" height="'+this.g2+'"></td></tr></table>'; 

 if(ie){ 
  this.d7 += '</div>'; 
  if(ismac) this.d7 += '</div>'; 
 } 
 else if(ns6){ 
  this.d7 += '</div>'; 
 } 
 else if(ns) this.d7 += '</layer>'; 

 document.write(this.d7.replace("imgplaceholder", d1-this.d9)); 

 c2[this.f3].b9=d6; 

 c1=new Array(); showrootmenu(this.rootmenu); 
}; 

POTMenu.prototype.mainmenuitemsize=function(width,height){ 
 this.g3=width; 
 this.mainmenuh=height; 
 this.mainpreimy=height-3; 
}; 

POTMenu.prototype.submenuitemsize=function(width,height){ 

this.subcwidth=width; 
this.subcheight=height; 
this.subpreimy=height-3; 

}; 

POTMenu.prototype.submenuplacing=function(b2,b3){ 

this.b2=Math.abs(b2); this.b3=b3; 

}; 

POTMenu.prototype.mainborderimages=function(left,right,top,bottom){ 

this.imgleft=left; 
this.imgright=right; 
this.imgtop=top; 
this.imgbottom=bottom; 

}; 

POTMenu.prototype.mainbordercorners=function(topleft,topright,bottomleft,bottomright){ 

this.f7=topleft; 
this.f6=topright; 
this.f5=bottomleft; 
this.f4=bottomright; 

}; 

POTMenu.prototype.mainborderdimensions=function(leftwidth,rightwidth,height){ 

this.imgcornerleft=this.f8=leftwidth; 
this.imgcornerright=this.f9=rightwidth; 
this.imgheight=height; this.mainba=0; 

}; 

POTMenu.prototype.subborderimages=function(left,right,top,bottom){ 

this.h9=left; 
this.f1=right; 
this.h6=top; 
this.h5=bottom; 

}; 

POTMenu.prototype.subbordercorners=function(topleft,topright,bottomleft,bottomright){ 

this.h4=topleft; 
this.h3=topright; 
this.h2=bottomleft; 
this.h1=bottomright; 

}; 

POTMenu.prototype.subborderdimensions=function(leftwidth,rightwidth,height){ 

this.a2=this.h8=leftwidth; 
this.a1=this.f1width=rightwidth; 
this.g2=height; 
this.subba=0; 

}; 

POTMenu.prototype.definejoin=function(join,joinheight){ 

this.f2=join; this.d9=joinheight; 

}; 

POTMenu.prototype.maincornerwidths=function(leftwidth,rightwidth){ 

this.imgcornerleft=leftwidth; 
this.imgcornerright=rightwidth; 
this.mainba=(leftwidth+rightwidth)-(this.f8+this.f9); 

}; 

POTMenu.prototype.subcornerwidths=function(leftwidth,rightwidth){ 

this.a2=leftwidth; 
this.a1=rightwidth; 
this.subba=(leftwidth+rightwidth)-(this.h8+this.f1width); 

}; 

POTMenu.prototype.mainmenucolor = function(bgcolor){ 

this.maincalign = "left"; 
this.maincbgcolor = bgcolor; 

}; 

POTMenu.prototype.submenucolor = function(bgcolor){ 

this.subcalign = "left"; 
this.subcbgcolor = bgcolor; 

}; 

POTMenu.prototype.mainpreimage = function(pim,pio,pix,piy){ 

this.mainpreim = pim; 
this.mainpreimov = pio; 
this.mainpreimx = pix; 
this.mainpreimy = piy; 

}; 

POTMenu.prototype.subpreimage = function(pim,pio,pix,piy){ 

this.subpreim = pim; 
this.subpreimov = pio; 
this.subpreimx = pix; 
this.subpreimy = piy; 

}; 

POTMenu.prototype.definemainspacer = function(name,height){ 
 this.mainspacer = name; 
 this.mainspacery = height; 
}; 

POTMenu.prototype.definesubspacer = function(name,height){ 

this.subspacer = name; 
this.subspacery = height; 

}; 

POTMenu.prototype.netscapeadjust = function(main,sub){ 

this.nnmainheight = main; 
this.nnsubheight = sub; 

}; 

this.mainmenuitemsize(160,30); 
this.submenuitemsize(100,30); 
this.submenuplacing(0,0); 
this.mainborderdimensions(1,1,1); 
this.subborderdimensions(1,1,1); 
this.mainborderimages("/img/pix.gif","/img/pix.gif","/img/pix.gif","/img/pix.gif"); 
this.mainbordercorners("/img/pix.gif","/img/pix.gif","/img/pix.gif","/img/pix.gif"); 
this.subborderimages("/img/pix.gif","/img/pix.gif","/img/pix.gif","/img/pix.gif"); 
this.subbordercorners("/img/pix.gif","/img/pix.gif","/img/pix.gif","/img/pix.gif"); 
this.definejoin("",0); this.mainpreimage("/img/pix.gif","/img/pix.gif",5,27); 
this.subpreimage("/img/pix.gif","/img/pix.gif",5,27); this.definemainspacer("",0); 
this.definesubspacer("",0); 
this.g4=null; 
this.menutext=""; 
this.d7=""; 
this.nomenus=0; 
this.netscapeadjust(0,0); 
c0=false; 

}


// End Menu Function
//--------------------------------------------------------------------------------------------------------------------------------------------------------

