

(function($){











})(window.jQuery);



window.log = function(){
    log.history = log.history || [];
    log.history.push(arguments);
    if (this.console) {
        console.log(Array.prototype.slice.call(arguments));
    }
};

(function(doc){
    var write = doc.write;
    doc.write = function(q){
        log('document.write(): ', arguments);
        if (/docwriteregexwhitelist/.test(q)) 
            write.apply(doc, arguments);
    };
})(document);

$(document).ready(function(){
    $('.SITE .home-fade').hide();
	$('.hg').hide();
    $('.SITE .home-loder').show();
	
    $(".mt-table tbody tr:odd td").addClass('odd');
    $('a.fancyimage').fancybox({
        'zoomSpeedIn': 300,
        'zoomSpeedOut': 300,
        'overlayShow': true,
        'zoomOpacity': true,
        'overlayOpacity': 0.8
    });
	$('#right-id.cardiotemp a.fancyimage').fancybox({
        'zoomSpeedIn': 300,
        'zoomSpeedOut': 300,
        'overlayShow': true,
        'zoomOpacity': true,
        'overlayOpacity': 0.8,
		'titlePosition'	: 'inside',
		'titleFormat' : 'formatTitle'
    });
	
	
    /*
     $(function() {
     $(".section-icon img")
     .mouseover(function() {
     
     var src = $(this).attr("src").replace("icon=Y", "thumb=Y");
     $(this).attr("src", src);
     })
     .mouseout(function() {
     var src = $(this).attr("src").replace("thumb=Y", "icon=Y");
     $(this).attr("src", src);
     });
     });
     */
});



$(window).load(function(){

    setTimeout(function(){
        $('.home-loader').hide();
    }, 2200);
    setTimeout(function(){
        $('.SITE .home-fade').show();
    }, 2200);
	    setTimeout(function(){
        $('.hg').show();
    }, 2200);
	
    $('.hg').cycle({
     fx: 'fade',
     timeout: 2500,
     speed: 2500
     })
	 
	 $('.cg').cycle({
     fx: 'fade',
     timeout: 2500,
     speed: 2500
     })
    
    /*$('.home-fade-padding').cycle({
     fx: 'fade',
     timeout: 2500,
     speed: 2500,
     cleartype: true,
     cleartypeNoBg: true
     });*/
    /*$('.home-fade-padding').nivoSlider({
     effect:'fold', //Specify sets like: 'fold,fade,sliceDown'
     slices:15,
     animSpeed:500, //Slide transition speed
     pauseTime:3000,
     startSlide:0, //Set starting Slide (0 index)
     directionNav:false, //Next & Prev
     directionNavHide:true, //Only show on hover
     controlNav:true, //1,2,3...
     controlNavThumbs:false, //Use thumbnails for Control Nav
     controlNavThumbsFromRel:false, //Use image rel for thumbs
     controlNavThumbsSearch: '.jpg', //Replace this with...
     controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
     keyboardNav:false, //Use left & right arrows
     pauseOnHover:true, //Stop animation while hovering
     manualAdvance:true, //Force manual transitions
     captionOpacity:0.8, //Universal caption opacity
     beforeChange: function(){},
     afterChange: function(){},
     slideshowEnd: function(){} //Triggers after all slides have been shown
     });*/
    // Hide all large images except the first one
/*    $('.home-fade img').hide();
    $('.home-fade img:first').show();
    // Select all thumb links
    $('.left-menu a').hover(function(event){
    
        // Hide all large images except for the one with the same hash as our thumb link
        $('.home-fade img').hide();
        $('.left-menu a').removeClass('selected');
        var toShow = $(this).attr('rel');
        $('#' + toShow).show();
        $(this).addClass('selected');
    }, function(){
    } // Because the hover method has a mouseout state we need to define too
);
 */

$('.descr').hide();
$('.descr:first').show();
$('#thumbs img').click(function(){
	
	$('.descr').hide();
	$('#large-image img').attr('src',$(this).attr('src').replace('&thumb=Y','&showFullSize=Y'));
	var divToShow = $(this).attr('id');
	$('#'+divToShow).show();
});

    
    
    
});


