
function BrowserWindow(){function winBody(){if(!wb||wb==null){wb=window.document.body}
return wb;}
var wb=window.document.body;this.getWidth=function(){return parseInt(winBody().clientWidth);}
this.getHeight=function(){return parseInt(winBody().clientHeight);}
this.getCenterX=function(){return parseInt(winBody().clientWidth/2);}
this.getCenterY=function(){return parseInt(winBody().clientHeight/2);}
var browserWindowListener=new Array();this.addBrowserWindowListener=function(listener){browserWindowListener.push(listener)}
var resizeTimerId;function noticeBrowserWindowResized(){clearTimeout(resizeTimerId);resizeTimerId=setTimeout(noticeResize,500);function noticeResize(){for(var i=0;i<browserWindowListener.length;i++){try{browserWindowListener[i].fireBrowserWindowResized(parseInt(wb.clientWidth),parseInt(wb.clientHeight));}catch(e){if(log){log.write("noticeBrowserWindowResized",e.message+" "+i+" "+browserWindowListener[i].getListenerName());}}}
return false;}}
window.onresize=noticeBrowserWindowResized;}
function UserAgent(){var ua=navigator.userAgent;this.os;this.browserName;this.browserVer;this.isWin=function(){if(this.os=="w"){return true;}else{return false;}}
this.isMac=function(){if(this.os=="m"){return true;}else{return false;}}
this.isIE=function(){if(this.browserName=="ie"){return true;}else{return false;}}
this.isFireFox=function(){if(this.browserName=="ff"){return true;}else{return false;}}
this.isNetscape=function(){if(this.browserName=="ns"){return true;}else{return false;}}
this.isSafari=function(){if(this.browserName=="sf"){return true;}else{return false;}}
this.getBrowserName=function(){return this.browserName;}
this.getBrowserVer=function(){return this.browserVer;}
this.loadOSInfo=function(){if(ua.indexOf("Win")>=0){this.os="w";}else if(ua.indexOf("Mac")>=0){this.os="m";}else{this.os=null;}}
this.loadBrowserName=function(){if(ua.match(/MSIE/)){this.browserName="ie";}else if(ua.match(/Firefox/)){this.browserName="ff";}else if(ua.match(/Netscape/)){this.browserName="ns";}else if(ua.match(/Safari/)){this.browserName="sf";}else{this.browserName=this.loadBrowserNameByMethod();}}
this.loadBrowserNameByMethod=function(){var rslt=null;if(document.layers){rslt="ns"}else if(document.all){rslt="ie";}
return rslt;}
this.loadBrowserVerByMethod=function(){var ver=null;if(this.browserName=="ie"){if("doctype"in document){ver=6;}else if(!("doctype"in document)&&window.print){ver=5;}}
return ver;}
this.loadBrowserVer=function(){if(ua.match(/MSIE (\d\.\d+)/)){this.browserVer=parseFloat(RegExp.$1);}else{this.browserVer=this.loadBrowserVerByMethod();}}
this.init=function(){this.loadOSInfo();this.loadBrowserName();this.loadBrowserVer();}
this.init();}
