﻿
//開啟全球據點的視窗
function OpenBarnchMapWindow(Link) {
    OpenNewWindow(Link, '900', '630');
}


function OpenNewWindow(Link, width, height) {
    window.open(Link, '_blank', 'width=' + width + ',height=' + height + ',left=90,top=50,status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=0');
}


//-------------------------控制Iframe大小使用--------------------------------------------
var getFFVersion = navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
//extra height in px to add to iframe in FireFox 1.0+ browsers
var FFextraHeight = getFFVersion >= 0.1 ? 16 : 0

function dyniframesize(iframename) {
    var oIFrameId = null;
    if (document.getElementById) {
        oIFrameId = document.getElementById(iframename);
    }
    else {
        eval('oIFrameId = ' + iframename + ';');
    }



    if (oIFrameId.src != "") {
        if (oIFrameId && !window.opera) {
            //begin resizing iframe
            oIFrameId.style.display = "block"
            /* if (oIFrameId.contentDocument && oIFrameId.contentDocument.body.offsetHeight) {
            //ns6 syntax
            oIFrameId.height = oIFrameId.contentDocument.body.offsetHeight + FFextraHeight;
            }
            else*/
            if (oIFrameId.document && oIFrameId.document.body.scrollHeight) {
                //ie5+ syntax
                oIFrameId.height = 0;
                oIFrameId.height = oIFrameId.document.body.scrollHeight + 30;
            }
        }
    }
}

//20110211*aynew.tsw 提示後轉址
function AlertRedirect(Url, Msg) {
    if (Msg != "") {
        alert(Msg);
    }
    location = Url;
}
