// JavaScript Document
var imageNames=new Array();
var imageSizes=new Array();

//function initalizeArrays(){
imageNames[0]="RIMG1.JPG";imageNames[1]="RIMG2.JPG";imageNames[2]="RIMG3.JPG";imageNames[3]="RIMG4.JPG";imageNames[4]="RIMG5.JPG";imageNames[5]="RIMG6.JPG";imageNames[6]="RIMG7.JPG";imageNames[7]="RIMG8.JPG";imageNames[8]="RIMG9.JPG";imageNames[9]="RIMG10.JPG";imageNames[10]="RIMG11.JPG";imageNames[11]="RIMG12.JPG";imageNames[12]="RIMG13.JPG";imageNames[13]="RIMG14.JPG";imageNames[14]="RIMG15.JPG";imageNames[15]="RIMG16.JPG";
imageSizes[0]="1280,960";imageSizes[1]="1316,804";imageSizes[2]="1280,960";imageSizes[3]="626,903";imageSizes[4]="1280,960";imageSizes[5]="1280,960";imageSizes[6]="1280,960";imageSizes[7]="1280,960";imageSizes[8]="1280,960";imageSizes[9]="626,903";imageSizes[10]="1280,960";imageSizes[11]="626,903";imageSizes[12]="1280,960";imageSizes[13]="1280,960";imageSizes[14]="1280,960";imageSizes[15]="1280,960";
//}
function getDimention(imageName){
        dimension=new Array();
        for(var i=0;i<imageNames.length;i++){
                if(imageNames[i]==imageName){
                        dimension=imageSizes[i].split(",");
                        return dimension;
                }
        }
        dimension[0]="0";
}
function vis(id,stat){
        document.getElementById(id).visibility=stat
}
function roll(objx,to){
         objx.src=to;
}
function getImageName(ImgSrc){
         var outcome=ImgSrc.split("_");
         return outcome[1];
}
function newWindow(){
         alert("Please fill the following form \n then fax it to the number written \n on the top right hand corner of the form");
         var nw=window.open("VanillaBeanCateringOrderForm.pdf");
}
function writeMenu(){
  document.write("<p align='center'>");
  document.write("<a href='index.html'>");
  document.write("<img src='imgs2/home.png' alt='home' width='100' height='50' border='0' onmouseover='roll(this,\"imgs2/home2.png\")' onmouseout='roll(this,\"imgs2/home.png\")'/></a>");
  document.write("<a href='Catering.htm' >");
  document.write("<img src='imgs2/catering.png' alt='Catering' width='100' height='50' border='0' onmouseover='roll(this,\"imgs2/catering2.png\")' onmouseout='roll(this,\"imgs2/catering.png\")'/></a>");
  document.write("<a href='#' onclick='newWindow()' >");
  document.write("<img src='imgs2/order.png' alt='order' width='100' height='50' border='0' onmouseover='roll(this,\"imgs2/order2.png\")' onmouseout='roll(this,\"imgs2/order.png\")'/></a>");
  document.write("<a href='terms.htm'>");
  document.write("<img src='imgs2/terms.png' alt='terms and conditions' width='100' height='50' border='0' onmouseover='roll(this,\"imgs2/terms2.png\")' onmouseout='roll(this,\"imgs2/terms.png\")'/></a>");
  document.write("<a href='About.htm'>");
  document.write("<img src='imgs2/about.png' alt='About' width='100' height='50' border='0' onmouseover='roll(this,\"imgs2/about2.png\")' onmouseout='roll(this,\"imgs2/about.png\")'/></a>");
  document.write("</p>");
  document.close();
}
function loadImage(objx){
  var resize=2
  document.getElementById('img_main').style.visibility='visible'
  document.getElementById('myimg').src="imgs4/"+getImageName(objx.src)
  dimension=getDimention(getImageName(objx.src));
  document.getElementById('myimg').height=(dimension[1]/resize);
  document.getElementById('myimg').width=(dimension[0]/resize);
  //alert((dimension[0]/resize) + " " + (dimension[1]/resize));
}