//显示相册密码对话框
function showAlbumPwdBox(AlbumID,Mode){
	if (Mode == 1) {
		ShowASBox(2,'浏览加密相册','正确输入密码才能浏览.',205,425,0,2,false);
	}
	AjaxUpdate("Index.Asp?Show=AlbumPwdDailog&AlbumID="+AlbumID, "ASBox_main");
}
//检测相册密码
function checkAlbumPwd(AlbumID){
	var AlbumPwdValue = document.getElementById("AlbumPassword").value;
	AjaxUpdate(
		"Index.Asp?Show=CheckAlbumPwd&AlbumID="+AlbumID+"&AlbumPwd="+AlbumPwdValue,
		function(obj) {
			if (obj.responseText == "Finish") {
				hideASBox();
				window.location.href = "?Show=Photos&AlbumID="+AlbumID+"&AlbumPwd="+AlbumPwdValue;
			} else {
				document.getElementById("ASBox_main").innerHTML = obj.responseText;
			}
		}
	);
}
//标准化图像尺寸
function ResizeImage(PhotoObj,PhotoWidth,PhotoHeight) {
	var currentW= PhotoObj.width;
	var currentH= PhotoObj.height;
	var sizeW	= PhotoWidth;
	var sizeH	= PhotoHeight;
	var Scale	= currentW / currentH;
	var A		= sizeW / currentW;
	var B		= sizeH / currentH;
	if (A>1 || B>1) {
		if (A<B) {
			PhotoObj.width	= sizeW;
			PhotoObj.height	= sizeW / Scale;
		}
		if (A>B) {
			PhotoObj.width	= sizeH * Scale;
			PhotoObj.height	= sizeH;
		}
	}
}