/*
'Description Start
'***********************************************
'
'Name:         state_select
'
'Usage:        state_select(select_box_name, state_value, state_name, tab_index) 
'
'Description:  Builds the U.S. state select box with the name passed to this routine.
' 
'Example:      state_select('state_field_1', '--select--', '--Select--', '10') 
'
'Include name: scripts/js/state_select.js
'
'Parameters:   select_box_name - This is the name of the select box you want to define.
'                     starting_state_abbrev - This is the value of what should initially appear in the select box
'                     starting_state - This is what should initially appear in the select box
'                     tab_index - This is the tab order that the field appears in
'
'              
'***********************************************
'Description End
*/


function state_select(select_box_name, state_value, state_name, tab_index) {


	// if tabindex was passed in, use it, 
	if (tab_index != "") {  
		document.write("<SELECT NAME='" + select_box_name + "' tabindex='"+ tab_index + "'>");
	} else {
		document.write("<SELECT NAME='" + select_box_name + "'>");
	}	

	// if state name was passed in, assume state value was passed too
	if (state_name != "") { 
		document.write("		<OPTION SELECTED VALUE=" + state_value + ">" + state_name + "</option>");
	}
	document.write("		<OPTION VALUE='null'>--Select--</option>");
	document.write("		<OPTION VALUE='AL'>Alabama</option>");
	document.write("		<OPTION VALUE='AK'>Alaska</option>");
	document.write("		<OPTION VALUE='AZ'>Arizona</option>");
	document.write("		<OPTION VALUE='AR'>Arkansas</option>");
	document.write("		<OPTION VALUE='CA'>California</option>");
	document.write("		<OPTION VALUE='CO'>Colorado</option>");
	document.write("		<OPTION VALUE='CT'>Connecticut</option>");
	document.write("		<OPTION VALUE='DE'>Delaware</option>");
	document.write("		<OPTION VALUE='DC'>District of Columbia</option>");
	document.write("		<OPTION VALUE='FL'>Florida</option>");
	document.write("		<OPTION VALUE='GA'>Georgia</option>");
	document.write("		<OPTION VALUE='HI'>Hawaii</option>");
	document.write("		<OPTION VALUE='ID'>Idaho</option>");
	document.write("		<OPTION VALUE='IL'>Illinois</option>");
	document.write("		<OPTION VALUE='IN'>Indiana</option>");
	document.write("		<OPTION VALUE='IA'>Iowa</option>");
	document.write("		<OPTION VALUE='KS'>Kansas</option>");
	document.write("		<OPTION VALUE='KY'>Kentucky</option>");
	document.write("		<OPTION VALUE='LA'>Louisiana</option>");
	document.write("		<OPTION VALUE='ME'>Maine</option>");
	document.write("		<OPTION VALUE='MD'>Maryland</option>");
	document.write("		<OPTION VALUE='MA'>Massachusetts</option>");
	document.write("		<OPTION VALUE='MI'>Michigan</option>");
	document.write("		<OPTION VALUE='MN'>Minnesota</option>");
	document.write("		<OPTION VALUE='MS'>Mississippi</option>");
	document.write("		<OPTION VALUE='MO'>Missouri</option>");
	document.write("		<OPTION VALUE='MT'>Montana</option>");
	document.write("		<OPTION VALUE='NE'>Nebraska</option>");
	document.write("		<OPTION VALUE='NV'>Nevada</option>");
	document.write("		<OPTION VALUE='NH'>New Hampshire</option>");
	document.write("		<OPTION VALUE='NJ'>New Jersey</option>");
	document.write("		<OPTION VALUE='NM'>New Mexico</option>");
	document.write("		<OPTION VALUE='NY'>New York</option>");
	document.write("		<OPTION VALUE='NC'>North Carolina</option>");
	document.write("		<OPTION VALUE='ND'>North Dakota</option>");
	document.write("		<OPTION VALUE='OH'>Ohio</option>");
	document.write("		<OPTION VALUE='OK'>Oklahoma</option>");
	document.write("		<OPTION VALUE='OR'>Oregon</option>");
	document.write("		<OPTION VALUE='PA'>Pennsylvania</option>");
	document.write("		<OPTION VALUE='RI'>Rhode Island</option>");
	document.write("		<OPTION VALUE='SC'>South Carolina</option>");
	document.write("		<OPTION VALUE='SD'>South Dakota</option>");
	document.write("		<OPTION VALUE='TN'>Tennessee</option>");
	document.write("		<OPTION VALUE='TX'>Texas</option>");
	document.write("		<OPTION VALUE='UT'>Utah</option>");
	document.write("		<OPTION VALUE='VT'>Vermont</option>");
	document.write("		<OPTION VALUE='VA'>Virginia</option>");
	document.write("		<OPTION VALUE='WA'>Washington</option>");
	document.write("		<OPTION VALUE='WV'>West Virginia</option>");
	document.write("		<OPTION VALUE='WI'>Wisconsin</option>");
	document.write("		<OPTION VALUE='WY'>Wyoming</option>");
	document.write("</SELECT>");

}
