<!--
var fields = new Array("firstname", "lastname", "email", "email2", "company", "address", "boxnum", "city", "state", "zip", "phone", "phone1", "phone2", "phone3", "phone4", "fax1", "fax2", "fax3", "brokerdealer");

// this function is called when the form is submitted
function saveCookie()
{
	// first get the cookie, in case it already exists, we will update it
	var nfcomforms = getCookie('nfcomforms');
	if(isEmpty(nfcomforms))
	{
		var nfcomforms = new Array();
	}
	else
	{
		var nfcomforms = unstringify(nfcomforms);
	}
	
	// update the values in the cookie array
	for(i in fields)
	{
		eval('if(!isUndefined(document.free.' + fields[i] + ')) { nfcomforms["' + fields[i] + '"] = document.free.' + fields[i] + '.value; }');
	}
	if(!isUndefined(document.free.occupation))
		nfcomforms["occupation"] = document.free.occupation.options[document.free.occupation.selectedIndex].value;
	if(!isUndefined(document.free.country))
		nfcomforms["country"] = document.free.country.options[document.free.country.selectedIndex].value;

	var expiration_date = new Date("December 31, 2023");
	// save the cookie array to the browser
	document.cookie = "nfcomforms=" + stringify(nfcomforms) +"; path=/; expires=" + expiration_date;

}


// prepopulate the form fields with any values from the cookie
var nfcomformsStr = getCookie('nfcomforms');
if((nfcomformsStr != '') && (nfcomformsStr != null))
{
	var nfcomforms = unstringify(nfcomformsStr);
	for(i in fields)
	{
		var field = fields[i];
		if(!isUndefined(nfcomforms[field]))
		{
			//if(field == 'address')
			//	eval('alert("defined: " + !isUndefined(document.free.address) + "; value: ' + nfcomforms["address"] + '");');
			eval('if(!isUndefined(document.free.' + field + ')) { document.free.' + field + '.value = nfcomforms["' + field + '"]; }');
		}
	}
	
	if(!isUndefined(nfcomforms['email']))
		eval('if(!isUndefined(document.free.email2)) { document.free.email2.value = document.free.email.value } ');
	
	// occupation dropdown
	if(nfcomforms["occupation"] && !isUndefined(document.free.occupation))
	{
		for(var j=0;j<document.free.occupation.length;j++)
		{
			if(document.free.occupation.options[j].value == nfcomforms["occupation"])
			{
				document.free.occupation.options[j].selected = true;
			}
		}
	}

	// country dropdown
	if(nfcomforms["country"] && !isUndefined(document.free.country))
	{
		for(var k=0;k<document.free.country.length;k++)
		{
			if(document.free.country.options[k].value == nfcomforms["country"])
			{
				document.free.country.options[k].selected = true;
			}
		}
	}
}


-->
