function show_mask_loading(){
    jQuery('#mask_loading').height(jQuery(document).height()).css('opacity', '0.5').show() ;
    jQuery('#text_loading').css('top', jQuery(window).height()/2+jQuery(document).scrollTop()+'px').show() ;
}
function hide_mask_loading(){
    jQuery('#mask_loading').hide() ;
    jQuery('#text_loading').hide() ;
}

function imageZoom(obj, width, height){
    var margin = 0 ;
    var scale = obj.width/obj.height;

    if(obj.width > obj.height && obj.width > width){
        obj.width = width;
        obj.height = parseInt(width / scale);
        margin = parseInt((height - obj.height)/2) ;
        if(margin < 0){
            margin = 0;
        }
        obj.style.marginTop = margin + 'px' ;
    }else if(obj.width == obj.height && obj.width > width){
         obj.height = height;
         obj.width = scale * height ;
         obj.style.marginTop = '0px' ;
    }else{
        if(obj.height > obj.width && obj.height > height){
            obj.height = height;
            obj.width = scale * height ;
            obj.style.marginTop = '0px' ;
        }else{
            margin = parseInt((height - obj.height)/2) ;
            if(margin < 0){
                margin = 0;
            }
            obj.style.marginTop = margin + 'px' ;
        }
    }
}
