// javascript to set and track cookies for metrics

		var now = new Date();
		var nowMonth = now.getMonth();
		if (nowMonth < 10) {
			nowMonth = "0" + (nowMonth+1);
		}
		//document.write(nowMonth);

		var now = new Date();
		var nowDay = now.getDate();
		if (nowDay < 10) {
			nowDay = "0" + (nowDay);
		}
		//document.write(nowDay);

		var now = new Date();
		var nowYear = now.getYear();
		//document.write(nowYear);

		var cookieDate = nowMonth + "-" + nowDay + "-" + nowYear;
		//document.write(cookieDate);

		function get_randomNum() {
			var ranNumMetrics	=	Math.random();
			ranNumMetrics 		= 	ranNumMetrics.toString();
			ranNumMetrics		=	ranNumMetrics.substring(2,17);
		    return ranNumMetrics;
		}
		var metricsIDNumber=get_randomNum();
		//document.write (metricsIDNumber);

		function setMetricsCookie(name, value, thedomain) {
			if (value != null && value != "")
				var today 	= 	new Date();
				var expiry 	= 	new Date(today.getTime() + 3652*24*60*60*1000);
				//document.write (today);
				//document.write (expiry.toGMTString());
		   		document.cookie=name + "=" + cookieDate + ":" + escape(value) + "; expires=" + expiry.toGMTString() + "; path=/; domain=" + thedomain;
		}

		function getMetricsCookie(name) {
			var gwMetricsCookie = document.cookie;
			name += "=";
		    var i = 0;
		    while (i < gwMetricsCookie.length) {
		   		var offset = i + name.length;
		      	if (gwMetricsCookie.substring(i, offset) == name) {
		        	var endstr = gwMetricsCookie.indexOf(";", offset);
		        	if (endstr == -1) endstr = gwMetricsCookie.length;
		        		return unescape(gwMetricsCookie.substring(offset, endstr));
		      	}
		      	i = gwMetricsCookie.indexOf(" ", i) + 1;
		      	if (i == 0) break;
		    }
		   return null;
		}

	if (!getMetricsCookie("GWWMCOWSPOTS")) {
		setMetricsCookie("GWWMCOWSPOTS", metricsIDNumber, ".gateway.com");
  	}

	if (getMetricsCookie("GWWMCOWSPOTS")) {
			var name = "GWWMCOWSPOTS";
			var gwMCookie = document.cookie;
			name += "=";
		    var i = 0;
		    while (i < gwMCookie.length) {
		   		var offset = i + name.length;
		      	if (gwMCookie.substring(i, offset) == name) {
		        	var endstr = gwMCookie.indexOf(";", offset);
		        	if (endstr == -1) endstr = gwMCookie.length;
		        		var CookieData = unescape(gwMCookie.substring(offset, endstr));
		      	//document.write (CookieData);
		      	}
		      	i = gwMCookie.indexOf(" ", i) + 1;
		      	if (i == 0) break;
		    }

		    var offset2 = 0;
		    var y = 0;

		    while (y < CookieData.length) {
		   		var endstr2 = CookieData.indexOf(":", offset2);
					if (endstr2 == -1) endstr2 = CookieData.length;
						var CookieDate = unescape(CookieData.substring(offset2, endstr2));
				//document.write (CookieDate)
				i = CookieData.indexOf(" ", y) + 1;
		      	if (y == 0) break;
			}
			if ((CookieDate == "8-23-2001") || (CookieDate == "8-24-2001") || (CookieDate == "8-25-2001") || (CookieDate == "8-26-2001") || (CookieDate == "8-27-2001") || (CookieDate == "8-28-2001") || (CookieDate == "8-29-2001")  || (CookieDate == "8-30-2001") || (CookieDate == "30-30-2001") || (CookieDate == "31-31-2001") || (CookieDate == "01-1-2001") || (CookieDate == "02-2-2001") || (CookieDate == "03-3-2001") || (CookieDate == "04-4-2001") || (CookieDate == "05-5-2001") || (CookieDate == "06-6-2001"))
				setMetricsCookie("GWWMCOWSPOTS", metricsIDNumber, ".gateway.com");
	}
