  function product (title, description, prodImage, prodURL) {
	this.title = title;
	this.description = description;
	this.prodImage = prodImage;
	this.prodURL = prodURL;
  }
  
  function gallery (numImages, products, currentIndex) {
    this.numImages=numImages;
	this.products=products;
	this.currentIndex=currentIndex;
	this.nextIndex = currentIndex + 1;
	if (this.nextIndex > this.numImages) this.nextIndex = 1;	
	this.duration = 5000; 
  } 
  
  function displayCurrentImage() {
    var img = imageDir + "/" + unescape(myGallery.products[myGallery.currentIndex-1].prodImage);
	MM_preloadImages(img);	
	blendimage('imageDiv', 'imageArea', img, 750);
    titleObj=document.getElementById("productTitle");	
	titleObj.innerHTML=unescape(myGallery.products[myGallery.currentIndex-1].title);
	descObj=document.getElementById("productDescription");	
	descObj.innerHTML=unescape(myGallery.products[myGallery.currentIndex-1].description);
  }
  
  function doSlideShow() {    
    myGallery.currentIndex=myGallery.nextIndex;
	if (myGallery.currentIndex > myGallery.numImages) myGallery.currentIndex = 1;
	myGallery.nextIndex = myGallery.currentIndex + 1;
	if (myGallery.nextIndex > myGallery.numImages) myGallery.nextIndex = 1;
  
    displayCurrentImage();    
    setTimeout('doSlideShow()', myGallery.duration);	
  }  
  
  function changeDuration(durationObj) {
    myGallery.duration = parseInt(durationObj.options[durationObj.selectedIndex].value);
  }
  
  function gotoProductDetail() {
    window.location = products[myGallery.currentIndex-1].prodURL;
  }  
  
  function MM_preloadImages() { //v3.0
    var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
      var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
      if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
  }
  
  function MM_swapImgRestore() { //v2.0
	  if (document.MM_swapImgData != null)
		for (var i=0; i<(document.MM_swapImgData.length-1); i+=2)
		  document.MM_swapImgData[i].src = document.MM_swapImgData[i+1];
  }
  
  function MM_swapImage() { //v2.0
	  var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.MM_swapImgData;
	  for (i=0; i < (MM_swapImage.arguments.length-2); i+=3) {
		objStr = MM_swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1];
		if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
			(objStr.indexOf('document.all[')   ==0 && document.all   ==null))
		  objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
		obj = eval(objStr);
		if (obj != null) {
		  swapArray[j++] = obj;
		  swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src:oldArray[j];
		  obj.src = MM_swapImage.arguments[i+2];
	  } }
	  document.MM_swapImgData = swapArray; //used for restore
  }