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;
}
}
}