// JavaScript Document

//alert("I am alive!!!");

// if the cookie isn't empty
if (document.cookie != "") {
	// get the value of the cookie.
	var theCookie = document.cookie;

	// extract the value of our cookie variable from the cookie.
	// ! note that this example only handles a single-variable cookie.
	theCookie = theCookie.substring(theCookie.length - 4);
	//birthday = demoString.substring(demoString.length - 4); 
	//theCookie = theCookie.substring((theCookie.indexOf("myVar=")+9),(theCookie.indexOf("myVar=")+9)+4);
}
else {
	// if there's no cookie, then set the tracker to the default label. 
	theCookie = null;
}

function set_cookie(name, value)
{
    document.cookie= name + "=" + escape(value);
	
	var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else
    {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
    {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}

