﻿jQuery.noConflict();
var $j = jQuery;

function extWindows() {
    $j("body").delegate("a, area", "click", function (e) {
        var that = this,
                rel = that.rel,
                re = /(^|\s)(external|popup(|\d+|\d+)?)(\s|$)/i,
                hw = [],
                h = 350,
                w = 435,
                win = null;

        if (rel && (re).test(rel)) {
            if (e) {
                e.preventDefault();
            }

            if ((/\d/).test(rel)) {

                hw = rel.match(/(|\d+)/g);

                if (hw) {
                    h = hw[0].replace(/\D/g, "");
                    w = hw[1].replace(/\D/g, "");
                }

                win = window.open(that.href, "popupWin", "scrollbars,resizable,height=" + h + ",width=" + w);
                win.focus();

            } else {
                window.open(that.href);
            }
        }
    });

}
function clearNewsInput() {
    var inputText = $("#ctl00_FullRegion_ctl02_txtEmail").val();
    $j("#ctl00_FullRegion_ctl02_txtEmail").focus(function () {
        if ($j(this).val() == inputText) {
            $j(this).val("")
        }
    });
    $j("#ctl00_FullRegion_ctl02_txtEmail").blur(function () {
        if (jQuery.trim($j(this).val()) == "") {
            $j(this).val(inputText)
        }
    });

}

function expandable() {
    $j(".expandableList li h3").click(function () {
        if ($j("a", this).css("backgroundImage").indexOf("expanded") != -1) {
            $j("a", this).css("backgroundImage", "url(/UI/Images/arrow.list.expand.gif)")
        } else {
            $j("a", this).css("backgroundImage", "url(/UI/Images/arrow.list.expanded.gif)")
        }
        $j(".expandable", this.parentNode).slideToggle(300)

    })
    //clearNewsInput()
}

$j(document).ready(function () {
    extWindows();

    //expandable
    expandable();
});
