var roomCount = 0;
var rooms = new Array();
var RimagePrefix = "VG_";
var RonSuffix = "_ON.gif";
var RoffSuffix = "_OFF.gif";
var RimageSubdirectory = "menu/";

createRoom(125, 125, "room1", "Home and Family", "rooms1.html");
createRoom(125, 125, "room2", "Remember Me", "rooms2.html");
createRoom(125, 125, "room3", "Perfect Moment", "rooms3.html");
createRoom(125, 125, "room4", "Lasting Love", "rooms4.html");
createRoom(125, 125, "room5", "Double Delight", "rooms5.html");
createRoom(125, 125, "room6", "French Lace", "rooms6.html");
createRoom(125, 125, "room7", "Angel Face", "rooms7.html");
createRoom(125, 125, "room8", "Royal Sunset", "rooms8.html");

function createRoom (height, width, name, infoText, link)
{
  rooms[roomCount] = new RoomItem(height, width, name, infoText, link);
  roomCount++;
}

function RoomItem (height, width, name, infoText, link)
{
  this.height   = height;
  this.width    = width;
  this.name     = name;
  this.info     = infoText;
  this.link     = link;
  this.on       = new Image (width, height);
  this.on.src   = RimageSubdirectory + RimagePrefix + name + RonSuffix;
  this.off      = new Image (width, height);
  this.off.src  = RimageSubdirectory + RimagePrefix + name + RoffSuffix;
}

function doRoomOver(num)
{
  document.images[rooms[num].name].src = rooms[num].on.src;
  self.status = rooms[num].info;
}

function doRoomOut(num)
{
  document.images[rooms[num].name].src = rooms[num].off.src;
  self.status = "";
}

function writeRooms()
{
  for(i = 0; i < roomCount; i++)
  {
    with(this.document)
    {
	write ('<a href="' + rooms[i].link + '" onMouseOver="doRoomOver(' + i + '); return true" onMouseOut="doRoomOut(' + i + '); return true">');
	write ('<img name="' + rooms[i].name + '" src="' + rooms[i].off.src + '" alt="' + rooms[i].name + '" width="' + rooms[i].width + '" height="' + rooms[i].height + '" border="0" hspace="2">');
	write ('</a>'); 
	if(i == 3) write("<br/>");
    }
  }
}

