function readCookie(name) 
{
	if (document.cookie == '') 
	{        
		return false;
	} 
	else
	{
		var firstChar, lastChar;
		var theBigCookie = document.cookie;

		firstChar = theBigCookie.indexOf(name);
		if(firstChar != -1)  
		{
			firstChar += name.length + 1;
			lastChar = theBigCookie.indexOf(';', firstChar);
			if(lastChar == -1) lastChar = theBigCookie.length;	    
			return unescape(theBigCookie.substring(firstChar, lastChar));
		} 
		else
		{
		   	// If there was no cookie of that name, return false.		
			return false;
		}		
	}
}