﻿var OpenWait = function(msg) {

    $.blockUI({ message: msg, css: {
        border: 'none',
        padding: '15px',
        backgroundColor: '#000',
        '-webkit-border-radius': '10px',
        '-moz-border-radius': '10px',
        opacity: .5,
        color: '#ffffff'
    }
    });
}
var CloseWait = function() {
    $.unblockUI();
}

//wenhui 2010-3-17
//====================================================
var PopUpAlert = function(message, title, fn) {

    if (title != "") {
        $("#popup_alert").attr("title", title);
    }
    if (message != "") {
        $("#popup_alert #popup_alert_message").html(message);
    }
    $("#popup_alert").dialog({
        modal: true,
        buttons: {
            OK: function() {
                $(this).dialog('close');
            }
        },
        close: function() {
            $(this).dialog('destroy');
            if ($.isFunction(fn)) {
                fn.call(fn);
            }
        }
    });
    $('#popup_alert').dialog('open');

}

var PopUpConfirm = function(message, title, fn) {
    if (title != "") {
        $("#popup_confirm").attr("title", title);
    }
    if (message != "") {
        $("#popup_confirm #popup_confirm_message").html(message);
    }
    $("#popup_confirm").dialog({
        modal: true,
        buttons: {
            Cancel: function() {
                $(this).dialog('close');

            },

            OK: function() {
                $(this).dialog('close');
                if ($.isFunction(fn)) {
                    fn.call(fn);
                }
            }
        },
        close: function() {
            $(this).dialog('destroy');

        }
    });
    $('#popup_confirm').dialog('open');
}

$("a[rel=images]").fancybox({			});

$(document).ready(function() {
    $('ul.RootNav').superfish({ animation: { height: 'show' }, speed: 100, autoArrows: false });
    $("a[rel=pop]").fancybox();
	$("a[rel=images]").fancybox();
    $(".tabs").tabs();
    $("#navigation li:first").addClass("first");
    $("#navigation li:last").addClass("last");
    $(".related .shop-product-list li:first").addClass("first");
    $(".related .shop-product-list li:last").addClass("last");
    $("table.specification tr:even").addClass("altrow");
    $("table.specifications tr:even").addClass("altrow");
    $("table.specification td:even").addClass("leftcol");
    $("table.specifications td:even").addClass("leftcol");
    $('.slider').cycle({ fx: 'fade', speed: '2000', timeout: '6000' });
	
	//FUNCTION TO ALLOW FADING ROLLOVERS
        $(".splash-banner div").hover(function() { //On hover...

            var thumbOver = $(this).find("img").attr("src"); //Get image url and assign it to 'thumbOver'

            //Set a background image(thumbOver) on the <a> tag - Set position to bottom
            $(this).find(".img").css({ 'background': 'url(' + thumbOver + ') no-repeat bottom' });

            //Animate the image to 0 opacity (fade it out)
            $(this).find(".img-hide").stop().fadeTo(400, 0, function() {
                $(this).hide() //Hide the image after fade
            });
        }, function() { //on hover out...
            //Fade the image to full opacity
            $(this).find(".img-hide").stop().fadeTo(400, 1).show();
        });
	
});

//

//====================================================


