(function(){
    if (/Firefox/.test(window.navigator.userAgent)) {
        HTMLElement.prototype.__defineGetter__("currentStyle", function(){
            return this.ownerDocument.defaultView.getComputedStyle(this, null);
        });
    }
})();
function Zoom(obj){
    var msg = "";
    var parentDiv = obj.parentNode;
    var maxWidth = parseInt(parentDiv.currentStyle.width);
    var maxHeight = parseInt(parentDiv.currentStyle.height);
    
    var width = obj.width;
    var height = obj.height;
    
    if (width != maxWidth) {
        height = parseInt(height * maxWidth / width);
        width = maxWidth;
    }
    if (height < maxHeight) {
        width = parseInt(width * maxHeight / height);
        height = maxHeight;
    }
    
    obj.style.width = width + "px";
    obj.style.height = height + "px";
    
    var left = parseInt((parentDiv.clientWidth - width) / 2);
    obj.style.left = left + "px";
    
    var top = parseInt((parentDiv.clientHeight - height) / 2);
    obj.style.top = top + "px";
}
function Cmpr(obj){
    var parentDiv = obj.parentNode;
    var maxWidth = parseInt(parentDiv.currentStyle.width);
    var maxHeight = parseInt(parentDiv.currentStyle.height);
    
    var width = obj.width;
    var height = obj.height;
    
    if (width > maxWidth) {
        height = parseInt(height * maxWidth / width);
        width = maxWidth;
    }
    if (height > maxHeight) {
        width = parseInt(width * maxHeight / height);
        height = maxHeight;
    }
    
    obj.style.width = width + "px";
    obj.style.height = height + "px";
    
    var left = parseInt((parentDiv.clientWidth - width) / 2);
    obj.style.left = left + "px";
    
    var top = parseInt((parentDiv.clientHeight - height) / 2);
    obj.style.top = top + "px";
}
function GoURL(url)
{
    window.open(url);
    //window.location.href = url;
}