/**
 * Alliance Software Content Management System
 *
 * @copyright Copyright &copy; 2004, Alliance Software
 * No unauthorised use without the express written permission
 * of Alliance Software
 *
 * @package core
 *
 */

/**
 * Add a function to the window.onload event
 */
function addLoadEvent(func){
  var oldonload = window.onload;
  if (typeof window.onload != 'function'){
	window.onload = func;
  } else {
	window.onload = function(){
	  oldonload();
	  func();
	}
  }
}

/** Display a popup window showing a specific URL */
 function showWindow(url,name,width,height){
	var options = "width="+width+",height="+height+",status=yes,toolbar=no,"
		+"directories=no,menubar=no,location=no,resizable=yes,scrollbars=yes,"
		+"left=100,top=100";
	var hwnd = open(url, name, options);
}

/** Switch a layer between hidden and block */
function toggleLayer(wLayer){
	var s;
	if (document.getElementById){
		s=document.getElementById(wLayer).style;
	}else if (document.all){
		s=document.all[wLayer].style;
	}else if (document.layers){	
		s=document.layers[wLayer].style;
	}
	s.display=(s.display=="block")?"none":"block";
}
