function checkCookie(c_name)
{

	if ( getCookie(c_name) != "")
	{

		if (getCookie(c_name) == 1 )
		{
			//Since the TWC website does an auto-refresh when pages load, we need to make sure we accommodate.
			setCookie(c_name,"2",1);
			surveyCall();
			//document.write("1<br>" + getCookie("showSurvey"));

		}
		else if ( getCookie(c_name) == 2 )
		{
			//set it to 0 and show send the survey to the browser.
			setCookie(c_name,"0",1);
			//surveyCall();
			//document.write("2<br>" + getCookie("showSurvey"));

		}
		else
		{
			//This process will do nothing when in production.
			//document.write("The Cookie is NOT 1 or 2<br>" + getCookie("showSurvey"));
		}

	}
	else
	{
		setCookie(c_name,"1",1);
		//document.write("Just set the " + c_name + " cookie.  It's value is: " + getCookie(c_name));

	}

}


//This is where the cookie is set and defined
function setCookie(c_name,value,expiredays)
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	var domain = "www.timewarnercable.com/";
//	var domain = "localhost/";
	document.cookie = c_name + "=" + escape(value) + ((expiredays==null) ? "" : ";expires=" + exdate.toGMTString()) + ( (domain) ? "" : ";domain=" + domain + ";path=/");

}


function getCookie(c_name)
{
	if (document.cookie.length>0)
	{
		c_start=document.cookie.indexOf(c_name + "=");
		if (c_start!=-1)
		{
			c_start=c_start + c_name.length+1;
			c_end=document.cookie.indexOf(";",c_start);
			if (c_end==-1) c_end=document.cookie.length;
		    return unescape(document.cookie.substring(c_start,c_end));
		}
	}

	return "";

}


function getTextFromFlash()
{
	return location.href;
}

