﻿Cufon.replace('.Menu, .breadcrumb, .product_title a', { hover: true });
$(document).ready(function () {

    
    $('<span class="vertical_aligner"></span>').insertAfter($(".secondary_menu ul li a"));


    $(".scrollable:not(.scrollable.vertical)").each(function () {
        if ($("img", this).size() > 0) {
            $(this).scrollable({ mousewheel: true, circular: true, next: ".hnext", prev: ".hprev" }).navigator().autoscroll({
                interval: 5000
            });
        }
    });

    $('a[rel="fancy"]').fancybox();

    $(".scrollable.vertical").each(function () {
        if ($("img", this).size() > 0) {

            $(this).scrollable({ mousewheel: true, vertical: true, circular: true }).autoscroll({
                interval: 5000
            });
        }
    });

    $(".navi a").each(function () { $(this).text(parseInt($(this).attr("href").slice(1)) + 1); });

    //$("ul li:last").addClass("last-child");
    $(".secondary_menu ul li").last().css({ marginRight: '0px' });
});
 


function BlockUI(msg, timeout, redirect) {
    options = {};
    if (timeout != undefined)
        options.timeout = timeout;
    options.message = msg;
    options.css = {
        width: '350px',
        border: 'none',
        padding: '25px',
        backgroundColor: '#000',
        '-webkit-border-radius': '10px',
        '-moz-border-radius': '10px',
        'border-radius': '10px',
        opacity: .6,
        color: '#fff'
    }

    if (redirect != undefined) {
        options.onUnblock = function () {
            var url = location.href;
            var url_parts = url.split('?');
            url = url_parts[0];
            window.location = url;
        }
    }

    $.blockUI(options);

}
