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


/* popup centrat */
function popup(url,windowname,width,height,features) { 
width=(width)?width:screen.width/2; 
height=(height)?height:screen.height/2; 
var screenX = (screen.width/2 - width/2); 
var screenY = (screen.height/2 - height/2); 
if (features) {
var features= "width=" + width + ",height=" + height + "," + features; 	
} 
else {
var features= "width=" + width + ",height=" + height +",scrollbars=yes,status=no,resizable=no"; 
}
features += ",screenX=" + screenX + ",left=" + screenX; 
features += ",screenY=" + screenY + ",top=" + screenY; 

var mywin=window.open(url, windowname, features); 
if (mywin) 
mywin.focus(); 
return mywin; 
} 


