var BlankMenu="NoMenu"; /* used for Homepage suppresses contentTitle and Submenu */
var mmenuindex; /* used by menubuild and findindex */
var smenuindex; /* used by menubuild and findindex */

function highlight(leuchttxt,farbe) {
 switch (farbe)
   {
   case "orange"      : leuchttxt.style.backgroundColor='FFBB00'; break;
   case "maroon"      : leuchttxt.style.backgroundColor='664400'; break;
   case "green"       : leuchttxt.style.backgroundColor='33FF33'; break;
   case "greygreen"   : leuchttxt.style.backgroundColor='608060'; break;
   case "leafgreen"   : leuchttxt.style.backgroundColor='2e8b52'; break;
   case "red"         : leuchttxt.style.backgroundColor='FF6666'; break;
   case "blue"        : leuchttxt.style.backgroundColor='aaaaFF'; break;
   case "white"       : leuchttxt.style.backgroundColor='FFFFFF'; break;
   case "black"       : leuchttxt.style.backgroundColor='000000'; break;
   case "grey"        : leuchttxt.style.backgroundColor='7f7f7f'; break;
   case "lightpastelblue "         : leuchttxt.style.backgroundColor='EFFFFF'; break;
   case "lightpastelyellow "         : leuchttxt.style.backgroundColor='FFFFEF'; break;
   case "lightpastelturquoise "         : leuchttxt.style.backgroundColor='D5FFF4'; break;
   case "lightpastelbrown"         : leuchttxt.style.backgroundColor='DFD2CA'; break;
   case "lightpastelpink"         : leuchttxt.style.backgroundColor='DEC7DE'; break;
   default /*yellow*/ : leuchttxt.style.backgroundColor='EEEE00';
   }
}


/* positions the cursor in search field upon page-loading or if <a name tag is used (i.e. the '#' sign) cursor will not be moved to search field but rather within page. */
function onloadfunction()
{
var the_url = location.href;
var numbersignavail = the_url.indexOf("#");
if (numbersignavail==-1) { document.s.alpha.focus() }  /* if # sign in url */
}

/* used for search to avoid blank entry; onSubmit=... */
function checkSearchEntry(inputfield) {
    if (inputfield.value == '') { 
      alert('Please enter a search term!'); 
      return(false); 
    }
}

/* used for login to avoid blank user name or pin; onSubmit=... */
function checkLoginEntry(userfield,pwfield) {
    if (userfield.value == '' && pwfield.value == '') {
      alert('Please enter a valid user name and pin!');
      return(false); 
    }
    if (userfield.value == '') {
      alert('Please enter a valid user name!');
      return(false); 
    }
    if (pwfield.value == '') {
      alert('Please enter a valid pin!');
      return(false); 
    }
}

function toppage(mm_disp,sm_disp)
{
  document.writeln('<TABLE CELLSPACING=0 CELLPADDING=0 WIDTH=100%>');
  document.writeln('<TR>');
  logo();
  if (BlankMenu!=mm_disp) { findindex(mm_disp,sm_disp); } /* skips data-search for Menu Tab index if Homepage-headder requested */
  document.writeln('<!-- MainMenu Logo start -->');
  document.writeln('<TD valign=bottom class=HeadBackGround>');
  if (BlankMenu==mm_disp) /* blanks out sub-menu pic and replaces with [CR] */
  {
  document.writeln('&nbsp;<br>&nbsp;<br>&nbsp;<p>');
  }
  else {
    document.writeln('<img src='+mmenupic[mmenuindex]+' width='+main_menu_x[mmenuindex]+' height='+main_menu_y[mmenuindex]+' border=0 hspace=0>');
  }   
  document.writeln('</TD>');
  document.writeln('<!-- MainMenu Logo end -->');
  document.writeln('<TD valign=top align=right class=HeadBackGround>');

  document.writeln('<!-- GeneralAdd start -->');
  document.writeln('<!-- BarnesandNoble.com start ');
  document.writeln('<A HREF=\"http://ads.bfast.com/ad/click?siteid=266640&space=50503&size=468x60\"><IMG SRC=\"http://ads.bfast.com/ad/serve?siteid=266640&space=50503&size=468x60\" BORDER=0 WIDTH=468 HEIGHT=60></A>');
  document.writeln('  BarnesandNoble.com end -->');
  document.writeln('<!-- GeneralAdd end -->');
  loginbox();
  document.writeln('</TD>');

  document.writeln('</TR><TR VALIGN=bottom>');
  document.writeln('<TD COLSPAN=2 class=HeadBackGround>');

  mainmenubuild();
  document.writeln('</TD></TR><TR valign=bottom><TD COLSPAN=2>');

  if (BlankMenu==mm_disp) /* blanks out sub-menu for Homepage and utility pages */
  {
    document.writeln('<!-- Blank Sub Menu start -->');
    document.writeln('<table cellspacing=0 cellpadding=2 class=MainMenuTabOff width=100%>');
    document.write('<tr><td>&nbsp;</td></tr>');
    document.writeln('</table>');
    document.writeln('<!-- Blank Sub Menu end -->');
  }
  else {
    submenubuild();
  }
  document.writeln('</TD></TR></TABLE>');

  if (BlankMenu==mm_disp) /* blanks out sub-menu for Homepage and utility pages */
  {
  document.writeln('<!-- Blank ContentTitle start -->');
  document.writeln('<tABLE cellspacing=0 cellpadding=6 width=100% class=PageFrame><tR><tD>');
  document.writeln('<tD>');
  document.writeln('<!-- Blank Content Title BANNER start -->');
  }
  else {
    contentTitlePreAdd();
  }
}

function toppage2()
{
contentTitlePostAdd();
pageframetop();
}

function logo()
{
document.write("<!-- Logo start -->");
document.write("<TD ROWSPAN=3 VALIGN=bottom class=HeadBackGround width=95>");
document.write("<font COLOR=004400 SIZE=2 FACE=arial>");
document.write("<a href=/tropics/trophp.html>");
document.write("<img SRC=/images/tropixlogo.gif width=100 height=80 ALIGN=top WIDTH=85 BORDER=0 HSPACE=0 Alt=CoolTropiX.com>");
// document.write("<B>&nbsp;T H E<br>");
// document.write("&nbsp;<img SRC=/images/cooltitt.gif ALT=Home ALIGN=top HEIGHT=33 WIDTH=85 BORDER=0 HSPACE=0>");
// document.write("<br>&nbsp;T R O P I C S</a></B>");
document.write("</a>");
document.write("</font>");
document.write("<!-- Logo end -->");
document.write("<br>");
document.write("<!-- Search start -->");
document.write("<tABLE cellpadding=3 cellspacing=0><tR>");
document.write("<form name=s method=GET action=http://tct.netfirms.com/cgi-bin/search/tropsrch.cgi onSubmit=checkSearchEntry(alpha)>");
document.write("<tD>");
document.write("<input type=text name=alpha size=10 maxlength=40 class=FindField><input type=submit value=Find class=FindButton");
document.write(' onMouseOver=highlight(this,\"maroon\") onMouseOut=highlight(this,\"greygreen\")>');
document.write("</tD>");
document.write("</form>");
document.write("</tR></tABLE>");
document.write("<!-- Search end -->");
document.write("</TD>");
}


function loginbox()
{
document.write("<!-- Search start -->");
document.write("<tABLE cellpadding=0 cellspacing=0><tR>");
document.write('<form name="login_form" action="http://thecooltropics.mail.everyone.net/email/scripts/loginuser.pl" method="post">');
document.write("<tD align=right><span class=LoginText>Email Login:&nbsp;</span></tD><tD><input type=text name=loginName size=8 maxlength=30 class=LoginField></td>");
document.write("</tR><tR>");
document.write("<tD align=right><span class=LoginText>Password:&nbsp;</span></tD><tD><input type=password name=user_pwd size=8 maxlength=30 class=LoginField></td>");
document.write("<tD colspan=2 align=right><input type=submit name=login value=Login class=LoginButton");
document.write(' onMouseOver=highlight(this,\"maroon\") onMouseOut=highlight(this,\"greygreen\")>');
document.write('</tD></tR>');
document.write('<tR><tD colspan=3 align=right><font face="Verdana, Arial, Helvetica, sans-serif" size=1>New users <a href="http://thecooltropics.mail.everyone.net/email/scripts/joinuser.pl?EV1=9886964466025672"><b>sign up</b></a>!</font>');
document.write("</tD>");
document.write("</form>");
// Generic login form -------------------
// document.write('<form method=POST action=http://tct.netfirms.com/cgi-bin/login/securelogin.cgi onSubmit=checkLoginEntry(this.user_n4.value,this.pw_n4.value)>');
// document.write("<tD align=right><span class=LoginText>User:&nbsp;</span></tD><tD><input type=text name=user_n4 size=8 maxlength=30 class=LoginField></td>");
// document.write("</tR><tR>");
// document.write("<tD align=right><span class=LoginText>Pin:&nbsp;</span></tD><tD><input type=password name=pw_n4 size=8 maxlength=30 class=LoginField></td>");
// document.write("<tD colspan=2 align=right><input type=submit value=Login class=LoginButton");
// document.write(' onMouseOver=highlight(this,\"maroon\") onMouseOut=highlight(this,\"greygreen\")>');
// document.write("</tD>");
// document.write("</form>");
// Generic login form end ---------------
document.write("</tR></tABLE>");
document.write("<!-- Search end -->");
}

/* Establishes index for main menu and submenu: mmenuindex and mmenuindex */
function findindex(mm_disp,sm_disp)
{
  var i; var j;
   for(i=0;i<mmenutext.length;i++) {
     if(mmenutext[i]==mm_disp)	{
       mmenuindex=i;
     }
   }
  for(j=0;j<smenutext[mmenuindex].length; j++) {
    if(smenutext[mmenuindex][j]==sm_disp)	{
      smenuindex=j;
    }
  }
}

function mainmenubuild()
{
  var i; var j;
  document.writeln('<!-- Main Menu start -->');
  document.writeln('<table cellspacing=0 cellpadding=0><tr valign=bottom>');
   for(i=0;i<mmenutext.length;i++) {
     document.write('<td><input type=submit value=\"'+mmenutext[i]+'\" class=');
     if(mmenuindex==i)	{
       document.write('MainMenuTabOn');
     }
     else {
       document.write('MainMenuTabOff');
       document.write(' onMouseOver=highlight(this,\"maroon\") onMouseOut=highlight(this,\"greygreen\")');
     }
     document.writeln(' OnClick=location.href=\"'+mmenulink[i]+'\"></td><td class=MainMenuSpacer>&nbsp;</td>');
   }
  document.writeln('</tr></table>');
  document.writeln('<!-- Main Menu end -->');
}

function submenubuild()
{
  var j;

  document.writeln('<!-- Sub Menu start -->');
  document.writeln('<table cellspacing=0 cellpadding=0><tr valign=bottom>');
  for(j=0;j<smenutext[mmenuindex].length; j++) {
    if (smenulink[mmenuindex][j]!='') { // when URL not defined in data.js do not display submenu item
      document.write('<td><input type=submit value=\"'+smenutext[mmenuindex][j]+'\" class=');
      if(smenuindex==j)	{
        document.write('SubMenuTabOn');
      }
      else {
        document.write('SubMenuTabOff');
        document.write(' onMouseOver=highlight(this,\"maroon\") onMouseOut=highlight(this,\"leafgreen\")');
      }
     document.writeln(' OnClick=location.href=\"'+smenulink[mmenuindex][j]+'\"></td><td class=SubMenuSpacer>&nbsp;</td>');
    }
  }
  document.writeln('</tr></table>');
  document.writeln('<!-- Sub Menu end -->');
}

function contentTitlePreAdd()
{
  document.writeln('<!-- ContentTitle start -->');
  document.writeln('<tABLE cellspacing=0 cellpadding=6 width=100% class=PageFrame><tR valign=middle><tD>');
  document.writeln('<img src='+sub_menu_pic[mmenuindex][smenuindex]+' border=0 WIDTH='+sub_menu_x[mmenuindex][smenuindex]+' HEIGHT='+sub_menu_y[mmenuindex][smenuindex]+'>');
  document.writeln('</tD>');
  document.writeln('<tD align=left>&nbsp;<span class=ContentTitle1>'+mmenutext[mmenuindex]+'</span><br><span class=ContentTitle2>'+smenutext[mmenuindex][smenuindex]+'</span></tD>');
  document.writeln('<tD align=right width=100%>');
  document.writeln('<!-- Content Title BANNER start -->');
}

function contentTitlePostAdd()
{
  document.writeln('<!-- Content Title BANNER end -->');
  document.writeln('</tD>');
  document.writeln('</tR>');
  document.writeln('</tABLE>');
  document.writeln('<!-- ContentTitle end -->');
}

function pageframetop()
{
  document.writeln('<!-- PageFrameTop start -->');
  document.writeln('<table cellspacing=0 cellpadding=0 border=0 width=100%>');
  document.writeln('<tr>');
  document.writeln('<td class=PageFrame width=6>&nbsp;</td><td class=PageBackground>');
  document.writeln('<!-- PageFrameTop end -->');
}

function pageframebottom()
{
document.writeln("<!-- PageFrameBottom start -->");
document.writeln("</td><td class=PageFrame width=6>&nbsp;</td></tr>");
document.writeln("</table>");
document.writeln("<!-- PageFrameBottom end -->");
document.writeln("<!-- Bottom start -->");
document.writeln("<table class=PageFrame width=100%>");
document.writeln("<colgroup><col width=1><col width=2><col width=1 align=right></colgroup>");
document.writeln("<tr><td>&nbsp;<font size=1>ShinyStat");
// <!-- shinystat.it counter -->
document.write('<!-- Inizio Codice Shinystat --><script type="text/javascript" language="JavaScript" SRC="http://codice.shinystat.it/cgi-bin/getcod.cgi?USER=cooltropix&FRAME=yes"></script><noscript><A HREF="http://www.shinystat.it/cgi-bin/shinystatv.cgi?USER=cooltropix" target="_top"><IMG SRC="http://www.shinystat.it/cgi-bin/shinystat.cgi?USER=cooltropix&NC=1" BORDER="0"></A></noscript><!-- Fine Codice Shinystat -->');
// <!-- shinystat.it end -->
document.writeln("</td><td align=center>");
document.writeln('<FONT SIZE=1 FACE=Arial COLOR=225522>This site is under continuous construction.<BR>Send comments/questions to <A HREF=Mailto:Info@CoolTropiX.com>Info@CoolTropiX.com</A>');
document.write('<BR><FONT SIZE=2>&copy;&nbsp;');
currentyear = new Date();
document.write(currentyear.getYear()+1900);
document.writeln('&nbsp;</FONT></FONT><FONT SIZE=3 FACE=arial><STRONG><A HREF=/tropics/trophp.html><img src=/images/cooltitt.gif alt=COOL WIDTH=45 HEIGHT=19 ALIGN=top border=0> TROPIX</A></STRONG></FONT>');
document.writeln("</td><td>");
document.writeln('<!-- Begin Nedstat Basic code --><!-- Title: CoolTropiX.com --><!-- URL: http://cooltropix.com -->');
document.writeln('<a target="_blank" href="http://v1.nedstatbasic.net/stats?AB+pYAFRwvK92BjvtYRL2uJ3KVYA"><img src="http://m1.nedstatbasic.net/n?id=AB+pYAFRwvK92BjvtYRL2uJ3KVYA" border="0" nosave width="28" height="28"></a>');
document.writeln('<!-- End Nedstat Basic code -->&nbsp;');
document.writeln("</td></tr>");
document.writeln("</table>");
document.writeln("<!-- Bottom end -->");
}

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

function changeImg(ImgName, ImgURL)
// . . . . . . . . . . . . . . . . . . . . 
// Used for image swapping in merchandise
// . . . . . . . . . . . . . . . . . . . . 
  {
    document.images[ImgName].src=ImgURL
  }


