/* Here is the code for the pop-out windows, for full-size images, from sitepoint.com by Ian Lloyd   http://www.sitepoint.com/article/perfect-pop-up/1 */
var newWin = null;
function popUpMedia(strURL, strType, strHeight, strWidth) {
if (newWin != null && !newWin.closed) newWin.close();
var strOptions="";
if (strType=="console") strOptions="resizable,scrollbars=1,top=135,left=125,height=510,width=650";
if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth;
if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,"+"resizable,location,height="+strHeight+",width="+strWidth;
newWin = window.open(strURL, 'newWin', strOptions);
newWin.focus();
}
/* this fixes focus problem with pop-ups: the code assesses state of the pop-up, then closes pop-up window and re-opens it with its new dimensions */

/* trying to get it to go to centre of page, I borrowed this script from the deadcentre.js and altered it. Can't get it to work just yet... I cheated and just measured pixels of original deadCenter, since they are all same size, and then specified top and left.

function deadCenter(w,h) {
return
popUp(src.getAttribute, features);
	if (window.screen) {

var chasm = screen.availWidth;
var mount = screen.availHeight;
 newWin = window.open('new','width=' + w + ',height=' + h + ',left=' + ((chasm - w - 10) * .5) + ',top=' + ((mount - h - 30) * .5));
	}
}
*/

/* this code is originally from windowDeadCentre1, and closes the pop-up when you click on the main html page */
function closeWindow() {
  if (newWin != null && newWin.open) newWin.close();
}

window.onfocus=closeWindow;
