
//preload images
if (document.images) {
image1On = new Image();
image1On.src="images/product/page1_on.gif";
image1Off = new Image();
image1Off.src="images/product/page1_off.gif";

image2On = new Image();
image2On.src="images/product/page2_on.gif";
image2Off = new Image();
image2Off.src="images/product/page2_off.gif";

image3On = new Image();
image3On.src="images/product/page3_on.gif";
image3Off = new Image();
image3Off.src="images/product/page3_off.gif";

image4On = new Image();
image4On.src="images/product/page4_on.gif";
image4Off = new Image();
image4Off.src="images/product/page4_off.gif";
}
//LIST OF IDS USED FOR THE TABLES
listOfTables = new Array ('profile','credits','availability','audiovisual');
//LIST OF NAME IMAGES
menuImageNames = new Array('image1','image2','image3','image4');



//CHANGE SOURCES OF THE MENU IMAGES AND MAKES A CALL TO SHOW AND HIDE CORRESPONDING TABLES
function changeImage(imageName){	
//----IE--------
if(document.all){
	for(j=0;j < menuImageNames.length;j++){
		if(document.images[menuImageNames[j]].name == imageName){
			
			if(document.images[menuImageNames[j]].src = eval(imageName + "On.src")){		
				document.images[menuImageNames[j]].src = eval(imageName + "Off.src");
			}
			if(document.images[menuImageNames[j]].src = eval(imageName + "Off.src")){		
				document.images[menuImageNames[j]].src = eval(imageName + "On.src");
			}
			showHideTable(imageName);		
		}
	   else { 
		document.images[menuImageNames[j]].src = eval(document.images[menuImageNames[j]].name+ "Off.src");
		}
	}	
  } 
}


// CALL TO SHOW AND HIDE CORRESPONDING TABLES
function showHideTable(imageName){ 

  currentTable = "";
  if(imageName == 'image1')
  currentTable = listOfTables[0];
  if(imageName == 'image2')
  currentTable = listOfTables[1];
  if(imageName == 'image3')
  currentTable = listOfTables[2];
  if(imageName == 'image4')
  currentTable = listOfTables[3];
 
  if(document.all)
  {
  	for(v=0; v < listOfTables.length; v++){
	 if(listOfTables[v] == currentTable){
		document.all[currentTable].style.display = 'inline';
	 } else {
	 	document.all[listOfTables[v]].style.display = 'none';	 
	 }	
	}  
  }
  
}







