	// dont run - set all uids on the server chkID(); 

	
	/*************************************************************************** 
	Checks if we have a cookie for this user, if not creates one
	************************************************************************** */
	function chkID()
	{
		
		alert("chkID called. userID cookie: " + readCookie2("userID"));
		
		if (readCookie2("userID") == null)
			{			
				//alert("Creating cookie - cookie must have been lost");
				var max = 100000;
				strTemp = String(Math.floor(Math.random()*max+1));
				strTemp1 = String(new Date().getTime());
				//alert("strTemp = " + strTemp + "   -   strTemp1 = " + strTemp1)
				strID = "js" + strTemp + strTemp1;
				createCookie1("userID", strID, 500);
				alert("userID cookie created: " + readCookie2("userID"));
			}
		else
			{
				//alert("userID cookie exists: " + readCookie2("userID"));
			}
	}

	
	/*************************************************************************** 
	generic function 
	************************************************************************** */
	function createCookie1(name,value,days)
	{
	
		if (days)
		{
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		
		document.cookie = name+"=" + value + expires + "; path=/";
	}
	
	/*************************************************************************** 
	generic function 
	************************************************************************** */
	function readCookie2(name) {
	  var nameEQ = name + "=";
	  var ca = document.cookie.split(';');
	  for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	  }
	  return null;
	}	
	
	
	/*************************************************************************** 
	generic function 
	************************************************************************** */
	function readCookie1(name)
	{
		n = name;
		//name = "menus['"+name+"']";
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		
		alert("Reading Cookie: " + ca);
		
		for(var i=0;i < ca.length;i++)
		{
			var c = ca[i];
			while (c.charAt(0)==' ') 
			{
				c = c.substring(1,c.length);
				if (c.indexOf(nameEQ) == 0) 
				{
					retVal = c.substring(nameEQ.length,c.length);
					return retVal;
				}
			}
		}
		return null;
	}
	
	/*************************************************************************** 
	generic function 
	************************************************************************** */
	function eraseCookie1(name)
	{
		createCookie1(name,"",-1);
	}	
	
	
