function playVideo(videoID){
	url = "/videoPlayer.php?videoID="+videoID;
	popup(url,"videoWin",480,430);
}


function launch(newURL, newName, newFeatures, orgName){
  var remote = window.open(newURL, newName, newFeatures);
  if (remote.opener == null)
    	remote.opener = window;
 		remote.opener.name = orgName;
  return remote;
}


function enlargeImage(uri, width, height){
	url = '/media/img/'+uri;
	popup(url,uri,width,height);
}

function popup(url, name, width, height){
	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";
	MyNewWindow=launch(url,name,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;
}
