/* =Load Functions
-----------------------------------------------------------------------------*/
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}
addLoadEvent(doNewWin);
addLoadEvent(imghover);



/* =Open a new window
-----------------------------------------------------------------------------*/
function doNewWin() {
  if (!document.getElementsByTagName) return false;
  var links = document.getElementsByTagName("a");
  for (i=0; i < links.length; i++) {
    if (links[i].className.match("newWin")) {
      links[i].onclick=function() {window.open(this.href);return false;
      }
    }
  }
}


// IE Only img:hover support
function imghover(){
	if(!document.all) return false; 
	if(!document.getElementsByTagName) return false;
	if(!document.getElementById) return false;
	if(!document.getElementById('photos')) return false;
	var ul = document.getElementById('photos');
	var img = ul.getElementsByTagName('img');
	for(i=0; i<img.length; i++){
		img[i].onmouseover=function(){
			this.className += " over";
		}
		img[i].onmouseout=function(){
			this.className=this.className.replace(" over", "");
		}
	}
}
