if (typeof _jaRootPath != "undefined") {
 
    var _jaServer = "www.jalbum.net";
    var _jaHost = "http://" + _jaServer + "/widgetapi/";
    var _jaWidgetContainer = document.getElementById("jalbumwidgetcontainer");
    var _jaIsPreview = location.href.indexOf("http://") != 0 && location.href.indexOf("https://") != 0;
  
    if (_jaWidgetContainer != null && !_jaIsPreview) {
        if (typeof _jaUserName != "undefined") {
            var _jaLoadScriptSrc = _jaHost + "load/LoadWidgets.action?url=" + encodeURIComponent(document.location) + "&skin=" + encodeURIComponent(_jaSkin) + "&style=" + encodeURIComponent(_jaStyle) + "&version=" + encodeURIComponent(_jaVersion) + "&pageType=" + _jaPageType  + "&rootPath=" + encodeURIComponent(_jaRootPath) + "&timeStamp=" + new Date().getTime();
            _jaLoadScriptSrc += "&username=" + encodeURIComponent(_jaUserName);
            var _jaLoadScript = document.createElement("script");
            _jaLoadScript.type = "text/javascript";
            _jaLoadScript.src = _jaLoadScriptSrc;
            _jaLoadScript.charset = "utf-8";
            _jaWidgetContainer.appendChild(_jaLoadScript);
        }

        var _jaInjectionCodeSrc = _jaHost + "load/InjectionCode.action?url=" + encodeURIComponent(document.location) + "&version=" + encodeURIComponent(_jaVersion) + "&rootPath=" + encodeURIComponent(_jaRootPath) + "&timeStamp=" + new Date().getTime();
        if (typeof _jaUserName != "undefined") {
            _jaInjectionCodeSrc += "&username=" + encodeURIComponent(_jaUserName);
        }
        var _jaInjectionCodeScript = document.createElement("script");
        _jaInjectionCodeScript.type = "text/javascript";
        _jaInjectionCodeScript.src = _jaInjectionCodeSrc;
        _jaInjectionCodeScript.charset = "utf-8";
        _jaWidgetContainer.appendChild(_jaInjectionCodeScript);
    }
}

