function cookie_escribir(nombre,valor,dias) {
	if (dias) {
		var fecha = new Date();
		fecha.setTime(fecha.getTime()+(dias*24*60*60*1000)) // milisegundos que tiene un dia
		var expires = "; expires="+fecha.toGMTString()
	}
	else expires = ""
	document.cookie = nombre+"="+valor+expires+"; path=/"
}
function cookie_leer(nombre) {
	var nombreEQ = nombre + "="
	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(nombreEQ) == 0) return c.substring(nombreEQ.length,c.length)
	}
	return null
}
function cookie_borrar(nombre) {
	cookie_escribir(nombre,"",-1)
}

