function getURLParam(strParamName){
	var strReturn = "";
	var strHref = window.location.href;
    var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
	if ( strHref.indexOf("?") > -1 ){
		var aQueryString = strQueryString.split("&");
	    for ( var iParam = 0; iParam < aQueryString.length; iParam++ )
	    {
			if (aQueryString[iParam].indexOf(strParamName + "=") > -1 )
			{
				var aParam = aQueryString[iParam].split("=");
				strReturn = aParam[1];
				break;
			}
	    }
	}
	return strReturn;
} 
	
	function errorPrint(){
		errorcode = getURLParam("errorcode");
		errorcontrol = getURLParam("errorcontrol");
		errorString = "";
		switch(errorcontrol){
			case "email%20address": errorString = "Email Address"; break;
			case "first%20name": errorString = "First Name"; break;
			case "last%20name": errorString = "Last Name"; break;
			case "company": errorString = "Company/Organization"; break;
			case "role": errorString = "Agent or Policyholder?"; break;
			case "subscription%20reason": errorString = "Reason for Subscription"; break;
			case "lid": errorString = "Newsletter Selection"; break;
		}
		
		switch(errorcode){
			case "1":
			case "6":
			case "7":
			case "9":
			case "10": 
				strError = "<p>An error occurred while attempting to save your subscriber information.  Please return to the form and try to submit your information again.</p><p>If you need additional assistance, please email <a href=\"mailto:info@thezenith.com\">info@thezenith.com</a>.  We apologize for the inconvenience.</p><a href=\"javascript:history.back();\"><img border=\"0\" src=\"http://www.thezenith.com/images/systemelements/Return_to_form.gif\"></a>";
				break;
			case "2":
				strError = "<p>A database error has occured.</p><p>If you need additional assistance, please email <a href=\"mailto:info@thezenith.com\">info@thezenith.com</a>.  We apologize for the inconvenience.</p><a href=\"javascript:history.back();\"><img border=\"0\" src=\"http://www.thezenith.com/images/systemelements/Return_to_form.gif\" alt=\"Return to form\"></a>";
				break;
			case "3":
			strError = "<p>One or more of the required fields (" + errorString + ") was not completed.   Please return to the form and try to submit your information again. </p><p>If you need additional assistance, please email <a href=\"mailto:info@thezenith.com\">info@thezenith.com</a>.  We apologize for the inconvenience.</p><a href=\"javascript:history.back();\"><img border=\"0\" src=\"http://www.thezenith.com/images/systemelements/Return_to_form.gif\" alt=\"Return to form\"></a>";
			break;
			case "4":
			case "5":
			strError = "<p>One or more of the required fields (" + errorString + ") contained invalid data.  Please return to the form and try to submit your information again. </p><p>If you need additional assistance, please email <a href=\"mailto:info@thezenith.com\">info@thezenith.com</a>.</p><a href=\"javascript:history.back();\"><img border=\"0\" src=\"http://www.thezenith.com/images/systemelements/Return_to_form.gif\" alt=\"Return to form\"></a>";
			break;
			case "8":
			strError = "<span style=\" color: #ac2b36; font-size: medium; font-weight: bold;\">Thank you!</span><p>Thank you for subscribing to Zenith's E-Newsletter! Congratulations on taking a proactive step towards managing your workers' compensation costs!</p> <p>For your reference, you were already registered for one or more of these e-newsletters.  Another way to change your subscription preferences is using the “Manage Subscriptions” link at bottom of each Zenith e-newsletter.</p> <a href=\"http://www.thezenith.com\">Click here to return to Zenith's homepage.</a></p>";
			break;
			case "12":
			strError = "<p>The subscriber you are attempting to register previously requested to be on Zenith's global unsubscribe list.</p><p>If you believe that this is an error, please email <a href=\"mailto:info@thezenith.com\">info@thezenith.com</a>.  We apologize for the inconvenience.</p><a href=\"javascript:history.back();\"><img border=\"0\" src=\"http://www.thezenith.com/images/systemelements/Return_to_form.gif\" alt=\"Return to form\"></a>";
			break;
		}
		document.write(strError);
	}	