//
// include in html page:
// <script LANGUAGE="javascript1.2" SRC="topbranding.js"></script>
//
var IW= 0;
var IH= 0;
var PX= 0;
var PY= 0;
var brand= null;
var IMGW= 36;
var IMGH= 50;
var LSAFETY= 60;
var TSAFETY= 36;
var off_image= "images/top.gif";
var on_image= "images/top.gif";
var gandalf= 0;
var alldivs= new Array();

function BrandInit()
{
   if( brand != null ) 
      return;
   else 
   { 
      for( i=0 ; i<alldivs.length && gandalf==0 ; i++ )
      {
         if( (gandalf==0) && (alldivs(i).id=="TopBranding") )
         {
            gandalf= 1;
            brand= alldivs(i);
         }
      }
   }
   brand.onmouseover= neat_mouseover;
   brand.onmouseout= neat_mouseout;
}
               
function neat_mouseover()
{
   window.status= "GYMSTARZ";
   window.document.all.TopBrandingPic.src= on_image;
   return true;
}
                  
function neat_mouseout()
{
   window.status= "";
   window.document.all.TopBrandingPic.src= off_image;
   return true;
}
                     
function BrandPosition()
{
   if( brand != null )
   {
      IH= document.body.clientHeight;
      IW= document.body.clientWidth;
      PX= document.body.scrollLeft;  
      PY= document.body.scrollTop;  
      brand.style.top= (IH+PY-(IMGH+TSAFETY));
      brand.style.left=(IW+PX-(IMGW+LSAFETY));  
      for (i=0; i<alldivs.length; i++)
      {
         if (alldivs(i).style.zIndex > brand.style.zindex)
            brand.style.zindex= (alldivs(i).style.zIndex + 1);  
      }
   }  
}

function BrandShow(toggle)
{
   if( brand != null )
      brand.style.display= toggle;
}
      
function Branding()
{
   if(navigator.appVersion.indexOf("Mac") == -1)
   {  
      oldIW= IW;  
      oldIH= IH;  
      oldPX= PX;  
      oldPY= PY;
      if( (document.body.clientHeight!=oldIH)||(document.body.clientWidth!=oldIW)||
          (document.body.scrollLeft!=oldPX)  ||(document.body.scrollTop!=oldPY))
      {
         BrandInit();
         BrandShow("none");
         BrandPosition();
         BrandShow("");
      }
   }
}

if (document.images)
{
   bVer= parseInt(navigator.appVersion);
   if( bVer >= 4 )
   {
      alldivs= document.all.tags("DIV");
      document.write( '<DIV CLASS="TopBranding" ID="TopBranding" ' );
      document.write( 'STYLE="position:absolute;top:1;display:none;filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=85) progid:DXImageTransform.Microsoft.Shadow(color=#CCCCCC,direction=135,strength=5);a:{color:transparent;background-color:transparent;text-decoration:none;}" ALIGN="right">' );
      document.write( '<a HREF="javascript:window.scrollTo(0,0)">' );
      document.write( '<img NAME="TopBrandingPic" SRC="'+off_image+'" BORDER="0" ALT="GYMSTARZ" WIDTH="63" HEIGHT="63">' );
      document.write( '</a><br>' );
      document.write( '</DIV>' );
      setInterval("Branding()",100);
   }
}

