﻿//function fnChangeWidth(){
//    if (screen.width > 1024){
//        document.forms[0].style.width = '1024px';
//    }
//}

function fnCenterConfirm(iOn, objID){
    if (iOn == 1){
        document.getElementById(objID).style.display = 'block';
        //document.getElementById(objID).style.left = parseInt((fnGetInnerWidth() - 273)/2) + 'px';
        //document.getElementById(objID).style.top = parseInt((fnGetInnerHeight() - 145)/2) + 'px';
        var siteWidth;
        var newLeft, newTop;
            siteWidth = 780;

        if (navigator.appName.indexOf("Microsoft") != -1){
            newLeft = document.getElementById(objID).offsetHeight;
        }else{
            newLeft = document.getElementById(objID).innerHeight;
        }
        
        document.getElementById(objID).style.left = parseInt( (siteWidth/2) - newLeft) + 'px';
        document.getElementById(objID).style.top = parseInt((fnGetInnerHeight() - 145)/2) + 'px';
        
    }else{
        document.getElementById(objID).style.display = 'none';
    }
}

function fnGetInnerHeight(){
    if (navigator.appName.indexOf("Microsoft") != -1){
        return document.body.offsetHeight;
    }else{
        return window.innerHeight;
    }
}

function fnGetInnerWidth(){
    if (navigator.appName.indexOf("Microsoft") != -1){
        return document.body.offsetWidth;
    }else{
        return window.innerWidth;
    }
}
