<!-- Hide from JavaScript-Impaired Browsers

//return random number from 0 up to max-1
function random(max) {
  return ((Math.round(Math.random()*100))  % max);
}

//define MyImage object:  image source, destination url, and description
function MyImage(src, url, desc) {
  this.src       = src;
  this.url       = url;
  this.selected  = false;
  this.desc      = desc;
  return this;
}


//start MenuButtons rotation
function start() {
  for(var i = 0; i < this.buttons.length; i++) {
      document.write(this.before);
      document.write('<A HREF="javascript:redirect(\''+this.id+'\','+i+')"');
      
     //ie3.02 hack  
     if((navigator.appVersion + navigator.appName).length != 0)
       document.write(' onMouseOver="javascript:document.'+this.id+i+'.src=\''+getOnImage(this.buttons[i].src)+'\';window.status=\''+this.buttons[i].desc+'\'"'+
                       ' onMouseOut="javascript:document.'+this.id+i+'.src=\''+this.buttons[i].src+'\';window.status=\'\'"');
                          
       document.write(' ' + this.target + '>'+
                     '<IMG ALT="' + this.buttons[i].desc + '" ' + this.align + ' ' + this.hspace + ' ' + this.vspace + ' ' + this.border + ' ' + 
                     'SRC="'+this.buttons[i].src+
                     '" WIDTH="'+this.width+'" HEIGHT="'+this.height+'" NAME="'+this.id + i +'" ></A>');
      document.write(this.after);
  }

}


//redirect to new url
function redirect(id, num) {
  var url = eval(id+".buttons["+num+"].url");
  window.location = url;
}


//set before atribute
function setBefore(before) {
  this.before = before;
}


//set after atribute
function setAfter(after) {
  this.after = after;
}

//set align atribute
function setAlign(align) {
  this.align = 'ALIGN="'+align+'"';
}

//set border atribute
function setBorder(border) {
  this.border = 'BORDER="'+border+'"';
}                                 



//set hspace atribute
function setHspace(hspace) {
  this.hspace = 'HSPACE="'+hspace+'"';
}

//set vspace atribute
function setVspace(vspace) {
  this.vspace = 'VSPACE="'+vspace+'"';
}

//set vspace atribute
function setTarget(target) {
  this.target = 'TARGET="'+target+'"';
}



//get on immage
function getOnImage(src) {
	var off = src.lastIndexOf("off");
	var newsrc = src.substring(0,off) + "on";
	return newsrc + ".jpg";
}



//preload necessary images
function loadImages(MenuButtons) {
    for(var i = 0; i < MenuButtons.buttons.length; i++) {
       var image = new Image(MenuButtons.width, MenuButtons.height);
       image.src = MenuButtons.buttons[i].src;
       
       var onImage = new Image(MenuButtons.width, MenuButtons.height);
       onImage.src = getOnImage(MenuButtons.buttons[i].src);
       
       
    }
}
   
 
                          
//define MenuButtons object: a collection of images with the same width/height
//that should be rotated with rotateDelay
//boardId -- unique identifier for this MenuButtons (variable name)
//rotationType -- true -> rotate banners, false -> static, random banner
function MenuButtons(id, buttons, width, height) {
  this.id          = id;
  this.buttons     = buttons;
  this.width       = width;
  this.height      = height;
  this.align       = "";
  this.hspace      = "";
  this.vspace      = "";
  this.border      = 'BORDER="0"';
  this.target      = "";
  this.before      = "";
  this.after       = "<BR>";
  this.setAlign    = setAlign;
  this.setHspace   = setHspace;
  this.setVspace   = setVspace;
  this.setBorder   = setBorder;
  this.setTarget   = setTarget;
  this.setBefore   = setBefore;
  this.setAfter    = setAfter;
  this.start       = start;

  //ie3.02 hack  
  if((navigator.appVersion + navigator.appName).length != 0)
      loadImages(this);

  return this;
}

                           
// End Hiding -->

