// JavaScript Document
var myWin;
function openPopup(URL,PARAM,CENTERED){													//'',{},false
	//Default Values
	var defaults={'width':400,'height':500,'left':0,'top':0,'titlebar':0,'menubar':0,'toolbar':0,'status':0,'directories':0,'location':0,'resizable':0,'scrollbars':0},params='', found=false;
	for(x in PARAM){ for(y in defaults)	if(x==y)found=true;	if(!found){	alert("Wrong parameter name for the popup window: "+x); return;	}	else found=false; }	//Check Valid Params
	for(x in PARAM)	defaults[x]=PARAM[x];												//Update defaults
	if(CENTERED)	if(PARAM['left']==null && PARAM['top']==null){	defaults['left']=screen.width/2-(defaults['width']/2);	defaults['top']=screen.height/2-(defaults['height']/2);	}else{	alert("You cannot center the window with the LEFT/TOP parameters specified."); return;	}	//Check if centered
	for(var x in defaults)	params+=","+x+"="+defaults[x];	params=params.substr(1);	//Build params
	if(myWin!=null && !myWin.closed) myWin.close();										//Close if opened
	myWin=window.open(URL,'PopupWindow',params);	myWin.focus();						//Open Window
}