$(document).ready(function(){
    $('.toValidate').validate();
	
	$("a.thickbox").fancybox({
		'zoomSpeedIn': 300, 
		'zoomSpeedOut':	300, 
		'overlayShow': true,
		'zoomOpacity': true,
		'overlayOpacity': 0.8
	});
	
	// Hide all large images except the first one
        $('.imageContainer img').hide();
		$('.imageContainer img:first').show();
        // Select all thumb links
        $('.linkContainer a').hover(function(event) {

                // Hide all large images except for the one with the same hash as our thumb link
                $('.imageContainer img').hide();
				$('.linkContainer 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
        );


	$('#home-fade').hide();
	$('#lang-menu li:first').addClass('first-item');
	
});

$(window).load(function(){
	$('#home-fade').fadeIn();
    $('.wrapper .xt-multimediacontents-wrapper').cycle({
        fx: 'fade',
        timeout: 1500,
        speed: 3000
    });
      

	
	
	var ph = $('#product-content').height();
    if (ph <= 450) {
        $('.PRODUCT div#product-content').height(450);
		$('.PRODUCT div#footer').css({'margin-top':'0px'})
    } 
	
	var ph = $('#product-content').height();
	// alert('content:'+ph);
	var pl = $('#left-menu').height();
	// alert('left-menu:'+pl);
    if (ph <= pl) {
        $('div#product-content').height(pl-30);
		$('div#footer').css({'margin-top':'0px'})
    } 
	
		// Hide all large images except the first one
        $('.selection-descr').hide();
		$('.selection-descr:first').show();
        // Select all thumb links
        $('.selection a').hover(function(event) {
                // Hide all large images except for the one with the same hash as our thumb link
                $('.selection-descr').hide();
				$('.selection a').removeClass('selected');
				var toShow= $(this).attr('rel');
				
				
				$('div#'+toShow).show();
				$(this).addClass('selected');
            },
            function () {} // Because the hover method has a mouseout state we need to define too
        );
		  var sh = $('div#section-content').height();
    if (sh <= 455) {
        $('.SECTION div#section-content').height(450);
		$('.SECTION div#footer').css({'margin-top':'0px'})
    } 

});

