/* The hovering code */
sfHover = function() {
	var sfEls = document.getElementById("photobox").getElementsByTagName("img");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function swapnglo(){
	swapimage;
	this.className+=" sfhover";
}

/* Load images for gallery */

gallery1_lg = new Image( );
gallery1_lg.src = "images/spotlight2006_08/hd01.jpg";
gallery2_lg = new Image( );
gallery2_lg.src = "images/spotlight2006_08/hd02.jpg";



/* Load images to use */
var blnDOMSUPPORT = (document.getElementById) ? true : false;
window.onload = window_load;

function window_load()
   {
  if ( blnDOMSUPPORT )
      {
		  document.getElementById('gallery1').onclick = swapimage;
		  document.getElementById('gallery2').onclick = swapimage;
	  }
	  else{
		  document.images['gallery1'].onclick = swapimage;
		  document.images['gallery2'].onclick = swapimage;
	  }
		  
   }
   
   
function swapimage()
   {
var testVar = eval(this.id+'_lg.src');
var dataVar = this.id+'data';
	   
  if ( blnDOMSUPPORT )
      {
      var imgMain = document.getElementById('mainimage');
      var divParent;


      // create new image element
      var imgNew = document.createElement('img');

      // give it an image
      // here I use the src of the icon just for convenience
      // you'd want to somehow determine the src of your desired image
      imgNew.src = testVar;
   
      // give it an id
      imgNew.id = 'mainimage';

      // replace image
      divParent = imgMain.parentNode;
      divParent.replaceChild(imgNew, imgMain);
	  
	  // swap the div
	  var othergalleryitems = document.getElementById("gallerycontent").getElementsByTagName("div");
	  for( var i=0; i<othergalleryitems.length; i++)
	  {
		  othergalleryitems[i].style.display = "none";
	  }
	  var current = document.getElementById(dataVar);
	  current.style.display = "block";
	  }
	  
	else 
      { 
      // old school image swap
      document.images['mainimage'].src = testVar;
   	  } 
	  
    }

function stupidie(image)
{
	document.images['mainimage'].src = eval(image+".src");
}