<!--
var target;

function set_image_preview(pre_image, pre_id) {
	show_loading("loading");
	document.getElementById(pre_id).src = "file:///"+pre_image.value;
}
function show_loading(load)
{
			document.getElementById(load).style.display = "block";
			scroll_loading("loading");
}
function scroll_loading(load)
{
			document.getElementById(load).style.top = document.body.scrollTop;
}
function hide_loading(load){
			document.getElementById(load).style.display = "none";
}

function reset_image(pre_id) {
	document.getElementById(pre_id).style.width = "";
	document.getElementById(pre_id).style.height = "";
	//document.getElementById(pre_id).style.margin = 0;
}
function image_limit(oImg, limit_x, limit_y) {
	var rate_x;
	var rate_y;
	var size_x = 50;
	var size_y = 50;
	var temp;
	
	rate_x = oImg.width/limit_x;
	rate_y = oImg.height/limit_y;
	
	if(rate_x > 1) {
		if(rate_x > rate_y) {
			size_x = limit_x;
			size_y = Math.floor(oImg.height/rate_x);
		}
		else {
			size_x = Math.floor(oImg.width/rate_y);
			size_y = limit_y;
		}
	}
	else if(rate_y > 1) {
		if(rate_y > rate_x) {
			size_x = Math.floor(oImg.width/rate_y);
			size_y = limit_y;
		}
		else {
			size_x = limit_x;
			size_y = Math.floor(oImg.height/rate_x);
		}
	}
	else {
			size_x = oImg.width;
			size_y = oImg.height;
	}
	
	oImg.style.width = size_x;
	oImg.style.height = size_y;
	
	temp = Math.floor((limit_x - size_x)/2);
	oImg.style.marginLeft = temp;
	oImg.style.marginRight = temp;
	temp = Math.floor((limit_y - size_y)/2);
	oImg.style.marginTop = temp;
	oImg.style.marginBottom = temp;
}

function change_page(target) {
	//window.status = target+document.getElementById("new_page").value;
	location.replace(target+document.getElementById("new_page").value);
}
function change_album(target) {
	//window.status = target+document.getElementById("new_album").value;
	location.replace(target+document.getElementById("new_album").value);
}
//-->
