function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
  }

function launch(newURL, newName, newFeatures, orgName)
{
  var remote = open(newURL, newName, newFeatures);
  if (remote.opener == null)
  	alert("not null");
    	remote.opener = window;
 		remote.opener.name = orgName;
  return remote;
}
function printReport(id){
	width  = '800';
	height = '300';
	mywinpos = findscreencenter(width,height);
	settings=
	"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="+width+",height="+height+",top="+mywinpos[0]+",left="+mywinpos[1];
	orgname="mainWin";
	url = "/user/report/print/?id="+id;
	MyNewWindow=launch(url,"print",settings,orgname);	
}

function emailReport(id){
	width  = '500';
	height = '350';
	mywinpos = findscreencenter(width,height);
	settings=
	"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="+width+",height="+height+",top="+mywinpos[0]+",left="+mywinpos[1];
	orgname="mainWin";
	url = "/user/report/email/?id="+id;
	MyNewWindow=launch(url,"email",settings,orgname);	
}
function popup(url){
	width  = '450';
	height = '450';
	mywinpos = findscreencenter(width,height);
	settings=
	"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="+width+",height="+height+",top="+mywinpos[0]+",left="+mywinpos[1];
	orgname="mainWin";
	url = "/pop/"+url;
	MyNewWindow=launch(url,"popup",settings,orgname);
}
function openEcommerce(){
	alert("currently in development - please come back later");
	return;
	width  = '1020';
	height = '650';
	url = '/admin/workspace/';
	mywinpos = findscreencenter(width,height);
	settings=
	"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width="+width+",height="+height+",top="+mywinpos[0]+",left="+mywinpos[1];
	orgname="mainWin";
	MyNewWindow=launch(url,"popup",settings,orgname);
}

function findscreencenter( pwinwidth, pwinheight )
{
    winpos = new Array(2);
    scrheight = screen.height;
    scrwidth = screen.width;
    wintop = (scrheight - pwinheight-100) / 2;
    winleft = (scrwidth - pwinwidth) / 2;
    winpos[0] = wintop;
    winpos[1] = winleft;
    return winpos;
}

function popUpvideo(url){
	width  = '600';
	height = '427';
	mywinpos = findscreencenter(width,height);
	settings=
	"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+width+",height="+height+",top="+mywinpos[0]+",left="+mywinpos[1];
	orgname="mainWin";
	VideoWindow = launch(url,"video",settings,orgname);
}