
// safely establish namespaces...
if (typeof Koss == 'undefined')
	Koss = {};

Koss.Global = {

    init: function () {

        // Email Signup link
        jQuery('a.email-signup').bind('click', function (e) {
            var $this = jQuery(this);

            jQuery.modal("<iframe src='" + $this.attr("href") + "' height='255' width='250' style='border:0' frameborder='0'>", {
                closeHTML: "<a href='#' title='Close'>Close</a>",
                closeClass: "close",
                close: true,
                overlayClose: true,
                modal: false,
                position: ["53%", "60%"],
                containerId: "email-signup",
                onShow: function (dialog) {
                    jQuery(dialog.container).find('iframe').load(function () {
                        var $contents = jQuery(this).contents();

                        // Some slight tweaks styling-wise
                        $contents.find('label').hide();
                        $contents.find('.scfRequired').hide();
                        $contents.find('.scfValidator').css({ 'height': 0, 'overflow': 'hidden' });
                        $contents.find('.scfEmailGeneralPanel').css({ 'width': '100%', 'margin-bottom': '5px' });
                        $contents.find('input.scfEmailTextBox').focus(function () {
                            this.value = "";
                        });
                    });
                }
            });

            return false;
        });
    }
}

jQuery(Koss.Global.init);


