	// Declare variables
	var segCookie, ampTokens, numSegs, segs;
	
	// Assign my default segment value if no cookie segments are available
	var firstSeg = '';
	var secondSeg = '';
	var thirdSeg = '';
	
	
	// Segment cookie name
	var cookieName = "DMSEG";
	
	// Grab the segment cookie
	if( (segCookie = getCookie(cookieName)) != null)
	{
	
	// Decode cookie
	segCookie = unescape(segCookie);
	
	// Split the segment cookie
	ampTokens = segCookie.split("&");
	
		// Check to make sure there are 6 tokens
		if(ampTokens.length >= 6)
		{
		
			// Split out the segments
			segs = ampTokens[5].split(",");
			if (segs.length > 0)
			
			{
			
				// Grab the highest priority segment
				firstSeg = segs[0];
							
				// Grab the highest priority segment
				secondSeg = segs[1];
		
				// Grab the highest priority segment
				thirdSeg = segs[2];
		
			}
		}
	}
	
	
	// Supporting function to extract cookie value
	function getCookie(n) {
	
		var co = document.cookie;
		var pos = co.indexOf(n+"=");
		return pos != -1 ? co.substring(pos+n.length+1,(co.indexOf("; ",pos)!= -1 ?
		co.indexOf("; ",pos):co.length)):null;
	}

	

