function Country(state_label, zip_label)
{
	this.state_label = state_label;
	this.zip_label = zip_label;
}

function populate_states(country, field, state_label, zip_label)
{
	optionList = document.getElementById(field).options;
	for (i = optionList.length; i >= 0; i--){
		optionList[i] = null;
	}

	if(countries[country])
	{
		document.getElementById(field).disabled=false;
		if(countries[country].zip_label != "")
			document.getElementById(zip_label).innerHTML  = countries[country].zip_label+":";
		else document.getElementById(zip_label).innerHTML = "Zip:";
		if(countries[country].state_label != "")
			document.getElementById(state_label).innerHTML = countries[country].state_label+":";
		else document.getElementById(state_label).innerHTML = "State:";
		optionList[0] = new Option("-- Select "+countries[country].state_label+" --","");

		for(i=0; i<countries[country].states.length; i++)
		{
			optionList[i+1] = new Option(countries[country].states[i], countries[country].abbrv[i]);
		}

		if(document.getElementById(field).className != "input_err" && document.getElementById(field).className != "input_ok") document.getElementById(field).className = "input_req";
	}
	else
	{
		document.getElementById(field).options[0] = new Option("N/A","N/A");
		document.getElementById(field).disabled=true;
		document.getElementById(zip_label).innerHTML = "Zip:";
		document.getElementById(state_label).innerHTML = "State:";
		document.getElementById(field).className = "input_opt";
	}
}

function show_window_centered( link, title, w, h )
{
	var top		= (screen.height - h)/2;
	var left	= (screen.width - w)/2;

	window.open(link, title, 'toolbar=no,titlebar=no, width=' + w + ',height=' + h + ',resizable,left=' + left + ',top=' + top); 	
}

function show_window_centered_with_options( link, title, w, h, user_options )
{
	var top		= (screen.height - h)/2;
	var left	= (screen.width - w)/2;
	
	if ( user_options )
		user_options = ',' + user_options;

	window.open(link, title, 'width=' + w + ',height=' + h + ',left=' + left + ',top=' + top + user_options); 	
}