$(document).ready(function(){



    $('#left-menu-loader').show();
    $('#home-loader').show();
    
    $('#bookmark2').css({
        height: '300'
    });
    $('#foot').hide();
    $('.images').hide();
    $('#bookmark2').show();
    $('#left-menu-bookmark').show();
    
    $('#left-foot-content').hide();
    $('#foot').hide();
    $('.prod-title:first').addClass('selected first');
    $('.prod-title:last').addClass('last');
    $('.li-selected span').addClass('selected');
    $('li.last-item span').addClass('last');
    $("ul.sf-menu").superfish({
        pathClass: 'current'
    });
    $('ul.sf-menu').addClass('sf-navbar');
	
	
});



$(window).load(function(){

    $('#bookmark').hide();
    $('#bookmark2').hide();
    $('#home-fade .xt-multimediacontents-wrapper').cycle({
        fx: 'fade',
        timeout: 1500,
        speed: 3000
    });
    $('#the-left-menu').accordion({
        header: 'p.p-level-2',
        navigation: true,
        active: true,
        event: 'click',
        autoheight: false,
        active: '.in-path'
    });
    $('p.p-level-2 in-path').addClass('selected');
    $('p.p-level-3 a.in-path').addClass('current');
    $('div#the-left-menu').addClass('selected');
    
    $('.images').show();
    $('.the-image:not(:first)').hide();
    $('.the-image:first').show();
    
    

    var h = $('#foot').height();
    if (h < 236) {
        $('#foot').css('height', '235');
        $('#left-foot-content').css('height', '235');
        h = $('#foot').height();
    }
    
    $('#left-foot-content').css('height', h);
    $('.prod-title').each(function(i){
        $(this).click(function(){
            var id = '.the-image:eq(' + i + ')';
            $('.prod-title').removeClass('selected');
            $('.the-image').hide();
            $(id).show();
            $(this).addClass('selected');
            return false;
        });
    });
    $('#left-foot-content').show();
    $('#foot').show();
    
    var hnews = $('#the-news').height();
    if (hnews < 645) {
        $('#the-news').height(645);
    }
    else {
        $('#left-foot-content').height(hnews - 410);
    }
    
    
    
    
    setTimeout(function(){
        $('#left-menu-loader').hide();
    }, 1100);
    setTimeout(function(){
        $('#left-menu').css({
            visibility: 'visible',
            display: 'block'
        });
    }, 1100);
    
    
    setTimeout(function(){
        $('#home-loader').hide();
    }, 1100);
    setTimeout(function(){
        $('#home-fade').css({
            visibility: 'visible',
            display: 'block'
        });
    }, 1100);
	
	
	
	var sh = $('#the-section').height();
    //alert(sh);
    if (sh < 410) {
		$('#the-section').height(410);
		
	}
	else {
		$('#the-section').css('height' , sh);
		var newsh = sh-'343';
	//	alert (newsh);
		$('#foot').css('min-height' , '0');
		$('#foot').height(newsh);
	}
    
    
});

