	function GetACookie() {
		var strName = "h-date";
		if (document.cookie.indexOf(strName) == -1)
		{
   			alert("Cookies must be enabled to use this site.\nFor information on how to enable cookies see the links at the bottom of this page.");
   			return false;
		}
		else
		{
		cookieStart = document.cookie.indexOf(strName);
		cookieValStart = (document.cookie.indexOf("=", cookieStart) + 1);
		cookieValEnd = document.cookie.indexOf(";", cookieStart);
		if (cookieValEnd == -1)
			{
			cookieValEnd = document.cookie.length;
			}
		cookieValue = document.cookie.substring(cookieValStart, cookieValEnd);
		}
		if (cookieValue = "True")
		{
			return ("True");
		}
	}

	function SetACookie(name,value,expires,path,domain,secure)
	{
                var strDNS = GetTheDNS();
                var exp = new Date();
                var expDays = 1; // number of days the cookie should last
                exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
	    	document.cookie = name + "=" +escape(value) +
	        ( (expires) ? ";expires=" + exp.toGMTString() : "") +
                ( (path) ? ";path=" + path : "") +
                //( (domain) ? ";domain=" + domain : "") +
        	( (domain) ? ";domain=" + strDNS : "") +
	        ( (secure) ? ";secure" : "");
                //alert(document.cookie);
		//    return true;
	}


	function GetTheDNS()
	{
		cookieDomain = document.location.hostname;
		if (cookieDomain.indexOf("h-date.com")!=-1)
		{
			return ("h-date.com");
		}
		else if (cookieDomain.indexOf("herpes-date.com")!=-1)
		{
			return ("herpes-date.com");
		}
		else if (cookieDomain.indexOf("zyberdate.com")!=-1)
		{
			return ("zyberdate.com");
		}
		else
		{
			return ("/");
		}
	}

        function CheckCookiesEnabled()
        {
              SetACookie('h-date','True','','/','','');
              if (GetACookie() == "True"){
                 alert('Cookies are enabled and you can use this website!');
                 return true;
              } else {
                 return false;
              }
        }
