// $Revision: 1 $ $Date: 2009-08-10 15:22:23+01:00 $ $Archive: /TRUNK/EBS/ebs4/ebs_common/scripts/ebs_ContentLauncher.js $

var launcherPath, win;

function launchContent(rid,prid,showbars,width,height){	
	if(launcherPath!=null){
		var left, top;
		var edit=false;
		var path = launcherPath;
		if(width=='')
			width='640';
		if(height=='')
			height='480';
		left=(screen.width-width)/2;
		top=(screen.height-height)/2;		
		if(win!=null)
			win.close();		
		path+="?Resource_ID="+rid;
		try{
			if(pageEditable)
				edit=true;
		}catch(e){}
		if(edit)
			path+="&PResource_ID="+prid;
		else
			path+="&PResource_ID="+0;
		if(showbars=="Y")
			win=window.open(path,'ebs_Content','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+width+',height='+height,true);
		else
			win=window.open(path,'ebs_Content','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+width+',height='+height,true);			
		try{
			win.moveTo(left,top);
		}catch(e){}
		win.focus();
	}
}