var default_description = "";

function set_default_description(description) {
	default_description = description;
	show_description(description);
}

function show_description(description) {
	if(document.getElementById) {
		document.getElementById("description").innerHTML = description;
	}
}

function reset_description() {
	if(document.getElementById) {
		document.getElementById("description").innerHTML = default_description;
	}
}

function open_disclaimer() {
	var height = 500;
	var width = 472;
	var left = (screen.width - width) / 2;
	var top = (screen.height - height) / 2;
	window.open("index.php?c=index&a=disclaimer", "viewer", "height=" + height + ",left=" + left + ",scrollbars=yes,top=" + top + ",width=" + width);
	
}

function open_photo_popup(id) {
	var height = 542;
	var width = 662;
	var left = (screen.width - width) / 2;
	var top = (screen.height - height) / 2;
	window.open("index.php?c=index&a=photo_show&id=" + id, "viewer", "height=" + height + ",left=" + left + ",scrollbars=no,top=" + top + ",width=" + width);
}

function open_viewer_popup(client_id, id) {
	var height = 440;
	var width = 422;
	var left = (screen.width - width) / 2;
	var top = (screen.height - height) / 2;
	
	if(client_id > 0) {
		var url = "upload/viewers/index.php?c=index&a=viewer_show_popup&client_id=" + client_id;
		if(id > 0) {
			url += "&id=" + id;
		}
		window.open(url, "viewer", "height=" + height + ",left=" + left + ",scrollbars=no,top=" + top + ",width=" + width);
	}
}

function show_viewer(client_id) {
	location = "index.php?c=index&a=viewer_show&client_id=" + client_id;
}