function getParam() {
//alert("in function");
	var searchString = document.location.search;
	if (searchString != "") {	
			// strip off the leading '?'
			searchString = searchString.substring(1);
			
			var nvPairs = searchString.split("&");
			
			for (i = 0; i < nvPairs.length; i++)
			{
				 var nvPair = nvPairs[i].split("=");
				 var name = nvPair[0];
				 var value = nvPair[1];
				 //alert(name+" "+value);
				
				if (name == "errorcode") { var errorCode = value };
				if (name == "errorcontrol") { var errorControl = value.replace(/%20/,"&nbsp;") };
			} // end loop
			//alert("errorCode: "+errorCode+" errorControl: "+errorControl);
			
			// evulate error code and insert errorControl as needed
			 if (errorCode != null) {
			 	//alert("in null");
				if (errorCode == 1 || errorCode == 5 || errorCode == 6 || errorCode == 7 || errorCode == 9 || errorCode == 10) {
					//alert("in first error code");
					var message = "<h3><span class=\"title\">Sorry</span></h3><p class=\"content1\">We're having trouble saving your subscriber information.";
					message += " Please <a href=\"/subscribe.html\">re-enter</a> your information and click submit.</p>";
				} else if (errorCode == 2 || errorCode == 13) {
					var message = "<h3><span class=\"title\">Sorry</span></h3><p class=\"content1\">We're having trouble saving your subscriber information. Please call us at 800-367-5533.</p>";
				} else if (errorCode == 3 || errorCode == 4) {
					var message = "<h3><span class=\"title\">Sorry</span></h3><p class=\"content1\">We're having trouble recognizing one or more of your entries.";
					// errorControl returns the missing field
					if (errorControl != null) {
						message += " Please <a href=\"/subscribe.html\">re-enter</a> your "+errorControl+" and click submit."
					}
					message += "</p>";
				} else if (errorCode == 8) {
					var message = "<h3><span class=\"title\">Thank You</span></h3><p class=\"content1\">Thank you for subscribing to Elixir&reg; Strings News.</p>";
				} else if (errorCode == 12) {
					var message = "<h3><span class=\"title\">Sorry</span></h3><p class=\"content1\">You've previously unsubscribed from receiving emails from us.";  
					message += " If you would like to receive emails in the future, please <a href=\"MAILTO:elixirstrings@wlgore.com\">send us an email.</a></p>";
				} else if (errorCode > 13) {
							var message = "<h3><span class=\"title\">Sorry</span></h3><p class=\"content1\">We're having trouble saving your subscriber information. Please call us at 800-367-5533.</p>";
				}// end of evaluating errorCode's
			document.write(message);
			} // end if errorCode null
			
	} else { //if searchstring is null
		var message = "<h3><span class=\"title\">Sorry</span></h3><p class=\"content1\">We're having trouble saving your subscriber information. Please call us at 800-367-5533.</p>";
		document.write(message);
	} // end searchstring null error check
} // end function getParam