function menuOver( menu )
{
  document.images[menu].src = linkRel + "images/b" + menu + "on.gif";
}

function menuClick( menu )
{
//  menuOver( menu );
}

function menuOut( menu )
{
  document.images[menu].src = linkRel + "images/b" + menu + ".gif";
}

function imagePreload( imageName )
{
  image = new Image();
  image.src = linkRel + "images/" + imageName + ".gif";
}

function menuPreload( menu )
{
  imagePreload( "b" + menu );
  imagePreload( "b" + menu + "on" );
}

function addFavs( name, url )
{
	var is_4up = parseInt(navigator.appVersion);
	var is_mac = navigator.userAgent.toLowerCase().indexOf("mac")!=-1;
	var is_ie = navigator.userAgent.toLowerCase().indexOf("msie")!=-1;
	var thePage = location.href;
	if ( is_ie && is_4up && !is_mac ) 
		window.external.AddFavorite( url, name );
}

function windowOpen( name, url, width, height )
{
  params = "width=" + width;
  params += ",height=" + height;
  if ( parseInt( navigator.appVersion ) > 3 ) {
    if ( screen.width < 512 ) {
      params += ",fullscreen=1";
      width = Math.max( width, screen.width );
      height = Math.max( height, screen.height );
    }
    x = (screen.width - width) / 2;
    if ( x < 2 ) x = 2;
    y = (screen.height - height) / 2 - 20;
    if ( y < 4 ) y = 4;
    params += ",screenX=" + x;
    params += ",left=" + x;
    params += ",screenY=" + y;
    params += ",top=" + y;
  }
  else {
    params += ",screenX=0,left=0,screenY=0,top=0";
  }
  params += ",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,copyhistory=1";
  window.open( url, name, params );
}
var bannersAndLinksNumber = 7;
var bannersAndLinks = new Array(   1, 0, "http://www.alwaysneat.com/site/fruits/index.html", "banner-fruits1.gif",
   1, 0, "http://www.alwaysneat.com/site/ds/index.html", "banner-ds1.gif",
   1, 0, "http://www.alwaysneat.com/site/dropheads/index.html", "banner-drop1.gif",
   1, 0, "http://www.alwaysneat.com/site/dropheads/index.html", "banner-drop1.gif",
   1, 0, "http://www.alwaysneat.com/site/twistingo/index.html", "banner-twist1.gif",
   1, 0, "http://www.alwaysneat.com/gamepack.html", "banner-gamepack1.gif", 100, 0, "http://www.alwaysneat.com/site/liong2/index.html", "banner-liong2.gif",
   0
);

function showBanner468x60()
{  var bannerPercent = (Math.round( Math.random() * 5500 ) % 100);
  
  var bannerIndex;
  var bannerLink = "http://www.alwaysneat.com/index.html";
  var bannerImage = "banner-default.gif";  var bannerArrayIndex = 0;
  var bannerType = 0;  
  for ( bannerIndex = 0; bannerIndex < bannersAndLinksNumber; bannerIndex++ ) {
      var percent = bannersAndLinks[bannerArrayIndex];
    if ( bannerPercent <= percent ) {      bannerType = bannersAndLinks[bannerArrayIndex + 1];
      bannerLink = bannersAndLinks[bannerArrayIndex + 2];
      bannerImage = bannersAndLinks[bannerArrayIndex + 3];      break;  
    }
    bannerPercent -= percent;
    bannerArrayIndex += 4;
  }
  
    var imageName = linkRel + "images/" + bannerImage;    document.write( "<a target=\"_top\" href=\"" + bannerLink + "\">" );
  if ( bannerType == 0 ) {
    document.write( "<img width=468 height=60 border=0 alt=\"Click here!\" src=\"" + imageName + "\">" );  }  else {    document.write( "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=\"468\" height=\"60\">" );
    document.write( "	<param name=\"movie\" value=\"" + imageName + "\">" );
    document.write( "	<param name=\"quality\" value=\"high\">" );
    document.write( "	<param name=\"bgcolor\" value=\"#FFF0DB\">" );
    document.write( "	<embed name=\"banner-anim\" src=\"" + imageName + "\" width=\"468\" height=\"60\" quality=\"high\" bgcolor=\"#FFFFFF\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\">" );
    document.write( "</object>" );
  }
  document.write( "</a>" );

}
function showLeftAdvert()
{
  document.write( "<FONT FACE=\"Verdana\" SIZE=\"1\">" );
  document.write( "<p align=\"center\">" );
  document.write( "  <a href=\"http://www.alwaysneat.com/giftshop.html\"><img src=\"http://www.alwaysneat.com/images/giveagift.gif\" border=\"0\" alt=\"Give A Gift!\" width=\"100\" height=\"150\"></a>" );
  document.write( "</p>" );
  document.write( "<p align=\"center\">" );
  document.write( "Advertisement<br>" );
  document.write( "  <a href=\"http://www.neatgame.com/index.html?source=alwaysneat\" target=\"_blank\"><img src=\"http://www.neatgame.com/images/neatgamebanner1.gif\" border=\"0\" alt=\"Neatgame.com\" width=\"100\" height=\"100\"></a>" );
  document.write( "</p>" );
  document.write( "</font>" );
}
function showMenu(){
  document.write( "  <TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"0\">" );
  document.write( "    <TR ALIGN=\"right\" VALIGN=\"TOP\">" );
  document.write( "      <TD align=\"right\">" );
  document.write( "        <A HREF=\"" + linkRel + "index.html\" ONCLICK=\"menuClick( 'home' )\" ONMOUSEOVER=\"menuOver( 'home' )\" ONMOUSEOUT=\"menuOut( 'home' )\">" );
  document.write( "          <IMG NAME=\"home\" SRC=\"" + linkRel + "images/bhome.gif\" BORDER=0 WIDTH=41 HEIGHT=18 ALT=\"Home\">" );
  document.write( "        </A>" );
  document.write( "        <script>menuPreload( \"home\" );</script>" );
  document.write( "      </TD>" );
  document.write( "      <TD align=\"right\">" );
  document.write( "        <A HREF=\"" + linkRel + "games.html\" ONCLICK=\"menuClick( 'games' )\" ONMOUSEOVER=\"menuOver( 'games' )\" ONMOUSEOUT=\"menuOut( 'games' )\">" );
  document.write( "          <IMG NAME=\"games\" SRC=\"" + linkRel + "images/bgames.gif\" BORDER=0 WIDTH=49 HEIGHT=18 ALT=\"Games\">" );
  document.write( "        </A>" );
  document.write( "        <script>menuPreload( \"games\" );</script>" );
  document.write( "      </TD>" );
  document.write( "      <TD align=\"right\">" );
  document.write( "        <A HREF=\"" + linkRel + "shop.html\" ONCLICK=\"menuClick( 'shop' )\" ONMOUSEOVER=\"menuOver( 'shop' )\" ONMOUSEOUT=\"menuOut( 'shop' )\">" );
  document.write( "          <IMG NAME=\"shop\" SRC=\"" + linkRel + "images/bshop.gif\" BORDER=0 WIDTH=37 HEIGHT=18 ALT=\"Shop\">" );
  document.write( "        </A>" );
  document.write( "        <script>menuPreload( \"shop\" );</script>" );
  document.write( "      </TD>" );
  document.write( "      <TD align=\"right\">" );
  document.write( "        <A HREF=\"" + linkRel + "company.html\" ONCLICK=\"menuClick( 'company' )\" ONMOUSEOVER=\"menuOver( 'company' )\" ONMOUSEOUT=\"menuOut( 'company' )\">" );
  document.write( "          <IMG NAME=\"company\" SRC=\"" + linkRel + "images/bcompany.gif\" BORDER=0 WIDTH=63 HEIGHT=18 ALT=\"Company\">" );
  document.write( "        </A>" );
  document.write( "        <script>menuPreload( \"company\" );</script>" );
  document.write( "      </TD>" );
  document.write( "      <TD align=\"right\">" );
  document.write( "        <A HREF=\"" + linkRel + "support.html\" ONCLICK=\"menuClick( 'support' )\" ONMOUSEOVER=\"menuOver( 'support' )\" ONMOUSEOUT=\"menuOut( 'support' )\">" );
  document.write( "          <IMG NAME=\"support\" SRC=\"" + linkRel + "images/bsupport.gif\" BORDER=0 WIDTH=49 HEIGHT=18 ALT=\"Support\">" );
  document.write( "        </A>" );
  document.write( "        <script>menuPreload( \"support\" );</script>" );
  document.write( "      </TD>" );
  document.write( "    </TR>" );
  document.write( "  </TABLE>" );
}