var vWindow = null;	
var vPhotoWindow = null;

function openWindow(aUrl, aWidth, aHeight, aOptions){
  mCloseWindow(vWindow);
  
  var vAllOptions = 'width=' + aWidth + ',height=' + aHeight;
  if (aOptions != '')
  {
    vAllOptions = vAllOptions + ',' + aOptions;
  }
  vWindow = window.open(aUrl, 'Alma', vAllOptions);
  
  vWindow.focus(); 
}

function mCloseWindow(aWindow){
  if (aWindow != null)
  {
    if (!aWindow.closed)
	aWindow.close();
  }
  else
  {
    aWindow = null;
  }
}


function fRandomHeaderImage(aImages){
	vRandomNr = Math.round(Math.random() * (aImages.length -1));
	document.write("<img src=\"" + aImages[vRandomNr] + "\"><br>");
}


function fNews(){
	document.write(vNews);
}


function mShowPhoto(aSource, aTitle, aWidth, aHeight)
{
  mCloseWindow(vPhotoWindow);
  vPhotoWindow = window.open("","Images","width="+aWidth+",height="+aHeight);
  vPhotoWindow.document.open();  
  vPhotoWindow.document.write("<head></head><body leftmargin=\"0\" topmargin=\"0\"><img src=" + aSource + "></body>");
  vPhotoWindow.document.close();
  vPhotoWindow.document.title = aTitle;
  vPhotoWindow.focus(); 
}

function hov(loc,cls) {
  if(loc.className)
    loc.className=cls;
}

/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}
