
// open Popup in center
function getbrowserwidth(){if(navigator.userAgent.indexOf("MSIE")>0){return(document.body.clientWidth);}else{return window.outerWidth;}}
function getbrowserheight(){if(navigator.userAgent.indexOf("MSIE")>0){return(document.body.clientHeight);}else{return(window.outerHeight);}}

var popup = new Object();
function CenterPopup(URL, width, height){
	// get center of browser window
	var X = getbrowserwidth()/2;
	var Y = getbrowserheight()/2;
	popup = window.open(URL, 'PopUp','scrollbars=yes,width='+width+',height='+height+',top='+(window.screenTop+(Y-(height/2)))+',left='+(window.screenLeft+(X-(width/2))));
	popup.focus();
}

// RESIZE WINDOW
function resizeWindow(ww){
	if(navigator.userAgent.indexOf("Safari")!=-1){
		self.resizeTo(ww,getbrowserheight());
	}else if(document.all||document.getElementById){
		top.window.resizeTo(ww,getbrowserheight());
	}else if(document.layers||document.getElementById){
   		top.window.outerWidth = ww;
	}
}
