﻿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');
}

// Ben Shaw 11/05/2011
//====================================================

$(document).ready(function() {
    $('ul.RootNav').superfish({ animation: { height: 'show' }, speed: 100, autoArrows: false });
	
	$(function(){
		$(".banner-shadow ul").liScroll();
	});
	
	$("#newsletter").fancybox({
				'autoScale'			: true,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
	$("#newsletterfooter").fancybox({
				'autoScale'			: true,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
			
	$(".newsletter a").fancybox({
				'autoScale'			: true,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
});	

//====================================================
