// JavaScript Document
//  Virgil Viall - Mini and Large Fleur
// 
// 

var imgArray      = ['images/LEMON3.jpg',     'images/ALMOND3.jpg',     'images/CHOCOLATE3.jpg',    'images/METROPOLITAN2.jpg',      'images/PROFESSOR1.jpg',      'images/TURTLEKING.jpg' ];
var imgThmArray   = ['images/LEMON3_thm.jpg', 'images/ALMOND3_thm.jpg', 'images/CHOCOLATE3_thm.jpg', 'images/METROPOLITAN2_thm.jpg', 'images/PROFESSOR1_thm.jpg', 'images/TURTLEKING_thm.jpg' ];
var imgMinniArray = ['images/MinisWBox.jpg', 'images/3minis.jpg'];

var imgThmIDs    = ['thm_A', 'thm_B', 'thm_C', 'thm_D', 'thm_E', 'thm_F'];

var prodTitle     = ["<strong>Lemon Judy</strong>", "<strong>Almond Verrazano</strong>", "<strong>Chocolate Manhattan</strong>", "<strong>Metropolitan</strong>", "<strong>Nutty Professor</strong>", "<strong>Turtle King</strong>", "<strong>Contains natural and organic ingredients</strong" ]

var prodDesc     = [
"<strong>#1 Lemon Judy</strong>" + 
"<br><br><br>" + 
"<div style='font-size: 8pt;color: #000;'>A light, creamy and refreshing lemony-zest cheesecake with" + 
" a cinnamon and buttery graham cracker crust.</div>" + 
"<br><br>" + 
"<div style='font-size: 7pt;color: #000;'>$37.00 per cake or box of 20 <br><a href='#'onmouseover='MouseOverShowImage(0)' onmouseout='HideOverlay()'style='font-size: 7pt;'>mini</a> - cheesecakes with original crust</div><br>" + 
"<div style='font-size: 7pt;color: #000;'>$38.00 per cake or box of 20 <br><a href='#'onmouseover='MouseOverShowImage(0)' onmouseout='HideOverlay()'style='font-size: 7pt;'>mini</a> - cheesecakes with <em><a href='#' onmouseover='MouseOverText(6)' onmouseout='HideOverlay()'  style='text-decoration: none;font-size: 7pt;' >natural crust</a></em></div>",

"<strong>#2 Almond Verrazano</strong>" + 
"<br><br>" + 
"<div style='font-size: 8pt;color: #000;'>Luscious and silky-smooth marzipan makes this cheesecake" + 
" irresistible.  With <br>a vanilla cookie crust infused with just a hint of amaretto and topped with roasted" + 
" almond slivers.</div>" + 
"<br><br>" + 
"<div style='font-size: 7pt;color: #000;'>$40.00 per cake or box of 20 <br><a href='#'onmouseover='MouseOverShowImage(0)' onmouseout='HideOverlay()'style='font-size: 7pt;'>mini</a> - cheesecakes with original crust</div><br>" + 
"<div style='font-size: 7pt;color: #000;'>$43.00 per cake or box of 20 <br><a href='#'onmouseover='MouseOverShowImage(0)' onmouseout='HideOverlay()'style='font-size: 7pt;'>mini</a> - cheesecakes with <em><a href='#' onmouseover='MouseOverText(6)' onmouseout='HideOverlay()'  style='text-decoration: none;font-size: 7pt;' >natural crust</a></em></div>",

"<strong>#3 Chocolate Manhattan</strong>" + 
"<br><br><br>" + 
"<div style='font-size: 8pt;color: #000;'>Rich and ultra creamy traditional New York-style cheesecake filling." + 
"<br><br>" + 
"With a chocolate graham cracker, semi-sweet chocolate chips and buttery-rich cocoa crust.</div>" + 
"<br><br>" + 
"<div style='font-size: 7pt;color: #000;'>$37.00 per cake or box of 20 <br><a href='#'onmouseover='MouseOverShowImage(0)' onmouseout='HideOverlay()'style='font-size: 7pt;'>mini</a> - cheesecakes with original crust</div><br>" + 
"<div style='font-size: 7pt;color: #000;'>$39.00 per cake or box of 20 <br><a href='#'onmouseover='MouseOverShowImage(0)' onmouseout='HideOverlay()'style='font-size: 7pt;'>mini</a> - cheesecakes with <em><a href='#' onmouseover='MouseOverText(6)' onmouseout='HideOverlay()'  style='text-decoration: none;font-size: 7pt;' >natural crust</a></em></div>",

"<strong>#4 Metropolitan</strong>" + 
"<br><br><br>" + 
"<div style='font-size: 8pt;color: #000;'>Traditional New York-style cheesecake with a cinnamon and buttery graham cracker crust. For traditionalists who<br>don't " + 
"mind having the crusty top layer.</div>" + 
"<br><br>" + 
"<div style='font-size: 7pt;color: #000;'>$37.00 per cake or box of 20 <br><a href='#'onmouseover='MouseOverShowImage(0)' onmouseout='HideOverlay()'style='font-size: 7pt;'>mini</a> - cheesecakes with original crust</div><br>" + 
"<div style='font-size: 7pt;color: #000;'>$38.00 per cake or box of 20 <br><a href='#'onmouseover='MouseOverShowImage(0)' onmouseout='HideOverlay()'style='font-size: 7pt;'>mini</a> - cheesecakes with <em><a href='#' onmouseover='MouseOverText(6)' onmouseout='HideOverlay()'  style='text-decoration: none;font-size: 7pt;' >natural crust</a></em></div>",

"<strong>#5 Nutty Professor</strong>" + 
"<br><br>" + 
"<div style='font-size: 8pt;color: #000;'>Traditional New York-style cheesecake with a buttery cinnamon, brown sugar, walnut crust. Topped with chopped pecans " + 
"and almonds. <br><br>Julie of Vern's barber shop in Stillwater suggested a gluten-free cake would be very popular " + 
"for the Holidays. Several weeks later, and just in time for Thanksgiving, the \"nutty professor\" was developed. A hit over the holidays in 2007.</div>" + 
"<br>" + 
"<div style='font-size: 7pt;color: #000;'>$40.00 per cake or box of 20 <br><a href='#'onmouseover='MouseOverShowImage(0)' onmouseout='HideOverlay()'style='font-size: 7pt;'>mini</a> - cheesecakes with <em><a href='#' onmouseover='MouseOverText(6)' onmouseout='HideOverlay()'  style='text-decoration: none;font-size: 7pt;' >natural crust</a></em></div>",

"<strong>#6 Turtle King</strong>" + 
"<br><br>" + 
"<div style='font-size: 8pt;color: #000;'>This Turtle Cake has the traditional New York - style filling surrounded by a buttery  " + 
"graham cracker crust, a layer of rich chocolate ganache filling at the bottom,  " + 
"covered with a mix of graham cracker, heath bar crunch, pecans and topped off with caramel.</div>" + 
"<br>" + 
"<div style='font-size: 7pt;color: #000;'>$40.00 per cake or box of 20 <br><a href='#'onmouseover='MouseOverShowImage(0)' onmouseout='HideOverlay()'style='font-size: 7pt;'>mini</a> - cheesecakes with original crust</div><br>" + 
"<div style='font-size: 7pt;color: #000;'>$43.00 per cake or box of 20 <br><a href='#'onmouseover='MouseOverShowImage(0)' onmouseout='HideOverlay()'style='font-size: 7pt;'>mini</a> - cheesecakes with <em><a href='#' onmouseover='MouseOverText(6)' onmouseout='HideOverlay()'  style='text-decoration: none;font-size: 7pt;' >natural crust</a></em></div>"];

var lastImageSelect = -1 ;
var opacityVal = .6 ;


function MouseOverText( newText ) {
    ShowOverlay( 0, 0, prodTitle[ newText ] ) ;
}

function MouseOverShowImage(imageIdx) {
    ShowOverlay( 1, imgMinniArray[imageIdx], "Metropolitan and Choocolate Manhattan Mini's Shown" ) ;
}

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 swapImage( newImage ) {



    if (lastImageSelect != newImage) {

//   alert(lastImageSelect);
//   alert(newImage);

        document.leftImage.src = imgArray[ newImage ] ;

        document.getElementById(imgThmIDs[ newImage ]).style.opacity = (100/opacityVal) ;
        document.getElementById(imgThmIDs[ newImage ]).style.MozOpacity = opacityVal ;
        document.getElementById(imgThmIDs[ newImage ]).style.filter = 'alpha(opacity=' + (100 *opacityVal) + ')';

        if (lastImageSelect >= 0) {
            document.getElementById(imgThmIDs[ lastImageSelect ]).style.opacity = 100;
            document.getElementById(imgThmIDs[ lastImageSelect ]).style.MozOpacity = 1.00;
            document.getElementById(imgThmIDs[ lastImageSelect ]).style.filter = 'alpha(opacity=' + 100 + ')';
        }

        lastImageSelect = newImage ;

        document.getElementById("productDescription").innerHTML = prodDesc[ newImage ]  ;

//        alert(prodDesc[ newImage ]) ;

    }
}

function OpacThum( thisThum ) {
    document.getElementById(thisThum).style.opacity = (100/opacityVal) ;
    document.getElementById(thisThum).style.MozOpacity = opacityVal ;
    document.getElementById(thisThum).style.filter = 'alpha(opacity=' + (100 *opacityVal) + ')';
    lastImageSelect = 0 ; 
}

window.onload = function() {

    document.leftImage.src = imgArray[ 0 ] ;
    document.getElementById("productDescription").innerHTML = prodDesc[ 0 ]  ;
    OpacThum("thm_A") ;

    imageObj = new Image() ;

    // Preload images
    for (i=0; i< imgArray.length; i++) {
        imageObj.src = imgArray[i] ;
    }

    
}
