function popup(url, w, h) 
{
    var d = new Date();
    var width  = w;
    var height = h;
    var left   = (screen.width  - width)/2;
    var top    = (screen.height - height)/2;
    var params = 'width='+width+', height='+height;
    
    params += ', top='+top+', left='+left;
    params += ', directories=no';
    params += ', location=no';
    params += ', menubar=no';
    params += ', resizable=no';
    params += ', scrollbars=yes';
    params += ', status=no';
    params += ', toolbar=no';
    newwin = window.open(url,'flashgroup' + d.getTime(), params);
    
    if (!newwin) alert("Unable to open a new window, please disable your popup blocker.");
    
}

function hoverGallery(phoGalId, phoMainId)
{
    document.getElementById('front_' + phoGalId).src = 'gallery/' + phoGalId + '-resized/' + phoMainId + '_front_hover.jpg';
}

function unhoverGallery(phoGalId, phoMainId)
{
    document.getElementById('front_' + phoGalId).src = 'gallery/' + phoGalId + '-resized/' + phoMainId + '_front.jpg';
}

function hoverPhoto(phoGalId, phoFileId, phoID)
{
    document.getElementById('front_' + phoGalId + phoID).src = 'gallery/' + phoGalId + '-resized/' + phoFileId + '_front_hover.jpg';
}

function unhoverPhoto(phoGalId, phoFileId, phoID)
{
    document.getElementById('front_' + phoGalId + phoID).src = 'gallery/' + phoGalId + '-resized/' + phoFileId + '_front.jpg';
}

function preload(source) 
{
    var a = new Image();
    a.src = source;
    return a; 
}

function doNews(e, sS)
{
  var characterCode
  if(e && e.which){           // NN4 specific code
    e = e
    characterCode = e.which
  }
  else {
    e = event
    characterCode = e.keyCode // IE specific code
  }

if (characterCode == 13)

popup('signup.php?email=' + sS, 240, 100);
}

function doSearch(e, sS)
{
  var characterCode
  if(e && e.which){           // NN4 specific code
    e = e
    characterCode = e.which
  }
  else {
    e = event
    characterCode = e.keyCode // IE specific code
  }

if (characterCode == 13)
	document.location = '?page=search&q=' + sS;
}