/* 
 * JavaScript to control generic AJAX functions within the Webstore.
 */

window.$ws = WebstoreJavaScriptContextInit;

function WebstoreJavaScriptContextInit(param)
{
    return new WebstoreJavaScriptContext(param)
}

function WebstoreJavaScriptContext(selection)
{
    if (selection != null)
        this.elements = $(selection);
}

WebstoreJavaScriptContext.prototype.cacheBustUrl = function(href)
{
    var cacheBuster = "_=" + new Date().getTime();
    if (href.indexOf("?") == -1) href += "?" + cacheBuster;
    else href += "&" + cacheBuster;

    return href;
}

// CMS related variables
WebstoreJavaScriptContext.prototype.LOADING_HTML = "<div class='ws-ajax-processing-message ui-corner-all'>" +
                                            "<div class='ws-ajax-processing-message-text ui-corner-all'>" +
                                                "Please wait... " + 
                                            "</div></div>";

