/*Slideshow_script*/
function slideSwitch() {
	$("#slideshow div").css("display","block");
    var $active = $('#slideshow div.active');
    if ( $active.length == 0 ) $active = $('#slideshow div:last');
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow div:first');
    // uncomment the 3 lines below to pull the images in random order
     var $sibs  = $active.siblings();
     var rndNum = Math.floor(Math.random() * $sibs.length );
     var $next  = $( $sibs[ rndNum ] );
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

function fixHeight(){
	if($('#bigImage').length > 0){
		var hh1 = $('#product_title').height();
		var hh2 = $('#product_content .price:first').length > 0 ? $('#product_content .price:first').height() : 0;
		//var h3 = $('#addthis').height();
		var hh4 = $('#product_text').height();
		var total = $('#bigImage').height();
		if((hh1 + hh2 + hh4) < total){
			$('#product_text').height(total - (hh1 + hh2 + 34));
		}
	}
}
$(window).load(function(){
	fixHeight();
})

$(document).ready(function(){
$(function() {setInterval( "slideSwitch()", 3000 );});
});
