function SetDemoCookie() {
    var xDate = new Date();
    xDate.setDate(xDate.getDate()+365);
    document.cookie = "registered = true; expires="+xDate.toGMTString();
    alert(document.cookie);
}
	

function DemoCookie(Demo){
	if (document.cookie.indexOf("registered=true") == -1)
	{
		/* switch(Demo)
		{
		case 1:
		    document.cookie = "RegDemo = " + Demo + ";path=/;"
			window.location = "/forms/signup-full-demo.aspx";
		    break;
		case 2:
		    document.cookie = "RegDemo = " + Demo + ";path=/;"
			window.location = "/forms/signup-full-demo.aspx";
		    break;
		case 3:
		    document.cookie = "RegDemo = " + Demo + ";path=/;"
			window.location = "/forms/signup-full-demo.aspx";
		    break;
		case 4:
		    document.cookie = "RegDemo = " + Demo + ";path=/;"
			window.location = "/forms/signup-quick-tour-individual.aspx";
		    break;
		case 5:
		    document.cookie = "RegDemo = " + Demo + ";path=/;"
			window.location = "/forms/signup-quick-tour-bundles.aspx ";
		    break;
		case 6:
		    document.cookie = "RegDemo = " + Demo + ";path=/;"
			window.location = "/forms/signup-quick-tour-bundles.aspx ";
		    break;
		case 7:
		    document.cookie = "RegDemo = " + Demo + ";path=/;"
			window.location = "/forms/signup-quick-tour-bundles.aspx ";
		    break;
		default: */
		    document.cookie = "RegDemo = " + Demo + ";path=/;"
			window.location = "/forms/signup-full-demo.aspx";
		    /* break;    
		} */
	}
	else
	{
		switch(Demo)
		{
		case 1:
		    window.location = "/demo/demo-community-builder.aspx"
		    //alert("demo-community-builder.aspx");
		    break;
		case 2:
		    window.location = "/demo/demo-feedback-intelligence.aspx"
		    //alert("demo-feedback-intelligence.aspx");
		    break;
		case 3:
		    window.location = "/demo/demo-vovici-v4.aspx"
			//alert("demo-vovici-v4.aspx");
		    break;
		case 4:
		    window.location = "/demo.html"
			//alert("demo-vovici-v4.aspx");
		    break;
		case 5:
		    window.location = "/survey-solutions/VOC_demo.html"
			//alert("demo-vovici-v4.aspx");
		    break;
		case 6:
		    window.location = "/survey-solutions/CustomerSupport_demo.html"
			//alert("demo-vovici-v4.aspx");
		    break;
		case 7:
		    window.location = "/survey-solutions/VOE_demo.html"
			//alert("demo-vovici-v4.aspx");
		    break;
		default:
		    window.location = "/demo/index.aspx"
		    //alert("Default");
		    break;    
		}
	}
}

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 setCookie(c_name,value,expiredays)
{var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
";expires="+exdate.toGMTString()+";path=/;"
}

function WebinarCookie(Webinar){
	if (document.cookie.indexOf("registered=true") == -1)
	{
		    document.cookie = "RegWebinar = " + Webinar + ";path=/;"
			//window.location = "/forms/signup-recorded-webinars.aspx";
			window.location = "/forms/webinars/signup-recorded-" + Webinar + ".aspx";
	}
	else
	{
		if (Webinar.length > 1)
		{
		    var webinarUrl;
		    webinarUrl = "/demo/webinar-recorded-" + Webinar + ".aspx";
		    //alert(webinarUrl);
		    window.location = webinarUrl
		}
		else
		{
		    window.location = "/about/research-webcasts.aspx"
		    //alert("Default");
		}
	}
}