/////////////////////////////////////////////////////////////////////////////////////////////////

function read_cookie (key, skips)
{
	// Set skips to 0 if parameter was omitted:
	if (skips == null)
		skips = 0;

	// Get cookie string and separate into individual cookie phrases:
	var cookie_string = "" + document . cookie;
	var cookie_array = cookie_string . split ("; ");

	// Scan for desired cookie:
	for (var i = 0; i < cookie_array . length; ++ i)
	{
		var single_cookie = cookie_array [i] . split ("=");
		if (single_cookie . length != 2)
			continue;
		var name  = unescape (single_cookie [0]);
		var value = unescape (single_cookie [1]);

		// Return cookie if found:
		if (key == name && skips -- == 0)
			return value;
	}

	// Cookie was not found:
	return null;
}

uid = (read_cookie('uid',null) != null)?read_cookie('uid',null):'0';
visitNum = (read_cookie('visitNum',null) != null)?read_cookie('visitNum',null):'0';


//alert("uid=" + uid + "\n\nvisitNum=" + visitNum + "\n")

function CheckLogin()
{
	if(uid == '0' || visitNum<2)
	{
		theLink = "http://www.kiddonet.com/scripts/cgi/loginall_ex/all_entry.pl?target=" + self.location.href;
		self.location.replace(theLink);
	}



}


  