    function createCookie(name,value)
    {
    	//This method will create cookie with the value for the name given to it.
    	if(typeof name != "undefined" && typeof value != "undefined")
    	{
	    	var days = true;
	    	if(days == null || days == "undefined")
	    	{
	    		days = fasle;
	    	}
			if (days) 
			{
				var date = new Date();
				date.setTime(date.getTime()+(2*60*60*1000));
				var expires = "; expires="+date.toGMTString();
				//var expires = ((expires == null) ? "" : ("; expires=" + expires.toGMTString()))
			}
			else 
			{
				var expires = "";
			}
			domain = ".entrepreneur.com";
			//TODO the domain have to be set for this
			document.cookie = name+"="+value+expires + ("; domain=" + domain);
		}
		else
		{
			//alert("Parameters passed to the createCookie is not correct \n Usage createCookie(cookieName,cookieValue)");
		}
	}
	
	function createCookieWithNoExpiry(name,value)
    {
    	//This method will create cookie with the value for the name given to it.
    	if(typeof name != "undefined" && typeof value != "undefined")
    	{
	    	var days = true;
	    	if(days == null || days == "undefined")
	    	{
	    		days = fasle;
	    	}
			if (days) 
			{
				var date = new Date();
				date.setTime(date.getTime()+(12*30*60*60*60*1000));
				var expires = "; expires="+date.toGMTString();
				//var expires = ((expires == null) ? "" : ("; expires=" + expires.toGMTString()))
			}
			else 
			{
				var expires = "";
			}
			domain = ".entrepreneur.com";
			//TODO the domain have to be set for this
			document.cookie = name+"="+value+expires + ("; domain=" + domain);
		}
		else
		{
			//alert("Parameters passed to the createCookie is not correct \n Usage createCookie(cookieName,cookieValue)");
		}
	}
		function readCookie(c_name)
		{
			//This method will check for the existence of the cookie with the specified format
			//For ex if the cookie name is zoho-ticket ,we can give input as '-ticket' and it will return 'zoho-ticket'
			//One exclution it will search for single isntance,it is valid in our case but it is not eneric
			var username = "";
			var cookinDoc = (document.cookie.split(";"));
			if(cookinDoc != null && cookinDoc != "undefined" && cookinDoc != "")
			{
				for(var i=0;i<cookinDoc.length;i++)
				{
					if(cookinDoc[i].indexOf(c_name) != -1)
					{
						username = (cookinDoc[i].split('=')[0]);
						return username
					}
				}
			}
			else
			{
				return ""
			}
		}
	
	
		//Cookie must be erased onload of the document.
	function eraseCookie( name, path, domain ) 
	{
		if( readCookie( name ) != null )
		{
			var Cname = readCookie(name);
			domain = ".entrepreneur.com";
			document.cookie = Cname + "=" +( ( path ) ? ";path=" + path : "") +( ( domain ) ? ";domain=" + domain : "" ) +";expires=Thu, 01-Jan-1970 00:00:01 GMT";
		}
		checkForCookieExist();
	}
	
	function eraseCookieWithoutReload( name,path, domain ) 
	{
		if( readCookie( name ) != null )
		{
			var Cname = readCookie(name);
			domain = ".entrepreneur.com";
			document.cookie = Cname + "=" +( ( path ) ? ";path=" + path : "") +( ( domain ) ? ";domain=" + domain : "" ) +";expires=Thu, 01-Jan-1970 00:00:01 GMT";
		}
	}
	
		function getCookieValue(name)
		{
			var cooName = readCookie(name);
			var tmpCookie = document.cookie.split(";");
			for(var i=0;i<tmpCookie.length;i++)
			{
				if(tmpCookie[i].indexOf(cooName) != -1)
				{
					var Cvalue = tmpCookie[i].split("=");
					//alert(" The value of cookie " + cooName + " is ::" + Cvalue[1]);
					return Cvalue[1];
				}
			}
			return ""
		}
	
    function extendExpiryTime()
	{
			var tmpCookie = document.cookie.split(";");
			for(var i=0;i<tmpCookie.length;i++)
			{
				if(tmpCookie[i].indexOf("EATICKET") != -1 || 
					tmpCookie[i].indexOf("USERID") != -1 ||
					tmpCookie[i].indexOf("USERNAME") != -1 ||
					tmpCookie[i].indexOf("FFT") != -1)
				{
					var Cvalue = tmpCookie[i].split("=");
					var nnam = Cvalue[0]
					var vval =  Cvalue[1];
					createCookie(nnam,vval);
				}
			}
	}
