////////////////////////////////////////////////////////////////////////////
// PurchaseState.js ///////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////

var PurchaseCountries = Object();


PurchaseCountries['In Store'] = 'United States|Canada|Afghanistan|Albania|Algeria|Andorra|Angola|Anguilla|Antigua/Barbuda|Arctic Ocean|Argentina|Armenia|Aruba|Assorted|Atlantic Ocean (North)|Atlantic Ocean (South)|Australia|Austria|Azerbaijan|Bahamas|Bahrain|Bangladesh|Barbados|Belarus|Belgium|Belize|Benin|Bermuda|Bhutan|Bolivia|Bosnia-Herzegovina|Botswana|Brazil|Brunei|Bulgaria|Burkina Faso|Burma (Myanmar)|Burundi|Cambodia|Cameroon|Cape Verde|Caribbean Sea|Central African Republic|Chad|Chile|China|Colombia|Comoros|Congo, Dem.|Congo, Rep.|Costa Rica|Cozumel|Croatia|Cuba|Cyprus|Czech Republic|Denmark|Djibouti|Dominica|Dominican Republic|East Timor|Ecuador|Egypt|El Salvador|Equatorial Guinea|Eritrea|Estonia|Ethiopia|Fiji|Finland|France|Gabon|Gambia|Georgia|Germany|Ghana|Greece|Greek Isles|Greenland|Grenada|Guadeloupe|Guatemala|Guinea|Guinea-Bissau|Guyana|Haiti|Honduras|Hungary|Iceland|India|Indian Ocean|Indonesia|Iran|Iraq|Ireland|Israel|Italy|Jamaica|Japan|Jordan|Kazakhstan|Kenya|Kiribati|Korea (north)|Korea (south)|Kuwait|Kyrgyzstan|Laos|Latvia|Lebanon|Lesotho|Liberia|Libya|Liechtenstein|Lithuania|Luxembourg|Macedonia|Madagascar|Malawi|Malaysia|Maldives|Mali|Malta|Martinique|Mauritania|Mauritius|Mediterranean Sea|Mexico|Micronesia|Moldova|Monaco|Mongolia|Montserrat|Morocco|Mozambique|Namibia|Nauru|Nepal|Netherlands Antilles|Netherlands|New Zealand|Nicaragua|Niger|Nigeria|Norway|Oceania|Oman|Pacific Ocean (North)|Pacific Ocean (South)|Pakistan|Palau|Panama|Papua New Guinea|Paraguay|Peru|Philippines|Poland|Portugal|Puerto Rico|Qatar|Romania|Russian Federation|Rwanda|Samoa|San Andres|San Marino|Sao Tome/Principe|Saudi Arabia|Senegal|Serbia/Montenegro (Yugos|Seychelles|Sierra Leone|Singapore|Slovakia|Slovenia|Somalia|South Africa|Spain|Sri Lanka|St Vincent/Grenadines|St. Barts|St. Kitts/Nevis|St. Lucia|St. Martin/Sint Maarten|Sudan|Suriname|Swaziland|Sweden|Switzerland|Syria|Taiwan|Tajikistan|Tanzania|Thailand|Togo|Tonga|Trinidad/Tobago|Tunisia|Turkey|Turkmenistan|Turks/Caicos|Tuvalu|Uganda|Ukraine|United Arab Emirates|United Kingdom|Uruguay|Uzbekistan|Vanuatu|Vatican City|Venezuela|Vietnam|Yemen|Zambia|Zimbabwe';
PurchaseCountries['Mail Order'] = '';
PurchaseCountries['Online'] = '';
PurchaseCountries['Other'] = '';
////////////////////////////////////////////////////////////////////////////

var PurchaseStates = Object();

//Africa

//North America
PurchaseStates['Canada'] = 'Alberta|British Columbia|Manitoba|New Brunswick|Newfoundland and Labrador|Northwest Territories|Nova Scotia|Nunavut|Ontario|Ottawa|Prince Edward Island|Quebec|Saskatchewan|Yukon Territory';
PurchaseStates['United States'] = 'Alabama|Alaska|Arizona|Arkansas|California|Colorado|Connecticut|Delaware|Georgia|Kentucky|Hawaii|Idaho|Illinois|Indiana|Iowa|Florida|Kansas|Kentucky|Louisiana|Maine|Maryland|Massachusets|Michigan|Minnesota|Mississippi|Missouri|Montana|Nebraska|Nevada|New Hampshire|New Jersey|New Mexico|New York|North Carolina|North Dakota|Ohio|Oklahoma|Oregon|Pennsylvania|Rhode Island|South Carolina|South Dakota|Tennessee|Texas|Utah|Vermont|Virginia|Washington|Washington DC|West Virginia|Wisconsin|Wyoming';

////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////

function setRegions()
{
	for (PurchaseMethod in PurchaseCountries)
		document.write('<option value="' + PurchaseMethod + '">' + PurchaseMethod + '</option>');
}
function setCustomerCountries()
{
	CustomerCountryArr = PurchaseCountries['In Store'].split('|');
		for (var i = 0; i < CustomerCountryArr.length; i++)
			document.write('<option value="' + CustomerCountryArr[i] + '">' + CustomerCountryArr[i] + '</option>');
}

function set_PurchaseCountry(oRegionSel, oCountrySel, oCity_StateSel)
{
	var PurchaseCountryArr;
	oCountrySel.length = 0;
	oCity_StateSel.length = 0;
	var PurchaseMethod = oRegionSel.options[oRegionSel.selectedIndex].text;
	if (PurchaseCountries[PurchaseMethod])
	{
		oCountrySel.disabled = false;
		oCity_StateSel.disabled = true;
		oCountrySel.options[0] = new Option('SELECT COUNTRY','');
		PurchaseCountryArr = PurchaseCountries[PurchaseMethod].split('|');
		for (var i = 0; i < PurchaseCountryArr.length; i++)
			oCountrySel.options[i + 1] = new Option(PurchaseCountryArr[i], PurchaseCountryArr[i]);
		//document.getElementById('txtPurchaseMethod').innerHTML = PurchaseMethod;
		//document.getElementById('txtplacename').innerHTML = '';
	}
	else oCountrySel.disabled = true;
	 oCity_StateSel.disabled = true;
}



function set_PurchaseState(oCountrySel, oCity_StateSel)
{
	var PurchaseStateArr;
	oCity_StateSel.length = 0;
	var PurchaseCountry = oCountrySel.options[oCountrySel.selectedIndex].text;
	if (PurchaseStates[PurchaseCountry])
	{
		oCity_StateSel.disabled = false;
		oCity_StateSel.options[0] = new Option('SELECT FROM LIST','');
		PurchaseStateArr = PurchaseStates[PurchaseCountry].split('|');
		for (var i = 0; i < PurchaseStateArr.length; i++)
			oCity_StateSel.options[i+1] = new Option(PurchaseStateArr[i],PurchaseStateArr[i]);
		//document.getElementById('txtplacename').innerHTML = PurchaseCountry;
	}
	else oCity_StateSel.disabled = true;
}

function print_PurchaseState(oCountrySel, oCity_StateSel)
{
	var PurchaseCountry = oCountrySel.options[oCountrySel.selectedIndex].text;
	var PurchaseState = oCity_StateSel.options[oCity_StateSel.selectedIndex].text;
	//if (PurchaseState && PurchaseStates[PurchaseCountry].indexOf(PurchaseState) != -1)
		//document.getElementById('txtplacename').innerHTML = PurchaseState + ', ' + PurchaseCountry;
	//else document.getElementById('txtplacename').innerHTML = PurchaseCountry;
}