﻿// JScript File
function ViewGallery( ItemId ) {
	openBareCenteredWin( "/gallery.aspx?Id=" + ItemId, "PhotoGallery",620, 450);
}

function openCenteredWin2(newUrl, winName, winWidth, winHeight, strMenubar, strToolbar) {
    __openWin(newUrl, winName, winWidth, winHeight, ",status=no,scrollbars=yes," + 
        ",resizable=yes,menubar=" + strMenubar + ",toolbar=" + strToolbar);
}

function openCenteredWin(newUrl, winName, winWidth, winHeight) {
    __openWin(newUrl, winName, winWidth, winHeight, ",status=no,scrollbars=yes,resizable=yes,menubar=no,toolbar=yes");
}

function openBareCenteredWin(newUrl, winName, winWidth, winHeight) {
    __openWin(newUrl, winName, winWidth, winHeight, ",status=no,scrollbars=yes,resizable=yes,menubar=no,toolbar=no");
}

function __openWin(newUrl, winName, winWidth, winHeight, strOptions) {
    var str;
    str="width=" + winWidth + ",height=" + winHeight + ",innerHeight=" + winHeight;
    str+=",innerWidth=" + winWidth;

    if (window.screen)
    {
      var yPos = ( screen.availHeight / 2 ) - ( winHeight / 2);
      yPos = yPos < 0 ? 0 : yPos;
      var xPos = ( screen.availWidth / 2 ) - ( winWidth / 2);
      xPos = xPos < 0 ? 0 : xPos;
      str += ",left=" + xPos;
      str += ",screenX=" + xPos;
      str += ",top=" + yPos;
      str += ",screenY=" + yPos;
    }
    str += strOptions;
    PopUp(newUrl, winName, str);
}
function PopUp(sURl, sName, sFeatures) {
	// To open a new window

		var newBrowser;
		newBrowser = window.open(sURl, sName, sFeatures);
		newBrowser.focus();		
}


