
// create a new DropDownList object
// values -> Select ID, Options List, Select Size, Cookie Name, Cookie Life (in days)

	var ddl    = new DropDownList ('state', DropDownList.STATE_LIST, 1, 'org.tiaa-cref.js.state_select', 365);
	var sel    = ddl.getSelectObject();
	
	var btn = new Image();
		btn.name = 'submit';
		btn.alt = 'Go';
		btn.className = 'go';
		btn.src = '/ucm/groups/content/@ap_ucm_p_dam/documents/images/tiaa02027915.jpg';
		btn.onclick = function () {
			if (sel.selectedIndex > 0) {
				var state = sel[sel.selectedIndex].value;
				// use the Drop Down List provided method for setting my cookie
				ddl.setCookie(state);
				location.href = '/public/products-services/after-tax-annuities/policies/ata_products_by_state.html?pageType=StateAnnuity&state='+state;
			}
		}
		
	var my_form = document.createElement('form');
		my_form.name = 'stateselectform';
		my_form.id   = 'stateselectform';
		my_form.appendChild(sel);
		my_form.appendChild(btn);
	
	function drawDropDownList() {
		var cont = document.getElementById('stateselectcontainer');
		if (cont) {
			var txt = cont.firstChild;
			cont.replaceChild(my_form,txt);
			ddl.setSelectedIndex();	
		}
	}
	
	// add the init method to the window or document onload event
	if (window.attachEvent) { window.attachEvent('onload', drawDropDownList); }
	else if (window.addEventListener) { window.addEventListener('load', drawDropDownList, false); }
	else { document.addEventListener('load', drawDropDownList, false); }

