﻿jQuery(document).ready(function() {

//Show Banner

//Comment because this project request cover
jQuery(".main_image .desc").hide(); //Hide Banner
//Comment because this project request cover

// ####### Original #######
//jQuery(".main_image .desc").show(); //Show Banner
// ####### Original #######

jQuery(".main_image .block").animate({ opacity: 0.85 }, 1); //Set Opacity

//Click and Hover events for thumbnail list

//Comment because this project request cover
//jQuery(".image_thumb ul li:first").addClass('active');
//Comment because this project request cover

jQuery(".image_thumb ul li").click(function() {
        //Set Variables
var imgAlt = jQuery(this).find('img').attr("alt"); //Get Alt Tag of Image

       //Comment because this project request cover
        var imgHref = jQuery(this).find('a').attr("id"); //Get Main Image URL
        //Comment because this project request cover

        var imgTitle = jQuery(this).find('a').attr("href"); //Get Main Image URL        
        var imgDesc = jQuery(this).find('.block').html(); 	//Get HTML of block
        var imgDescHeight = jQuery(".main_image").find('.block').height(); //Calculate height of block

        if (jQuery(this).is(".active")) {  //If it's already active, then...
            return false; // Don't click through
        } else {
            //Animate the Teaser
        jQuery(".main_image .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 250, function() {
        jQuery(".main_image .block").html(imgDesc).animate({ opacity: 0.85, marginBottom: "0" }, 250);

        //Comment because this project request cover
        jQuery(".main_image a.main").attr({ href: imgHref, title: imgAlt });
        //Comment because this project request cover
        
        jQuery(".main_image img").attr({ src: imgTitle, alt: imgAlt, title: imgAlt });

        //Comment because this project request cover
        jQuery(".main_image .desc").show(); //Show Banner
        //Comment because this project request cover
        
            });
        }

        jQuery(".image_thumb ul li").removeClass('active'); //Remove class of 'active' on all lists
        jQuery(this).addClass('active');  //add class of 'active' on this list only
        return false;

    }).hover(function() {
    jQuery(this).addClass('hover');
    }, function() {
    jQuery(this).removeClass('hover');
    });

    //Toggle Teaser
    jQuery("a.collapse").click(function() {

    //Comment because this project request cover
    jQuery(".main_image img").attr({ src: "FrontUc/Event/Images/cover.jpg", alt: "K Village" });
    jQuery(".main_image .desc").hide(); //Show Banner
    jQuery(".image_thumb ul li").removeClass('active'); //Remove class of 'active' on all lists
    //Comment because this project request cover
    
    // ####### Original #######
    // jQuery(".main_image .block").slideToggle();
    // jQuery("a.collapse").toggleClass("show");
    // ####### Original #######
   
    });

}); //Close Function

var idx = 0;
GoDown = function(sign) {
    var maxBox = 4;
    var cond;
    var liLen = jQuery(".image_thumb ul li").length;
    var UlObj = jQuery(".image_thumb ul");

    if (liLen > maxBox) {
        if (sign == '1') {
            if (liLen - idx > maxBox) {
                idx += 1;
            }
        }
        else {
            if (idx > 0) {
                idx -= 1;
            }
        }

        UlObj.animate({ marginTop: "-" + (idx * 72) + 'px' });
    }
}



function CallEventCss() {
    var sty;

   
         sty = '<link href="FrontUc/Event/css/StyleSheet.css" rel="stylesheet" type="text/css" />';             
               
  
    document.write(sty) ;
}


 
