//-----------------------------------------------------------------------------------------------

function ventana(url,nombre,ancho,alto,scroll,retorno) {

var sx = (screen.availWidth-ancho)/2;
var sy = (screen.availHeight-alto)/2;
var tools = 'resizable=yes,menubar=no,location=no,toolbar=no,status=no,scrollbars='+scroll+',directories=no,width='+ancho+',height='+alto+',left='+sx+',top='+sy;

	if (retorno) {
		return window.open(url,nombre,tools);
	} else {
		window.open(url,nombre,tools);
	}
}

// --------------------------------------------------------------------------------------

function getCookie(name) {
	var cname = name + "=";
	var dc = document.cookie;
	if (dc.length > 0) {
		begin = dc.indexOf(cname);
		if (begin != -1) {
			begin += cname.length;
			end = dc.indexOf(";", begin);
			if (end == -1) end = dc.length;
			return unescape(dc.substring(begin, end));
		}
	}
	return null;
}
// --------------------------------------------------------------------------------------

function setCookie(name,value,days) {
	// todo expira a un día
	days = 1;
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	} else {
		var expires = "";
	}
	document.cookie = name+"="+value+expires+"; path=/";
}

// --------------------------------------------------------------------------------------

function delCookie (name,path,domain) {
	if (getCookie(name)) {
		document.cookie = name + "=" + ((path == null) ? "" : "; path=" + path) + ((domain == null) ? "" : "; domain=" + domain) + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}

// --------------------------------------------------------------------------------------