
function alerta(div, h, w, b){
	if (h==null) h=130;
	if (b==null) b={'Aceptar':function(){ $(this).dialog('close'); }};
	$(div).show();
	$(div).dialog({ modal:true, 
						height:h, 
						width:w,
						overlay:{opacity:0.5, background:"black"},
						buttons: b
					});
}


function alertaSinBotones(div, h, w){
	if (h==null) h=130;
	$(div).show();
	$(div).dialog({ modal:true, 
						height:h,
						width: w,
						overlay:{opacity:0.5, background:"black"}
				  });
}


function createCookie(name,value,milisec) {
	if (milisec) {
		var date = new Date();
		date.setTime(date.getTime()+milisec);
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

