﻿jQuery.noConflict();

// swap classes on all sliders
jQuery(document).ready(function() {

    //Zoom Quick Link Images on Hover
    jQuery(".quickLinkImage").tooltip({
        delay: 0,
        showURL: false,
        track: true,
        fixPNG: true,
        extraClass: "qlTooltip",
        bodyHandler: function () {

            //Get Location of Zoom Image
            var endPoint = this.src.lastIndexOf(".");
            var imageLoc = this.src.substring(0, endPoint);
            imageLoc = imageLoc + "_large.jpg";

            return jQuery("<img/>").attr("src", imageLoc);

        }
    });

    //Zoom Special Offer Images on Hover
    jQuery(".offerImage").tooltip({ 
        delay: 0,
        showURL: false, 
        track: true,
        fixPNG: true,
        bodyHandler: function() {
            
            //Get Location of Zoom Image
            var endPoint = this.src.lastIndexOf("_");            
            var imageLoc = this.src.substring(0,endPoint);
            imageLoc = imageLoc + ".jpg";
            
            return jQuery("<img/>").attr("src", imageLoc); 
            
        } 
    });
    
    //Make Whole Offer Box Clickable
    jQuery(".offer").click(function() {
        window.location.href = jQuery(this).find("a.moreInfo").attr("href");
    });
    
    //Set Up Self Serve Hover Reveal  
    
    jQuery(".selfServe").hoverIntent({
				over: makeTall, 
				timeout: 100, 
				out: makeShort
			});

    function makeTall(){  jQuery(".ssFeatures").slideDown("fast");}
	function makeShort(){ jQuery(".ssFeatures").slideUp("fast");}

      
//    jQuery(".selfServe").hover(
//      function () {
//        jQuery(".ssFeatures").slideDown("fast");
//      },
//      function () {
//        jQuery(".ssFeatures").slideUp("fast");
//      }
//    );
    
    //Make Whole Offer Box Clickable
    jQuery(".newWindow").click(function() {
        window.open(this.href);
        return false;
    });
    
    //Make All Category Columns Equal in Height
    var cat1Height = jQuery(".categoryCol1 ul").height();
    var cat2Height = jQuery(".categoryCol2 ul").height();
    var cat3Height = jQuery(".categoryCol3 ul").height();
    var maxHeight = cat1Height;
    
    if (cat2Height > maxHeight)
    {
        maxHeight = cat2Height;
    }
    
    if (cat3Height > maxHeight)
    {
        maxHeight = cat3Height;
    }
    

    jQuery(".categoryCol ul").height(maxHeight);
    
});
          
