
<script type="text/javascript">
$(window).load(function(){
var str_h=0;
$("#album").find("div[h]").each(function(i,ele){
str_h+=$(ele).height();
});
$("#album").height(str_h);
});
function scaleImage(o, w, h) {
var img = new Image();
img.src = o.src;
if (img.width > 0 && img.height > 0) {
if (img.width / img.height >= w / h) {
if (img.width > w) {
o.width = w;
o.height = (img.height * w) / img.width;
} else {
o.width = img.width;
o.height = img.height;
}
} else {
if (img.height > h) {
o.height = h;
o.width = (img.width * h) / img.height;
} else {
o.width = img.width;
o.height = img.height;
}
}
}
}
</script>