var bw=new checkBrowser()

function checkBrowser(){
	this.win=(navigator.platform=="Win32")?1:0;
	this.mac=(navigator.platform=="MacPPC")?1:0;
	this.ver=navigator.appVersion;
	this.dom=document.getElementById?1:0;						/* The getElementById method is applicable to 5th generation browsers only. */
	this.ie6=(this.ver.indexOf("MSIE 6")!=-1 && this.dom)?1:0; 	/* Will handle both ie6*/
	this.ie5=(this.ver.indexOf("MSIE 5")!=-1 && this.dom)?1:0; 	/* Will handle both ie5 and ie5.5 */
	this.ie4=(document.all && !this.dom)?1:0;					/* Specifically ie4 */
	this.ns6=(this.dom && parseInt(this.ver)>=5)?1:0;			/* Netscape 6 (Mozilla) */
	this.ns4=(document.layers && !this.dom)?1:0;				
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.ie6)?1:0;		/* Only IE or Navigator */
	this.ie=(this.ie4 || this.ie5 || this.ns6 || this.ie6)?1:0;					/* Allows single test on bw.ie */
	this.nav=(this.ns4)?1:0;

									/* Allows single test on bw.nav */
	return this
}


function setSize() {//IE only function
	w=document.all.sizer.clientWidth
	h=document.all.sizer.clientHeight
	lpos=Math.max(0,(w-760)/2);
	ypos=20;//Math.max(0,(h-402)/2);
	document.write('<style type="text/css">#maincontent {position:absolute;left:'+lpos+'px;top:'+ypos+'px;width:760px;height:402px;}</style>')
}


function updateSize() {
	if (bw.ie) {w=document.all.sizer.clientWidth;h=document.all.sizer.clientHeight}
	if (bw.ns4||bw.ns6) {w=window.innerWidth;h = window.innerHeight;}
	lpos=Math.max(0,(w-760)/2);
	ypos=20;//Math.max(0,(h-402)/2);
	if (bw.ie) {document.all.maincontent.style.pixelLeft=lpos;document.all.maincontent.style.pixelTop=ypos;}
	if (bw.ns4||bw.ns6) {document.maincontent.left=lpos;document.thepage.top=ypos;}
}

function handleResize() {
	if ((window.innerWidth!=lastWidth) || (window.innerHeight!=lastHeight)) {
		lastWidth=window.innerWidth;
		lastHeight=window.innerHeight;
		updateSize()
	}
}

if (bw.ie) {

window.onresize=updateSize

}
if (bw.ns4||bw.ns6) {window.onresize=handleResize}