function OpenTextPopup(url) {
	var rnd = (Math.round((Math.random()*999)+1));
	var width=750;
	var height=450;
	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=yes,location=no,menubar=no,resizable=yes,status=no,directories=no,toolbar=no");
}
function OpenPopup(url) {
	var rnd = (Math.round((Math.random()*999)+1));
	var width=750;
	var height=450;
	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=no,location=no,menubar=no,resizable=no,status=no,directories=no,toolbar=no");
}
function OpenImagePopup(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;
	if ( height < maxheight ) {
		top=Math.round((maxheight-height)/2);
	} else {
		top=0;
		height=maxheight;
		scrolling="yes";
		width+=26;
	}
	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 OpenPopupWindow(url,width,height) { OpenImagePopup(url,width,height); }

function OpenImagePopupID(id,width,height) {
	OpenImagePopup(CMS_URL+id,width,height);
}

function ImageDetails(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;
	if ( height < maxheight ) {
		top=Math.round((maxheight-height)/2);
	} else {
		top=0;
		height=maxheight;
		scrolling="yes";
		width+=26;
	}
	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 ChartDetails(url) {
	var rnd = (Math.round((Math.random()*999)+1));
	var scrolling, top, left;
	scrolling="no";
	var height = 460;
	var width = 720;
	var maxheight=screen.height-50;
	var maxwidth=screen.width;
	if ( height < maxheight ) {
		top=Math.round((maxheight-height)/2);
	} else {
		top=0;
		height=maxheight;
		scrolling="yes";
		width+=26;
	}
	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");
}