function getWidth() { var width = 0; if( typeof( window.innerWidth ) == 'number' ) { width = window.innerWidth; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { width = document.documentElement.clientWidth; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { width = document.body.clientWidth; } return width; } function getHeight() { var height = 0; if( typeof( window.innerHeight ) == 'number' ) { height = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { height = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { height = document.body.clientHeight; } return height; } function Dialog (sUrl, iWidth, iHeight) { var posX = (screen.width / 2) - (iWidth/2); var posY = (screen.height / 2) - (iHeight/2); dialog = window.open (sUrl, "dialog", "width="+iWidth+", height="+iHeight+", resizable=no, scrollbars=yes"); dialog.moveTo (posX, posY); dialog.focus (); }