function getCookieData(labelName) 
{
	var labelLen = labelName.length
	var cookieData = document.cookie
	var cLen = cookieData.length
	var i = 0
	var cEnd
	
	while (i < cLen) 
	{
		var j = i + labelLen
		if (cookieData.substring(i,j) == labelName) {
			cEnd = cookieData.indexOf(";",j)
			if (cEnd == -1) {
				cEnd = cookieData.length
			}
			return unescape(cookieData.substring(j+1, cEnd))
			}
		i++;
	}
	return ""
}


//
// Function to create or update a cookie.
// name - String object containing the cookie name.
// value - String object containing the cookie value. May contain
// any valid string characters.
// [expires] - Date object containing the expiration data of the cookie. If
// omitted or null, expires the cookie at the end of the current session.
// [path] - String object indicating the path for which the cookie is valid.
// If omitted or null, uses the path of the calling document.
// [domain] - String object indicating the domain for which the cookie is
// valid. If omitted or null, uses the domain of the calling document.
// [secure] - Boolean (true/false) value indicating whether cookie transmission
// requires a secure channel (HTTPS).
//
// The first two parameters are required. The others, if supplied, must
// be passed in the order listed above. To omit an unused optional field,
// use null as a place holder. For example, to call SetCookie using name,
// value and path, you would code:
//
// SetCookie (“myCookieName”, “myCookieValue”, null, “/”);
//
// Note that trailing omitted parameters do not require a placeholder.
//
// To set a secure cookie for path “/myPath”, that expires after the
// current session, you might code:
//
// SetCookie (myCookieVar, cookieValueVar, null, “/myPath”, null, true);
//
function setCookie (name,value,expires,path,domain,secure) 
{
	document.cookie = name + "=" + escape (value) +
		((expires) ? "; expires=" + expires.toGMTString() : "") +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		((secure) ? "; secure" : "");
}

function ponIdioma(idioma)
{
	setCookie ("IDIOMA", idioma);
	document.formDatos.action = "index.php";
	document.formDatos.submit();
//	location.reload();
}

