$(document).ready(
		function() {
			var url = $.url();
			var data_js_url = url.fparam("data");
			if (!data_js_url)
				data_js_url = url.param("data");
			var host = url.attr("host");
			var port = url.attr("port");
			var basepath = url.attr("protocol") + "://" + host + (port ? (":" + port) : "") + "/";
			if (data_js_url) {
				data_js_url = unescape(data_js_url);
			} else {
				var username = url.param("usr");
				if (!username) {
					username = url.fparam("usr");
				}
				var pwd = url.param("pwd");
				if (!pwd) {
					pwd = url.fparam("pwd");
				}
				var folder = url.param("fld");
				if (!folder) {
					folder = url.fparam("fld");
				}
				var filename = url.param("file");
				if (!filename) {
					filename = url.fparam("file");
				}
				if (!filename) {
					filename = "data.js";
				}
				if (basepath && username && pwd) {
					username = unescape(username);
					pwd = unescape(pwd);
					if (folder && folder.length > 0 && folder != "/") {
						folder = unescape(folder);
						folder = folder.replace(/\\/g, "/");
						folder = "/" + folder + "/";
						folder = folder.replace(/\/+/g, "/");
					} else {
						folder = "";
					}
					data_js_url = basepath + username
							+ "/protected/myphotos" + (folder ? folder : "/")
							+ "pwd/" + pwd + "/" + filename;
				}
			}
			if (data_js_url) {
				$.getScript(data_js_url, function() {
					$('.b-gallery').gallery({
						maxHeight : 180,
						interval : 10,
						data : galleryData
					}, basepath);
					$('.b-scroller').scroller();
					$('.b-context-popup').popup();
					$('.b-gallery-slideshow').slideshow({
						images : $('.b-gallery a'),
						data : galleryData
					});
				});
			}
		});
