/* helper function to load multiple functions, courtesy Simon Wilson */
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function popup(url,w,h,scroll)
{
	var l = (screen.width-w)/2;
	var t = (screen.height-h)/2;

	window.open(url,'_blank','resizable=yes,location=no,menubar=no,scrollbars='+scroll+',status=no,toolbar=no,fullscreen=no,dependent=no,width='+w+',height='+h+',left='+l+',top='+t);
}

//get basepath
var site_base = "";
if(a=document.getElementsByTagName("link")[0])
{
	site_base = a.href.substr(0,a.href.indexOf('/resources'));
}

function reloadValidationImage()
{
	if(document.getElementById('validationimage'))
	{
		var now = new Date();
		newSrc = document.getElementById('validationimage').src
		newSrc = (newSrc.indexOf("?")>0)? newSrc.substr(0,newSrc.indexOf("?")) : newSrc;
		newSrc+= "?"+ now.getTime();
		document.getElementById('validationimage').src = newSrc;
	}
}