// Show info layer
function i85appear(appearLayer) {
		
	if (typeof lastAppear=="undefined") {
		// do nothing
	} else {
		new Effect.Fade(lastAppear, {duration: 0.4, queue: {position:'front', scope: 'main'} });	
		// target = document.getElementById(lastAppear);
		// target.style.display = "none";
	}
	new Effect.Appear(appearLayer, {duration: 0.4, queue: {position:'end', scope: 'main'} });
	// target = document.getElementById(appearLayer);
	// target.style.display = "block";
		
	lastAppear = appearLayer;
}

// Show arrow
function i85arrow(appearArrow) {
	if (typeof lastArrow=="undefined") {
		// do nothing
	} else {
		target = document.getElementById(lastArrow);
		target.style.visibility = "hidden";  	
	}
	target = document.getElementById(appearArrow);
	target.style.visibility = "visible";
		
	lastArrow = appearArrow;	
}

// Slidedown layer
function i85slide(slideLayer) {	
	if (typeof lastSlide=="undefined") {
		lastSlide = 'intro';
	}
	
	if (lastSlide != slideLayer) {
		new Effect.BlindUp(lastSlide, {queue: {position:'front', scope: 'nav'} });
		new Effect.BlindDown(slideLayer, {queue: {position:'end', scope: 'nav'} });
	}
	
	lastSlide = slideLayer;
}

// Set a cookie
function setCookie(cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+expire.toGMTString();
}

// Erase a cookie
function eraseCookie(cookieName) {
	setCookie(cookieName,"",-1);
}

// Read a cookie
function readCookie(name)
{
  var ca = document.cookie.split(';');
  var nameEQ = name + "=";
  for(var i=0; i < ca.length; i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
    }
  return null;
}