

function displayMessage(msg,top){
    if(top != null){
        window.top.$("#utilNotificationContent #msgBox").html(msg);
        window.top.$("#util_notification").click();
    }else{
        $("#utilNotificationContent #msgBox").html(msg);
        $("#util_notification").fancybox();
        $("#util_notification").click();
    }
}


function initSexylightbox(){
//    SexyLightbox.initialize({color:'black', dir:  '/scripts/sexylightbox/sexyimages'});
    $("a.fancybox").fancybox();
}

function initFancybox(){
    $("a.fancybox").fancybox();
}

function initAddToBasketLink(){
    $("a.add_to_cart").fancybox({
        width: 400
    });
}

var beginSearch;

$(document).ready(function() {

    $('#producer select').styledSelect();
    $('.product_list .products_on_page select').styledSelect();
    $('.product_list .sort_by select').styledSelect();
    $('.header .settings_form p select.language').styledSelect();
    $('.header .settings_form p select.currency').styledSelect();

    beginSearch = $("form.search input:text").val();

    $("form.search input:text").focus(function() {
        if ($(this).val() == beginSearch) {
            $(this).val('');
        }
    });
    $("form.search input:text").blur(function() {
        if ($(this).val().length == 0)
            $(this).val(beginSearch);
    });
    $("form.search").submit(function() {
        var text = $(this).children("input:text").val();
        if (text == beginSearch || text.length == 0) return false;
    });

    $("select#producer").change(function() {
        producer = $(this).val();
        Set_Cookie('producer', producer, 30, '/', '', '');
        loadproductlist();
    });
});
