/****************************************************************/
/***  LIBRARY FUNCTIONS										  ***/
/****************************************************************/

function OpenShowcaseObject(sURL)
{
	return OpenFullScreenWindow(sURL, 'scroll');
}


function OpenFullScreenWindow(url, options) {
  var winOptions = '';
  switch (options)
  {
    case 'scroll':
      winOptions = 'directories=no, menubar=no, status=no, toolbar=no, scrollbars=yes';
      break;
      
    default:
      winOptions = 'directories=no, menubar=no, status=no, toolbar=no';
  }
  
  var newWin = window.open(url, 'newWindow', winOptions + ", height=" + screen.height + ", width=" + screen.width);
  // Note: "moveTo" comment out below as it triggered an error in IE7, probably due to security setting on computer.
  //newWin.moveTo(50,50);
  newWin.focus();
  return false;
}


function PrintPage()
{
	window.print();
}


function OpenPopUp(sURL, sOptions)
{
	var sWinOptions = '';
	switch(sOptions)
	{
		case 'scroll':
			sWinOptions = 'directories=no, menubar=no, status=no, toolbar=no, scrollbars=yes';
			break;
			
		default:
			sWinOptions = 'directories=no, menubar=no, status=no, toolbar=no';
	}
	
	// Calculate window location
	var sHeight = 0;
	var sWidth = 0;
	var sWinX = 0;
	var sWinY = 0;
	
	sHeight = 510;
	sWidth = 600;
	sWinX = Math.round((screen.width - sWidth) / 2);
	sWinY = Math.round((screen.height - sHeight) / 2);
	
	// Open PopUp
	var oWin = window.open(sURL, 'newWindow', sWinOptions + ", height=" + sHeight + ", width=" + sWidth);
	oWin.moveTo(sWinX, sWinY);
	oWin.focus();
}