// ***********************
// Used to write width of
// City textbox in form
// Netscape displays much
// wider than IE and therefore
// must be shorter for page
// to format properly
function fcnWriteWidth()
{
	var strOut = '<input value="" type="text" comment="this.form.addr_city.focus()" onFocus="this.form.addr_city.select()" name="addr_city" size=';
	
	if (navigator.appName == "Netscape")
  		document.write(strOut + "10" + '">');
	else
  		document.write(strOut + "20" + '">');
}

function fcnWriteWidthtd()
{
	var strOuttd = '<td width=';      
		
	if (navigator.appName == "Netscape")
  		document.write(strOuttd + "185" + '">');
	else
  		document.write(strOuttd + "192" + '">');
}

// **********************
// code by Michael Gonzales
// changes values for select



var stateArray =  new Array("('Select State','',true,true)",
	"('Alabama', 'AL')",
	"('Alaska', 'AK')",
	"('Arizona', 'AZ')",
	"('Arkansas', 'AR')",
	"('California', 'CA')",
	"('Colorado', 'CO')",
	"('Connecticut', 'CT')",
	"('Delaware', 'DE')",
	"('District of Columbia', 'DC')",
	"('Florida', 'FL')",
	"('Georgia', 'GA')",
	"('Hawaii', 'HI')",
	"('Idaho', 'ID')",
	"('Illinois', 'IL')",
	"('Indiana', 'IN')",
	"('Iowa', 'IA')",
	"('Kansas', 'KS')",
	"('Kentucky', 'KY')",
	"('Louisiana', 'LA')",
	"('Maine', 'ME')",
	"('Maryland', 'MD')",
	"('Massachusetts', 'MA')",
	"('Michigan', 'MI')",
	"('Minnesota', 'MN')",
	"('Mississippi', 'MS')",
	"('Missouri', 'MO')",
	"('Montana', 'MT')",
	"('Nebraska', 'NE')",
	"('Nevada', 'NV')",
	"('New Hampshire', 'NH')",
	"('New Jersey', 'NJ')",
	"('New Mexico', 'NM')",
	"('New York', 'NY')",
	"('North Carolina', 'NC')",
	"('North Dakota', 'ND')",
	"('Ohio', 'OH')",
	"('Oklahoma', 'OK')",
	"('Oregon', 'OR')",
	"('Pennsylvania', 'PA')",
	"('Rhode Island', 'RI')",
	"('South Carolina', 'SC')",
	"('South Dakota', 'SD')",
	"('Tennessee', 'TN')",
	"('Texas', 'TX')",
	"('Utah', 'UT')",
	"('Vermont', 'VT')",
	"('Virginia', 'VA')",
	"('Washington', 'WA')",
	"('West Virginia', 'WV')",
	"('Wisconsin', 'WI')",
	"('Wyoming', 'WY')");
	
var provinceArray =  new Array("('Select Province','',true,true)",
	"('Alberta', 'AB')",
	"('British Columbia', 'BC')",
	"('Manitoba', 'MB')",
	"('New Brunswick', 'NB')",
	"('Newfoundland', 'NF')",
	"('Nova Scotia', 'NS')",
	"('Ontario', 'ON')",
	"('Prince Edward Island', 'PE')",
	"('Quebec', 'QC')",
	"('Saskatchewan', 'SK')");

function populateUSstate(inForm,selected) 
{  
	if (selected == 'United States') 
	{
   		for (var i=0; i < stateArray.length; i++) 
		{
      			eval("inForm.addr_state.options[i]=" + "new Option" + stateArray[i]);
   		}
   
		if ( navigator.appName == 'Netscape') 
		{
      			if (parseInt(navigator.appVersion) < 4) 
			{
        			//window.history.go(0)
      			}
      			else 
			{    	
         			if (navigator.platform == 'Win32' || navigator.platform == 'Win16') 
				{
           				//window.history.go(0)
         			}
      			}
   		}
	}
	else if (selected == 'Canada')
	{
   		while (provinceArray.length < inForm.addr_state.options.length) 
		{
      			inForm.addr_state.options[(inForm.addr_state.options.length - 1)] = null;
   		}
   
		for (var i=0; i < provinceArray.length; i++) 
		{
      			eval("inForm.addr_state.options[i]=" + "new Option" + provinceArray[i]);
   		}
   
		if ( navigator.appName == 'Netscape') 
		{
      			if (parseInt(navigator.appVersion) < 4) 
			{
         			//window.history.go(0)
      			}
      			else
			{    	
         			if (navigator.platform == 'Win32' || navigator.platform == 'Win16') 
				{
            				//window.history.go(0)
         			}
      			}
   		}
	}  
	else 
	{
	}

	if (selected == 'Other') 
	{
	   	newCountry = "";
	
	   	while (newCountry == "")
		{
	      		newCountry=prompt ("Please enter the name of your country.", "");
	   	}
	   
		if (newCountry != null) 
		{
	      		inForm.addr_state.options[(inForm.addr_state.options.length-1)]=new Option(newCountry,newCountry,true,true);
	      		inForm.addr_state.options[inForm.addr_state.options.length]=new Option('Other, not listed','Other');
	   	}
	}

	if(inForm.addr_state.options[0].text == 'Select country') 
	{
	   	inForm.addr_state.options[0]= null;
	}
}


function bookmark()
{
   	if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) 
	{
      		var url="http://www.fsnfuneralhomes.com";
      		var title="FSN Funeral Homes";

      		window.external.AddFavorite(url,title);
   	}
}
