﻿
$(function () {

    if ($('.b[rel]').length) {
        $(".b[rel]").overlay({
        
            mask: 'black',

            onBeforeLoad: function () {

                // grab wrapper element inside content
                var wrap = this.getOverlay().find(".contentWrap");

                var qs = "";

                qs = this.getTrigger().attr("href");

                // load the page specified in the trigger
                wrap.load(this.getTrigger().attr("href"));
            }

        });
    }
});


function getParameter(queryString, parameterName, defaultvalue) {
    // Add "=" to the parameter name (i.e. parameterName=value)
    var parameterName = parameterName + "=";
    if (queryString.length > 0) {
        // Find the beginning of the string
        begin = queryString.indexOf(parameterName);
        // If the parameter name is not found, skip it, otherwise return the value
        if (begin != -1) {
            // Add the length (integer) to the beginning
            begin += parameterName.length;
            // Multiple parameters are separated by the "&" sign
            end = queryString.indexOf("&", begin);
            if (end == -1)
                end = queryString.length;

            // Return the string
            return unescape(queryString.substring(begin, end));
        }
    }
    // Return "null" if no parameter has been found
    return defaultvalue;
}

function init() {
    var qs = "";
    if (window.top.location.search != 0)
        qs = window.top.location.search;

}
