function getProperties(obj)
{
	props = "";
	for(x in obj){
		props +=x+": "+obj[x]+"<br/>";
	}
	return props;
}

function alertwin(obj)
{
	dats = getProperties(obj);
	win = window.open('','alertwin','width=300,height='+(screen.height -70)+',resizable,dependent,scrollbars,left=0,top=0');
	win.document.write(dats);	
	win.focus()
	win.stop();
}

function winPopup(anchor,link,width,height)
{
	var testpopup = new PopupWindow();
	testpopup.offsetX=3;
	
	if(navigator.appName.indexOf('Internet')!=-1){
		testpopup.offsetY=20;
	}else{
		testpopup.offsetY=45;
	}	
	testpopup.setSize(width,height);
	testpopup.autoHide();
	testpopup.setUrl(link);
	testpopup.showPopup(anchor);
}

function window_open(url,id_ventana,ancho,alto,propiedades)
{
	if(propiedades==undefined){
		if(ancho==undefined){
			ancho=400;
		}
		
		if(alto==undefined){
			alto=300;
		}
		
		propiedades='scrollbars,resizable,dependent';
		v_ancho=(window.screen.width - ancho)/2;
		v_alto=(window.screen.height - alto)/2;
		
		ventana= window.open(url,id_ventana,'width='+ancho+',height='+alto+',left='+v_ancho+',top='+v_alto+','+propiedades);
	}else{
		ventana = window.open(url,id_ventana,'width='+ancho+',height='+alto+','+propiedades);
	}
	
	ventana.focus();
}
