$(window).resize(function(){
    footer();
});
$(document).ready(function() {

$('.level_1 li').hover(function(){
        $(this).addClass('over');
    }, function(){
        $(this).removeClass('over');
    });
$('.level_2 li').hover(function(){
        $(this).addClass('over');
    }, function(){
        $(this).removeClass('over');
    });

footer();
setTimeout(function(){
    $("a[rel=fancy_group]").fancybox({
        'transitionIn'	:	'fade',
        'transitionOut'	:	'fade',
        'speedIn'	:	600,
        'speedOut'	:       200,
        'width'         :       640,
        'height'        :       480,
        'overlayShow'	:	true,
        'overlayOpacity':       '0.8',
        'overlayColor'  :       '#333',
        'titleShow'     :       false,
        'type'          :       'image'

    });
    },0);
});

function footer(){
    var win = $(window).height();
    $('#footer_fix').hide();
    var other = $('#not_footer').height()+243;
    if(other < win)
    {
        $('#footer_fix').css('height', (win-other)+'px');
        $('#footer_fix').show();
    }
}

function add_product_to_cart(t_id,lang,title_0,title_1,close){
    var aurl = '/site/extra/add_to_cart.'+lang+'.html';
    $.ajax({
        url: aurl,
        async: false,
        dataType: "json",
        type: "POST",
        data: "t_id="+t_id,
        success: function(data) {
            if(data.type=='error'){
                s='<p>'+data.msg+'</p>';
                new Boxy(s,{title:title_0,closeText:close,
        afterShow: function() {
           var self = this;
           setTimeout(function() { self.hide(); }, 3000);
        }});
                $('.title-bar').css('background-color','#dd2122');
            }
            else{
                s='<p>'+data.msg+'</p>';
                new Boxy(s,{title:title_1,closeText:close,
        afterShow: function() {
           var self = this;
           setTimeout(function() { self.hide(); }, 3000);
        }});
                $('#choping_cart_cont').load('/site/extra/show_s_cart.'+lang+'.html');
            }
        }
    });
}




