function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function showPic (whichpic) { 
	if (document.getElementById) { 
		document.getElementById('placeholder').src = whichpic.href; 
		if (whichpic.title) { 
			document.getElementById('desc').childNodes[0].nodeValue = whichpic.title; 
		} else { 
			document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue; 
		} 
		return false; 
	} else { 
		return true; 
	} 
}

sfHover = function() {
	var sfEls = document.getElementById("choose").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 popup(url,windowname,width,height) {
        width=(width)?width:screen.width/3;
        height=(height)?height:screen.height/3;
		var screenX = (screen.width/2 - width/2);
        var screenY = (screen.height/2 - height/2);
        var features= "width=" + width + ",height=" + height;
        features += ",screenX=" + screenX + ",left=" + screenX;
        features += ",screenY=" + screenY  +",top=" + screenY;
		var mywin=window.open(url, windowname, features);
        if (mywin) 
                mywin.focus();
        return mywin;
}