function OpenPopup(url) {
	var width=480;
	var height=340;
	var rnd = (Math.round((Math.random()*999)+1));
	var top=Math.round((screen.height-height)/2);
	var left=Math.round((screen.width-width)/2);
	this.open(url, "w"+rnd, "top="+top+",left="+left+",width="+width+",height="+height+",buttons=no,scrollbars=auto,location=no,menubar=no,resizable=yes,status=no,directories=no,toolbar=no");
}

function OpenPopupWindow(url,width,height) {
	var rnd = (Math.round((Math.random()*999)+1));
	var scrolling, top, left;
	scrolling="no";
	var maxheight=screen.height-50;
	var maxwidth=screen.width-20;
	if ( height < maxheight ) {
		top=Math.round((maxheight-height)/2);
	} else {
		top=0;
		height=maxheight;
		scrolling="yes";
		width+=20;
	}
	if ( width < maxwidth ) {
		left=Math.round((maxwidth-width)/2);
	} else {
		left=0;
		width=maxwidth;
		scrolling="yes";
	}
	this.open(url, "w"+rnd, "top="+top+",left="+left+",width="+width+",height="+height+",buttons=no,scrollbars="+scrolling+",location=no,menubar=no,resizable=no,status=no,directories=no,toolbar=no");
}

function OpenPopupImage(url,width,height) {
	var rnd = (Math.round((Math.random()*999)+1));
	var scrolling, top, left;
	scrolling="no";
	var maxheight=screen.height-50;
	var maxwidth=screen.width-20;
	if ( height < maxheight ) {
		top=Math.round((maxheight-height)/2);
	} else {
		top=0;
		height=maxheight;
		scrolling="yes";
		width+=20;
	}
	if ( width < maxwidth ) {
		left=Math.round((maxwidth-width)/2);
	} else {
		left=0;
		width=maxwidth;
		scrolling="yes";
	}
	this.open(IMAGE_URL+url+';width,'+width+';height,'+height, "w"+rnd, "top="+top+",left="+left+",width="+width+",height="+height+",buttons=no,scrollbars="+scrolling+",location=no,menubar=no,resizable=no,status=no,directories=no,toolbar=no");
}
