// Check if the Visitor is Logged In
//		If so, show their name 
//		written for www.ESCElkin.com 

	var name = "customer";

	var cookie_name, cookie_contents;
	var the_cookie = document.cookie;
	cookie_name = the_cookie.indexOf(name);	// Find the Beginning of the Cookie
	var equalFinder = cookie_name + name.length;

	if ((cookie_name != -1) && (the_cookie.charAt(equalFinder) == '=')) { // Customer cookie was found, so they're logged in 

		// Now work with the shopping cart cookie 
		var name = "item";
		var cookie_name, cookie_contents;
		var the_cookie = document.cookie;

		cookie_name = the_cookie.indexOf(name);	// Find the Beginning of the Cookie
		var equalFinder = cookie_name + name.length;

		if ((cookie_name != -1) && (the_cookie.charAt(equalFinder) == '=')) { // Cookie was Found 
			cookie_name += name.length + 1; // skip 'name' and '='
			cookie_contents = the_cookie.indexOf(';', cookie_name); // Find the End of the Cookie (find ";")
			if (cookie_contents == -1) { cookie_contents = the_cookie.length; }

			var broken_cookie = unescape(the_cookie.substring(cookie_name, cookie_contents));
			var broken_cookie = broken_cookie.replace(/\+/g," "); // replace all + with a whitespace 
			var final_cookie = broken_cookie.split("*");  // Split the contents, assuming they're linked with a * 

		}

		else { var final_cookie = "" }

		if (final_cookie.length == 1) { var items = "Item" }
		else { var items = "Items" }

		document.write("<a href='http://www.escelkin.com/cgi-bin/cart.cgi'>You have <b>" + final_cookie.length + "</b> " + items + " in Your Shopping Cart</a>");



	}

	else { document.write("<b>Welcome!</b> Please <a href='https://server1.web-wilkes.com/escelkin/cgi-bin/customer.cgi?login=new'>create an account</a> or <a href='http://www.escelkin.com/cgi-bin/customer.cgi'>sign in</a>") }
