/* ***************************************************************************************
 * File:             nesossi_global.js
 * Description:      Global JavaScript utilities for Nesossi Photography
 * Revision History: 2005-07-25 [am] File created
 * **************************************************************************************** */

/* *************************************************************************
 * *************************************************************************
 * Global Constants & Variables 
 * *************************************************************************
 * ************************************************************************* */

/* Default page status - Typically does not work for Mozilla */
var gstrPAGE_STATUS = "Nesossi Photography";

/* *************************************************************************
 * *************************************************************************
 * Global Functions
 * *************************************************************************
 * ************************************************************************* */
 
 /* *****************************************
 * Function:    Init
 * Description: Initialization when page loads
 * Arguments:   None
 * Return:      None
 * ***************************************** */
function Init() {
   window.status = gstrPAGE_STATUS;
   return true;
}

function WinPopup(pUrl,pName,h,w,scroll) {
	var settings = 'height='+h+',width='+w+',top='+(screen.height-h)/2+',left='+(screen.width-w)/2+',scrollbars='+scroll+',resizable=yes';
	var win=window.open(pUrl,pName,settings);
	if(parseInt(navigator.appVersion)>=4) win.window.focus();
}

function SwapImage(imgId, newSrc) {
   if(document.getElementById(imgId) != null) {
      document.getElementById(imgId).src = newSrc;
   } else {
      alert(imgId + " is null");
   }
}

function SwapGalleryImage(galleryImgId, newSrc, boxImgNum, boxImgCount) {
   SwapImage(galleryImgId, newSrc);
   for(var i = 0; i < boxImgCount; i++) {
      SwapImage('box' + i, (i == boxImgNum ? 'images/global/box_x.jpg' : 'images/global/box_o.jpg'));
   }
}

