﻿function dialog_open(url, width, height, name, scrollbars, resizable, menubar, toolbar, status, location, fullscreen) {
    if (width!=null && width!='' && height!=null && height!='') {
        var winwidth = document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth
        var winheight = document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight        var left = winwidth/2 + (window.screenLeft!=null?window.screenLeft:window.screenX)-width/2;// left=left<0?0:left
        var top = winheight/2 + (window.screenTop!=null?window.screenTop:window.screenY)-height/2;// top=top<0?0:top
    } else {
        var left = (window.screenLeft!=null?window.screenLeft:window.screenX);// left=left<0?0:left
        var top = (window.screenTop!=null?window.screenTop:window.screenY);// top=top<0?0:top
    }
    if(left!=null && top!=null) {
        left = Math.floor(left)
        top = Math.floor(top)
    } else {
        left = ''
        top = ''
    }
    var dialog = window.open(url, name==null ? "dialog" : name, "width=" + width + ",height=" + height + ",menubar=" + (menubar?"yes":"no") + ",resizable=" + (resizable?"yes":"no") + ",scrollbars=" + (scrollbars?"yes":"no") + ",status=" + (status?"yes":"no") + ",location=" + (location?"yes":"no") + ",toolbar=" + (toolbar?"yes":"no") + ",fullscreen=" + (fullscreen?"yes":"no") + ",z-lock=no,dependent=yes" + (left!=''?",left=" + left:"") + (top!=''?",top=" + top:"") + (left!=''?",screenX=" + left:"") + (top!=''?",screenY=" + top:""))
    dialog.focus()
    return dialog
}
function open_termsofuse() {
    dialog_open('dialogs/about_termsofuse.asp', 600, 500, 'TermsOfUse', true, false, false, false, false, false, false)
}
function open_licenseagreement() {
    dialog_open('dialogs/licenseagreement.asp', 500, 500, 'LicenseAgreement', true, false, false, false, false, false, false)
}
