$(document).ready(function(){

    $("a[rel^='photo']").prettyPhoto({
        animationSpeed: 'fast', /* fast/slow/normal */
        padding: 0, /* padding for each side of the picture */
        opacity: 0.8, /* Value betwee 0 and 1 */
        showTitle: true, /* true/false */
        allowresize: true, /* true/false */
        counter_separator_label: ' ze ' /* The separator for the gallery counter 1 "of" 2 */
    });

    $('.showPersonDetails').click(function() {
        if ($('#headerBasketContent').css('display') == 'block') {
            $('#headerBasketContent').css('display', 'none')
            $('#search').css('display', 'block')
        } else {
            $('#headerBasketContent').css('display', 'block')
            $('#search').css('display', 'none')
        }
    });
    $('#in_headerBasketContent .close').click(function() {
        if ($('#headerBasketContent').css('display') == 'block') {
            $('#headerBasketContent').css('display', 'none')
            $('#search').css('display', 'block')
        } else {
            $('#headerBasketContent').css('display', 'block')
            $('#search').css('display', 'none')
        }
    });




    /**************************
        SEARCH - PO KLIKNUTI ODSTRANI TEXT
    */
    $('#sSearchText').click(function() {
        if ($(this).attr('value') == 'hledej') {
            $(this).attr("value", "")
        } else if ($(this).attr('value') == 'search') {
            $(this).attr("value", "")
        }
    }).blur(function(){
        var chooseLanguage = $("meta[http-equiv='Content-Language']").attr('content')
        if ($(this).attr('value') == '') {
            if (chooseLanguage == 'cs') {
                $(this).attr("value", "hledej")
            } else if (chooseLanguage == 'en') {
                $(this).attr("value", "search")
            }
        }
    });


    $('.showLoginInfo').click(function() {
        if ($('#basketLogin').hasClass('chooseFormContentAct') == true) {
            $(this).parent().removeClass('chooseFormHeaderAct')
            $('#basketLogin').removeClass('chooseFormContentAct')
        } else {
            $(this).parent().addClass('chooseFormHeaderAct')
            $('#basketLogin').addClass('chooseFormContentAct')
        }
    });

    $('.showCompanyInfo').click(function() {
        if ($('#basketCompany').hasClass('chooseFormContentAct') == true) {
            $(this).parent().removeClass('chooseFormHeaderAct')
            $('#basketCompany').removeClass('chooseFormContentAct')
        } else {
            $(this).parent().addClass('chooseFormHeaderAct')
            $('#basketCompany').addClass('chooseFormContentAct')
        }
    });

    $('.showAddressInfo').click(function() {
        if ($('#basketAdress').hasClass('chooseFormContentAct') == true) {
            $(this).parent().removeClass('chooseFormHeaderAct')
            $('#basketAdress').removeClass('chooseFormContentAct')
        } else {
            $(this).parent().addClass('chooseFormHeaderAct')
            $('#basketAdress').addClass('chooseFormContentAct')
        }
    });


    /**************************
        ZALOHA - SHOW / HIDE - DISTRIBUTOR & SELLERS
    */
    $('.showDistributorsItemContent').click(function() {

        var thisHref = $(this);
        var position = thisHref.position();
        var width = thisHref.width()

        thisContentID = '#contentshow' + $(this).attr('id')
        thisContentHTML = $(thisContentID).html()

        $('.in_distributorsItemContentHTML').html(thisContentHTML)

        Cufon.replace('.in_distributorsItemContentHTML h3', { fontFamily: 'ugazz' });

        $('.distributorsItemContent').css('display', 'block')
        $('.distributorsItemContent').css('left', position.left + width)
        $('.distributorsItemContent').css('top', position.top - 75)


    });
    $('.distributorsItemContentClose').click(function() {

        $('.distributorsItemContent').css('display', 'none')
        $('.in_distributorsItemContentHTML').html('')

    });



    if ($('#slider').length == 1) {
        $("#slider").easySlider({
            auto: false,
            continuous: true,
            numeric: true,
            speed: 500
        });
    };


    $('.do-noveho-okna').click(function(){
         window.open($(this).attr("href"));
         return false;
    });


    $('.blank').click(function(){
         window.open($(this).attr("href"));
         return false;
    });



    $('.addBookmark').click(function() {
        $('#bookmark').css('display', 'block')
    });
    $('.bookmarkClose').click(function() {
        $('#bookmark').css('display', 'none')
    });


    $('.showSeller a').click(function() {

        var thisHref = $(this);
        var position = thisHref.position();
        var width = thisHref.width()

        if ($(this).parent().parent().find('h3').length == '1') {
            thisContentHTML = $(this).parent().parent().find('div').html()
        } else {
            thisContentHTML = $(this).parent().find('div').html()
        }

        $('.in_distributorsItemContentHTML').html(thisContentHTML)

        Cufon.replace('.in_distributorsItemContentHTML h3', { fontFamily: 'ugazz' });

        $('.distributorsItemContent').css('display', 'block')
        $('.distributorsItemContent').css('left', position.left + width)
        $('.distributorsItemContent').css('top', position.top - 75)

    });
    $('.distributorsItemContentClose').click(function() {

        $('.distributorsItemContent').css('display', 'none')
        $('.in_distributorsItemContentHTML').html('')

    });



    $('#contentFotogaleryHome').css('left', ($(window).width()/2) - 350)

    if ($('#fotogaleryHome').length == 1) {

        var chooseLanguage = $("meta[http-equiv='Content-Language']").attr('content')

        $('#fotogaleryHome li a:first').addClass('act');

        /**************************
            TITULNI STRANKA - NACITANI OBRAZKU
        */
        var i = 1;
        imageObj = new Image();
        images = new Array();
        for(i=1; i<=3; i++) {

            images[i]="/wp-content/themes/tendon/img/featured/i" + [i] + ".jpg"

        }

        for(i=1; i<=3; i++) {
            imageObj.src=images[i];
        }


        /**************************
            TITULNI STRANKA - PROLINANI OBRAZKU
        */
        $('#fotogaleryHome li a').click(function() {

            thisIMG = $(this).attr('id');
            thisID = '#webHomeItem' + thisIMG.substring(11, 12)

            if ($(this).hasClass('act') == false) {

                $('#webHome').animate({
                    opacity: 0.0
                }, 500, function() {
                    $(this).css('background', 'url(' + images[thisIMG.substring(11, 12)] + ') center top no-repeat');
                    $('.webHomeItem').css('display', 'none')
                    $(thisID).css('display', 'block')
                });

                $('#webHome').animate({
                    opacity: 1.0
                }, 1000);

            }

            $('#fotogaleryHome li a').removeClass('act');
            $(this).addClass('act');

            return false;

        });

    }


    $('#articlePhotoSliderUL').jcarousel({
        scroll: 2
    });

    if ($('#articlePhotoSlider .jcarousel-item').length <= 3) {
        $('.jcarousel-prev-disabled').css('display', 'none')
        $('.jcarousel-next-disabled').css('display', 'none')
    }


    $('#chooseLanguage').selectbox();


    $('.departmentClimbContentItem h2').mouseover(function(){

        $(this).parents('.departmentClimbContentItem:first').css('zIndex', '50');
        return false;
    });

    $('.departmentClimbContentItem h2').mouseout(function(){

        $(this).parents('.departmentClimbContentItem:first').css('zIndex', '');
        return false;
    });



    $('#treeContent ul li.firstItem h2').click(function() {

        $(this).siblings().toggle("normal")

    });







    /**************************
        LIGHTBOX
        AJAXEM NACITANI FORMULARE PRO POSLANI KAMARADOVI
    */
    $('.lightBoxFriendForm').click(function() {

        thisHref = $(this).attr('rel')
        thisGoods = thisHref.indexOf('?')
        ajaxHref = "/friend-ajax" + thisHref.substring(thisGoods)

        $.post(
            ajaxHref,
            {},
            function(data){

                $("#lightBoxContactFormBg").html(data);

                $('#overlay').css('width', $(window).width())
                $('#overlay').css('height', $('#web').height() + $('#footer').height())
                $('#overlay').css('display', 'block')
                $('#lightBoxContactForm').css('display', 'block')
                $('.contactH2').css('display', 'block')
                $('.friendH2').css('display', 'none')

                $('#lightBoxContactForm').css('left', ($(window).width()/2) - 385)
                positionTop = (($(window).scrollTop() + 100) + "px")
                positionTop2 = (($(window).scrollTop() + 200) + "px")


                Cufon.replace('#lightBoxContactFormBg label', { fontFamily: 'ugazz' });
                Cufon.replace('#lightBoxContactFormBg span.h2', { fontFamily: 'ugazz', textShadow: '#000 5px 5px' });

                setTimeout(function() {

                    $("#lightBoxContactForm").animate({
                        top: positionTop2
                    })
                    .animate({
                        top: positionTop
                    }, "normal");

                }, 500);

            }
        );

        return false;

    });



    /**************************
        LIGHTBOX
        AJAXEM NACITANI FORMULARE PRO KONTAKTNI FORMULAR V KONTAKTECH
    */
    $('.showContactArticle').click(function() {

        thisHrefRel = $(this).attr('rel')

        thisHrefRelSeparator = thisHrefRel.indexOf('-')
        thisHrefRelID = thisHrefRel.substring(0, thisHrefRelSeparator)
        thisHrefRelName = thisHrefRel.substring(thisHrefRelSeparator + 1)

        ajaxHref = "/contact-web-ajax" + "?article=" + thisHrefRelID

        $.post(
            ajaxHref,
            {},
            function(data){

                $("#lightBoxContactFormBg").html(data);

                $('#overlay').css('width', $(window).width())
                $('#overlay').css('height', $('#web').height() + $('#footer').height())
                $('#overlay').css('display', 'block')
                $('#lightBoxContactForm').css('display', 'block')
                $('.contactH2').css('display', 'block')
                $('.friendH2').css('display', 'none')

                $('#lightBoxContactForm').css('left', ($(window).width()/2) - 385)
                positionTop = (($(window).scrollTop() + 100) + "px")
                positionTop2 = (($(window).scrollTop() + 200) + "px")


                Cufon.replace('#lightBoxContactFormBg label', { fontFamily: 'ugazz' });
                Cufon.replace('#lightBoxContactFormBg span.h2', { fontFamily: 'ugazz', textShadow: '#000 5px 5px' });

                setTimeout(function() {

                    $("#lightBoxContactForm").animate({
                        top: positionTop2
                    })
                    .animate({
                        top: positionTop
                    }, "normal");

                }, 500);

            }
        );

        return false;

    });



    /**************************
        LIGHTBOX - CLOSE
        CONTACT FORM
    */
    $('#lightBoxContactForm .lightBoxContactFormClose').click(function() {

        $('#overlay').css('display', 'none')
        $('#lightBoxContactForm').css('display', 'none')
        $('#lightBoxContactForm').css('top', '-1000px')
        $("#lightBoxContactFormBg").html('');

    });


    /**************************
        LANGUAGE
        CHOOSE LANGUAGE
    */
    $('#chooseLanguage_container li').click(function() {

        var language = $(this).attr('id')
        languageHref = language.substring(21, 23)

        if (languageHref == 'cs') {
            window.open("http://www.mytendon.cz/", "_self")
        } else if (languageHref == 'en') {
            window.open("http://www.mytendon.com/", "_self")
        } else {
            window.open("http://web.mytendon.com/" + languageHref + "/", "_self")
        }

    })



    /**************************
        SELLERS
        VYBER DISTRIBUTORI Vs. PRODEJNY
    */
    $('#googleMapsHeader a').click(function() {

        $('#googleMapsHeader a').removeClass('act')

        $(this).addClass('act')
        $(this).parent().parent().parent().parent().removeClass()
        $(this).parent().parent().parent().parent().addClass($(this).parent().parent().attr('class') + 'GoogleMapsHeader')

        $('#list1').css('display', 'none')
        $('#list2').css('display', 'none')
        $('#list3').css('display', 'none')

        showList = '#list' + $(this).attr('rel')
        $(showList).css('display', 'block')

        $('.distributorsItemContent').css('display', 'none')
        $('.in_distributorsItemContentHTML').html('')

        loadGoogleMap($(this).attr('rel'))

        Cufon.replace('#googleMapsHeader ul li h2 a', { fontFamily: 'ugazz', hover: true, textShadow: '#000 4px 4px' });

        return false;

    });


    /**************************
        SELLERS
        VYBER ZOBRAZENI MAPA Vs. VYPIS
    */
    $('#googleMapsContent input[name="chooseTyp"]').click(function() {

        showTyp = $(this).attr('value')

        if (showTyp == 'list' && $('#googleMapsContent #list').css('display') == 'none') {

            $('#googleMapsContent #maps').css('display', 'none')
            $('#googleMapsContent #list').css('display', 'block')

        } else if (showTyp == 'maps' && $('#googleMapsContent #maps').css('display') == 'none') {

            $('#googleMapsContent #list').css('display', 'none')
            $('#googleMapsContent #maps').css('display', 'block')
            $('.distributorsItemContent').css('display', 'none')

            loadGoogleMap($('#googleMapsHeader a[class*="act"]').attr('rel'))

        }

    });


    /**************************
        VYBER POCTU METRU NA DETIALU PRODUKTU
    */
    $('#basket_Item').click(function() {
        if ($(this).attr('value') == 'Zadejte') {
            $(this).attr("value", "")
        }
        $(this).attr("maxlength", 3)
    }).blur(function(){
        if ($(this).attr('value') == '') {
            $(this).attr("maxlength", 7)
            $(this).attr("value", "Zadejte")
        }
    });


});



function loadGoogleMap(rel){
    if (rel == '1') {
        load('1')
    } else if (rel == '2') {
        load('2')
    } else if (rel == '3') {
        load('3')
    }
}


function showMap(gpsx, gpsy, id){

    $('#googleMapsContent #list').css('display', 'none')
    $('#googleMapsContent #maps').css('display', 'block')
    $('.distributorsItemContent').css('display', 'none')

    $('#chooseList').removeAttr('checked')
    $('#chooseMaps').attr('checked', 'checked')

    loadGoogleMap(id)
    ViewCompanyInMap(gpsx, gpsy, id)

}


/**************************
    SEND AJAX FRIEND FORM
    AJAXEM ODESLANI - POSLAT ZNAMEMU
*/
function sendFriendForm(sender, args) {

    // ziskani nadrazeneho formulare
    var form1 = $(sender).parents('form:first').get(0);

    $.post(
        "/friend-ajax",
        $(form1).find(":input").serializeArray(),
        function(data){

            $("#lightBoxContactFormBg").html(data);

            Cufon.replace('#lightBoxContactFormBg label, #lightBoxContactFormBg .error', { fontFamily: 'ugazz' });
            Cufon.replace('#lightBoxContactFormBg span.h2', { fontFamily: 'ugazz', textShadow: '#000 5px 5px' });
            Cufon.replace('#lightBoxContactFormBg .lightBoxFriendForm', { fontFamily: 'ugazz', hover: true });


            $('#lightBoxContactFormBg .lightBoxFriendForm').click(function() {

                thisHref = $(this).attr('rel')
                thisGoods = thisHref.indexOf('?')
                ajaxHref = "/friend-ajax" + thisHref.substring(thisGoods)

                $.post(
                    ajaxHref,
                    {},
                    function(data){

                        $("#lightBoxContactFormBg").html(data);

                        Cufon.replace('#lightBoxContactFormBg label', { fontFamily: 'ugazz' });
                        Cufon.replace('#lightBoxContactFormBg span.h2', { fontFamily: 'ugazz', textShadow: '#000 5px 5px' });

                    }
                );

                return false;

            });

        }
    );

    return false;

}




/**************************
    SEND AJAX FORM
    AJAXEM ODESLANI KONTAKTNIHO FORMULARE V KONTAKTECH
*/
function sendContactWebForm(sender, args) {

    // ziskani nadrazeneho formulare
    var form1 = $(sender).parents('form:first').get(0);

    $.post(
        "/contact-web-ajax",
        $(form1).find(":input").serializeArray(),
        function(data){

            $("#lightBoxContactFormBg").html(data);

            Cufon.replace('#lightBoxContactFormBg label, #lightBoxContactFormBg .error', { fontFamily: 'ugazz' });
            Cufon.replace('#lightBoxContactFormBg span.h2', { fontFamily: 'ugazz', textShadow: '#000 5px 5px' });
            Cufon.replace('#lightBoxContactFormBg .lightBoxFriendForm', { fontFamily: 'ugazz', hover: true });
        }
    );

    return false;

}



function noveOkno(sender, args){
     window.open($(sender).attr("href"));
     return false;
};


function fbs_click(href, title) {
    u = href;
    t = title;
    window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&amp;t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
    return false;
}

function goPage(sender, args) {
    if (sender)
    {
        newLocationHash = ''
        if(sender.href.indexOf('#') > 0)
            newLocationHash = sender.href.substring(sender.href.indexOf('#'))

        document.location.hash = newLocationHash;
    }

    createPaging();
}



/**************************
    LANGUAGE
    ZJISTENI JAZYKA
*/
var languageAbbreviation = $("meta[http-equiv='Content-Language']").attr('content')

    if (languageAbbreviation == 'cs') {
        languagePrev = 'předchozí'
        languageNext = 'další'
    } else {
        languagePrev = 'previous'
        languageNext = 'next'
    }



var savedHash = window.location.hash;
var hashTimer = null;

function createPaging(locationHash) {

    var pagecount = paging_457;
    //alert($("div[id^='page']").length); // je o jeden větší (id="page")

    if (!locationHash)
        locationHash = document.location.hash;

    var actualpage = 1;

    var preffixIndex = locationHash.indexOf("#p-");
    if(preffixIndex != -1)
        actualpage = locationHash.substring(preffixIndex + 3);

    previouspage = Math.abs(actualpage) - 1;
    nextpage = Math.abs(actualpage) + 1;

    paginationbox = ''
    if(actualpage > 1) {
        if(previouspage == 1)
            paginationbox = "<a class=\"left left" + languageAbbreviation + "\" href=\"#\" onclick=\"goPage(this, {'event':event, 'pagecount': " + pagecount + ", 'page': 1}); return false;\">" + languagePrev + "</a> ";
        else
            paginationbox = "<a class=\"left left" + languageAbbreviation + "\" href=\"#p-"+previouspage +"\" onclick=\"goPage(this, {'event':event, 'pagecount': " + pagecount + ", 'page': " + previouspage +"}); return false;\">" + languagePrev + "</a> ";
    }

    paginationbox += '<span>' + actualpage + ' / ' + pagecount + '</span>';

    if(actualpage != pagecount)
        paginationbox += " <a class=\"right right" + languageAbbreviation + "\" href=\"#p-"+nextpage +"\" onclick=\"goPage(this, {'event':event, 'pagecount': " + pagecount + ", 'page': " + nextpage + "}); return false;\">" + languageNext + "</a> ";


    $("#pagination").html(paginationbox)

    $("#in_leftcolContent .page").each(function(i, pages) {
        $(pages).css('display', 'none')
    });

    $("#page"+actualpage).css('display', 'block')

    if(actualpage != 1) {
        $(window).scrollTop(310)
    }

    Cufon.replace('#pagination span', { fontFamily: 'ugazz' });

    if(hashTimer == null)
    {
        hashTimer = window.setInterval(function() {
                if(savedHash != window.location.hash) {
                    savedHash = window.location.hash;
                    createPaging();
                }
            },200);
    }
}







/**************************
    BASKET
*/
$(document).ready(function() {

    $('#basketContent input[type=radio]').prettyCheckboxes();
    $('#webBasket input[type=checkbox]').prettyCheckboxes();

    $('.showcreateFriendOrder').click(function (){
        $('.createFriendOrderBox').toggle()
    });


    /*
    $('.choosePayment').click(function() {
        $('.contentBasketText div[class*="choosePaymentAct"]').removeClass('choosePaymentAct');
        if ($(this).hasClass('chooseTransportDisabled') != true) {
            $(this).addClass('choosePaymentAct')
            $(this).find('input').attr('checked', 'checked')
        }
    });
    */

    $("#chooseTransportContent label").click(function() {
        $('#chooseTransportContent div[class*="choosePaymentAct"]').removeClass('choosePaymentAct');
        if ($(this).parent().parent().parent().parent().parent().parent().parent().hasClass('chooseTransportDisabled') != true) {
            $(this).parent().parent().parent().parent().parent().parent().parent().addClass('choosePaymentAct')
        }
    });

    $("#choosePaymentContent label").click(function() {
        $('#choosePaymentContent div[class*="choosePaymentAct"]').removeClass('choosePaymentAct');
        if ($(this).parent().parent().parent().parent().parent().parent().parent().hasClass('chooseTransportDisabled') != true) {
            $(this).parent().parent().parent().parent().parent().parent().parent().addClass('choosePaymentAct')
        }
    });


    $("#chooseTransportContent input:radio[id^='basket_Transfer']").click(refreshTransportAndPayment = function(){

        $("#choosePaymentContent input:radio[id^='basket_Payment']").removeAttr('checked')
        $('#choosePaymentContent .chooseTransport').hide()
        $('#choosePaymentContent .chooseTransport').removeClass('choosePaymentAct')
        $('#choosePaymentContent .chooseTransport').find('label').removeClass('checked')

        var thisID
        $("#chooseTransportContent input:radio[id^='basket_Transfer']").each(function(i, val) {
            if ($(this).attr('checked') == true) {
                thisID = $(this).attr('id')
            }
        });

        if (thisID == 'basket_Transfer1') {

            $('#chooseTransportContent #chooseTransport-1').addClass('choosePaymentAct')

            $('#choosePaymentContent .chooseTransport-1').show()
            $('#choosePaymentContent .chooseTransport-2').show()
        } else if (thisID == 'basket_Transfer2') {

            $('#chooseTransportContent #chooseTransport-2').addClass('choosePaymentAct')

            $('#choosePaymentContent .chooseTransport-3').show()
            $('#choosePaymentContent .chooseTransport-4').show()
        } else if (thisID == 'basket_Transfer3') {

            $('#chooseTransportContent #chooseTransport-3').addClass('choosePaymentAct')

            $('#choosePaymentContent .chooseTransport-5').show()
        } else if (thisID == 'basket_Transfer5') {

            $('#chooseTransportContent #chooseTransport-4').addClass('choosePaymentAct')

            $('#choosePaymentContent .chooseTransport-6').show()
        } else {

            $('#chooseTransportContent #chooseTransport-1').find('input').attr('checked', 'checked')
            $('#chooseTransportContent #chooseTransport-1').find('label').addClass('checked')

            $('#chooseTransportContent #chooseTransport-1').addClass('choosePaymentAct')

            $('#choosePaymentContent .chooseTransport-1').show()
            $('#choosePaymentContent .chooseTransport-2').show()
        }

    });


    /*
    ODESLANI FORMU AHREF ODKAZEM
    */
    $('#basketContentSubmit').click(function() {
        $('#basketForm').submit()
    });

    $('#loginSubmit').click(function() {
        $('#loginForm').submit()
    });

    $('#sendPassword').click(function() {
        $('form').submit()
    });

    $('#registrationSubmit').click(function() {
        $('#orderForm').submit()
    });

    $('#changepasswordSubmit').click(function() {
        $('#passwordForm').submit()
    });

    /*
    $('input').keypress(function(e){
        if(e.which == 13){
            $('form').submit()
        }
    });
    */

    $('.deleteItem').click(function() {

        deleteItemName = $(this).attr('rel')
        $(this).parent().find('input').attr('name', 'basket_Remove[' + deleteItemName + ']')
        $('form').submit()

    });




    $('.orderContentSubmit').click(function() {
        /*
        friendInfo = $('#friendInfo').val()
        basketMessage = $('#basket_Message').val()

        if (friendInfo != '') {
            $('#basket_Message').val(friendInfo + '|||' + basketMessage)
        }
        */

        $('#orderForm').submit()

    });

    /*
    if ($('#createFriendOrder').length == 1) {

        basketMessage = $('#basket_Message').val()

        if (basketMessage.indexOf('|||') != -1) {

            friendInfo = basketMessage.substring(0, basketMessage.indexOf('|||'))
            basketMessage = basketMessage.substring(basketMessage.indexOf('|||') + 3)

            $('#friendInfo').val(friendInfo)
            $('#basket_Message').val(basketMessage)

        }

    }
    */


});



function controlBasketItemValue() {
    if ($('#basket_Item').attr('value') == "Zadejte") {
        $('#basket_Item').attr('value', 1)
    }
    return true;
}






function UpdateBasket(sender, type) {
    // ziskani nadrazeneho formulare
    var form1 = $(sender).parents('form:first').get(0);
    $.post(
        "/ajax-basket",
        $(form1).find("input").serializeArray(),
        function(data){
            $.get(
                "/ajax-basket-header",
                function(data){
                    $("#headerBasket").html(data);
                }
            );

            $.get(
                "/ajax-basket-info",
                function(data){
                    if (type == 'no') {
                        $("#leftcol").html(data);
                        Cufon.replace('.backEshop, .continueTransport', { fontFamily: 'ugazz', hover: true, textShadow: '#000 4px 4px' });
                        Cufon.replace('.basketTable tr th', { fontFamily: 'ugazz', textShadow: '#000 5px 5px' });
                    } else {
                        window.open('/doprava-a-platba', '_self')
                    }
                }
            );
        }
    );
}

