/*
 * JS for work with cookies
 * Required mootools 1.11 with object Cookie
 * 
 * Options (Object):
 *   domain - (string: defaults to false) The domain the Cookie belongs to.
 *   path - (string: defaults to false) The path the Cookie belongs to.
 *   duration - (number: defaults to false) The duration of the Cookie before it expires, in days. 
 *   			If set to false or 0, the cookie will be a session cookie that expires when the browser is closed.
 *   secure - (boolean: defaults to false) Stored cookie information can be accessed only from a secure environment.
 *   
 *   example: {duration: 300}
 */

/* Get the cookie string value, or null if not found.*/
function getCookieValue(name){
	var cookieValue = Cookie.get(name);
	if(cookieValue != null && cookieValue == false) return null;
	else return cookieValue;
}

/* Removes a cookie from the browser. */
function eraserCookie(name){
	Cookie.remove(name);
}

function writeCookie(name, value, settings){
	if(settings == null) Cookie.set(name, value);
	return Cookie.set(name, value, settings);
}
