function test()
{
	var url = window.location.href;
    
	var webId = getParamValue(url, "MM_webID");
	var zipValid = getParamValue(url, "zipValid");
	var zip = getParamValue(url, "zip");

	if (zip != null)
	{
		document.landingPage.zipCode.value = zip;
	}
	if (zipValid != null)
	{
		alert("The zip code is invalid");
	}
	//alert("WebId: "+webId+"\nZipValid: "+zipValid);
	if (webId != null)
    {
        document.landingPage.MM_webID.value = webId;
    }
}


function getParamValue( url, name )
{
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );

  var results = regex.exec( url );
  if( results == null )
    return null;
  else
    return results[1];
}

function addParam (url, param)
{
	// nvp[0] will equal the param name
	// nvp[1] will equal the param value
	nvp = param.split("=");

	// see if the current url contains this parameter
	value = getParamValue(url,nvp[0]);

	if (value != null)
	{
		// the parameter already exists, so we need to replace the value
		//alert (nvp[0] + "was found");

		// Here There be Dragons...
		var oldNVP = nvp[0]+"="+value;
		url = url.replace(oldNVP,param);

	}
	else
	{
		// the parameter does not exist, so add the param to the end of
		// the current url
		//alert (nvp[0] + "was not found");
		if (url.indexOf('?')==-1)
		{
			url = url + '?' + param;
		}
		else
		{
			url = url + '&' + param;
		}
	}
	//alert ("NAME VALUE PAIR:" +nvp);
	return url;


}

function selectLOB(choice){
    //alert("Property Type is: " + choice);
    if (choice=="Auto")
    {
        if (document.getElementById) {
        document.landingPage.lob.value="Auto";
        document.landingPage.product.value="AutoSimple";
        //alert("Product is: " + document.landingPage.product.value);
        //alert("Product is Auto: " + choice);
        }
        else
        {
        landingPage.lob.value="Auto";
        landingPage.product.value="AutoSimple";
        //alert("Product is: " + landingPage.product.value);
        //alert("Product is Auto: " + choice);
        };
    }
    else
    {
        if (document.getElementById) {
            document.landingPage.lob.value="Property";
            document.landingPage.product.value="PropSimple";
            //alert("Product is: " + document.landingPage.product.value);
            //alert("Product is Auto: " + choice);
            }
            else
            {
            landingPage.lob.value="Property";
            landingPage.product.value="PropSimple";
            //alert("Product is: " + document.landingPage.product.value);
            //alert("Product is Auto: " + choice);
            };
    }
}