var nofSamples = 10;

function rndnumber(){
  var randscript = -1
  while (randscript < 0 || randscript > nofSamples-1 || isNaN(randscript)){
    randscript = parseInt(Math.random()*(nofSamples+1))
  }
  return randscript
}

function OpenPicture( num ) {
 
 var param = 'width='+(sArray[num].width[1]+80)+',height='+ (sArray[num].height[1]+100) + 
     ',scrollbars=yes,left=20,top=20';
 
// alert("param = " + param);
 
 var pic = "picture.html?num=" + num;
 window.open(pic,'picture',param);
 return false;
}


// constructor for sample glass objects
function sampleGlass (desc, image, width, height) {

  this.desc = desc;
  this.image = image;

  this.height = height;
  this.width = width;
}

var sArray = new Array(nofSamples);
sArray[0] = new sampleGlass("Beaker with Greenman or White Belt", 
"graphics/beaker_pics", new Array(233, 582), new Array(200, 500));
  
sArray[1] = new sampleGlass("Chalice with Boar or Greenman", 
"graphics/chalice_pics", new Array(213, 533), new Array(200, 500));

sArray[2] = new sampleGlass("Flutes with Lion Rampant or Stag Head", 
"graphics/flutes_pics", new Array(155, 310), new Array(250, 500));

sArray[3] = new sampleGlass("Mariners Mug with Wolf Erased", 
"graphics/mariner_wolf", new Array(180, 450), new Array(200, 500));

sArray[4] = new sampleGlass("Shot Glasses with Horse Courant, " +
  "Long Boat, White Belt, or Lion Rampant ", "graphics/shots_pics", 
  new Array(250, 700), new Array(89, 249));

sArray[5] = new sampleGlass("Tankard with Wolf Erased", 
"graphics/tankard_wolf", new Array(165, 412), new Array(200, 500));

sArray[6] = new sampleGlass("Wine Glass with Cross of Caid", 
"graphics/wine_caid", new Array(100, 246), new Array(203, 500));

//sArray[7] = new sampleGlass("Green coffee cup with SOMETHING passant", 
//"graphics/coffee_green", new Array(200, 500), new Array(180, 450));

sArray[7] = new sampleGlass("Cobalt Goblet with a Pelican in Her Piety", 
"graphics/goblet_pel", new Array(200, 500), new Array(159, 397));

sArray[8] = new sampleGlass("Pitcher with Greenman", 
"graphics/pitcher_greenman", new Array(200, 500), new Array(195, 488));

sArray[9] = new sampleGlass("Clear Teardrop with Tudor Rose Or", 
"graphics/teardrop_rose", new Array(102, 254), new Array(200, 500));

sArray[10] = new sampleGlass("Cobalt Goblet with Rampant Lion Or", 
"graphics/front_lion_new", new Array(250, 500), new Array(333, 667));


function getSDesc( Num ) {
  return sArray[Num].desc;
}

function getSSmallImage( Num ) {

  var img = "<img alt='Click to view sample " + sArray[Num].desc + "' src='" + 
  	sArray[Num].image + "_sm.jpg' height='" +
	  sArray[Num].height[0] + "' width='" + 
  	sArray[Num].width[0] +"' border='0'>";
//  alert(Num + " - " + img);
  return img;
}

function getSLargeImage( Num ) {

  var img = "<img alt='" + sArray[Num].desc + "' src='" + 
  	sArray[Num].image + "_lg.jpg' height='" +
	  sArray[Num].height[1] + "' width='" + 
  	sArray[Num].width[1] +"' border='0'>";
//  alert(glassNum + " - " + img);
  return img;
}

