function readCookie(name)
{

	if(document.cookie == ''){
    	return false;
	}else{
    	return getCookieValue(name);
	}
}

function getCookieValue(name)
{
	var firstChar,lastChar;	
	var cookies = document.cookie;
//	alert(cookies);
	firstChar = cookies.indexOf(name);
	
	if(firstChar != -1)	{

		firstChar +=name.length + 1;		
		lastChar = cookies.indexOf(';', firstChar);	
		if(lastChar == -1){
			lastChar = cookies.length;
		}

	return cookies.substring(firstChar, lastChar);
	
	}
	else
	{	
		return 0;	
	}

}