var countries = Object();

countries['India'] = 'Andaman & Nicobar|Andhra Pradesh|Arunachal Pradesh |Assam |Bihar |Chandigarh |Chhattisgarh |Dadar And Nagar Haveli |Daman and Diu |Delhi|Goa|Gujarat|Haryana |Himachal Pradesh|Jammu and Kashmir |Jharkhand|Karnataka|Kerala|Lakshadweep|Madhya Pradesh|Maharashtra|Manipur|Meghalaya|Mizoram|Nagaland|Orissa|Puducherry|Punjab|Rajasthan|Sikkim|Tamil Nadu|Tripura|Uttar Pradesh|Uttarakhand|West Bengal';

var city_states = Object();

city_states['Andaman & Nicobar'] = 'Nicobar|North and Middle Andaman|South Andaman';
city_states['Andhra Pradesh'] = 'Adilabad|East Godavari|Kadapa|Krishna|Medak|Nizamabad|Srikakulam|Warangal|Anantapur|Guntur|Karimnagar|Kurnool|Nalgonda|Prakasam|Visakhapatnam|West Godavari|Chittoor|Hyderabad|Khammam|Mahabubnagar|Nellore|Rangareddy|Vizianagaram';
city_states['Arunachal Pradesh']='Anjaw|East Kameng|Lohit|Papum Pare|Upper Siang|West Siang|Changlang|East Siang|Lower Dibang Valley|Tawang|Upper Subansiri|Dibang Valley|Kurung Kumey|Lower Subansiri|Tirap|West Kameng';
city_states['Assam']='Baksa|Cachar|Dhemaji|Goalpara|Jorhat|Karbi|Anglong|Lakhimpur|Nalbari|Sonitpur|Barpeta|Chirang|Dhubri|Golaghat|Kamrup|Karimganj	Morigaon|North|Cachar|Hills|Tinsukia|Bongaigaon|Darrang|Dibrugarh|Hailakandi|Kamrup|Metropolitan|Kokrajhar|Nagaon|Sivasagar|Udalguri';
city_states['Bihar']='Araria|Banka|Bhojpur|East|Champaran|Jamui|Katihar|Lakhisarai|Munger|Nawada|Rohtas|Saran|Sitamarhi|Vaishali|Arwal|Begusarai|Buxar	|aya|Jehanabad|Khagaria|Madhepura|Muzaffarpur|Patna|Saharsa|Sheikhpura|Siwan|West|Champaran|Aurangabad|Bhagalpur|Darbhanga|Gopalganj|Kaimur (Bhabua)|Kishanganj|Madhubani|Nalanda|Purnea|Samastipur|Sheohar|Supaul';
city_states['Chandigarh']='Chandigarh';
city_states['Dadar And Nagar Haveli']='Dadar|Nagar Haveli';
city_states['Daman and Diu']='Daman|Diu';
city_states['Delhi']='Central Delhi|North Delhi|South Delhi|East Delhi|North East|Delhi	South|West Delhi|New Delhi|North West Delhi|West Delhi';
city_states['Goa']='North Goa|South Goa';
city_states['Gujarat']='Ahmedabad|Banaskantha|Dahod|Jamnagar|Kutch|Navsari|Porbandar|Surat|Valsad|Amreli|Bharuch|Dang|Junagadh|Mehsana|Panchmahals|Rajkot|Surendranagar|Anand	|Bhavnagar|Gandhinagar|Kheda|Narmada|Patan|Sabarkantha|Vadodara';
city_states['Haryana']='Ambala|Fatehabad|Jhajjar|Karnal|Mewat|Panipat|Sirsa|Bhiwani|Gurgaon|Jind|Kurukshetra|Palwal|Rewari|Sonipat|Faridabad|Hisar|Kaithal|Mahendragarh|Panchkula|Rohtak|Yamunanagar';
city_states['Himachal Pradesh']='Bilaspur|Kangra|Lahaul & Spiti|Sirmaur|Chamba|Kinnaur|Mandi|Solan|Hamirpur|Kullu|Shimla|Una';
city_states['Jammu and Kashmir']='Anantnag|Doda|Kathua|Poonch|Samba|Baramulla|Jammu|Kupwara|Pulwama|Srinagar|Budgam|Kargil|Leh|Rajouri|Udhampur';
city_states['Jharkhand']='Bokaro|Dhanbad|Garhwa|Gumla|Khunti|Lohardaga|Ramgarh|Seraikela-Kharsawan|Chatra|Dumka|Giridih|Hazaribag|Koderma|Pakur|Ranchi|Simdega|Deoghar|EastSinghbhum|Godda|Jamtara|Latehar|Palamu|Sahibganj|West Singhbhum';
city_states['Karnataka']='Bagalkot|Belgaum|Bijapur|Chikballapur|Davangere|Gulbarga|Kodagu|Mandya|Shimoga|Uttara Kannada|Bangalore|Bellary|Chamrajanagar	|Chitradurga|Dharwad|Hassan|Kolar|Mysore|Tumkur|Bangalore Rural|Bidar|Chickmagalur|Dakshina|Kannada|Gadag|Haveri|Koppal|Raichur|Udupi';
city_states['Kerala']='Alappuzha|Kannur|Kottayam|Palakkad|Thrissur|Ernakulam|Kasargod|Kozhikode|Pathanamthitta|Wayanad|Idukki|Kollam|Malappuram|Thiruvananthapuram';
city_states['Lakshadweep']='Lakshadweep';
city_states['Madhya Pradesh']='Alirajpur|Balaghat|Bhind|Chhatarpur|Datia|Dindori|Harda|Jabalpur|Khandwa|Mandsaur|Neemuch|Rajgarh|Seoni|Sheopur|Singrauli|Umaria|Anuppur|Barwani|Chhindwara|Dewas|Guna|Hoshangabad|Jhabua|Khargone|Morena|Panna|Ratlam|Satna|Shahdol|Shivpuri|Tikamgarh|Vidisha|Ashoknagar|Betul|Burhanpur|Damoh|Dhar|Gwalior|Indore|Katni|Mandla|Narsinghpur|Raisen|Rewa|Sehore|Shajapur|Sidhi|Ujjain';
city_states['Maharashtra']='Ahmednagar|Aurangabad|Buldhana|Gadchiroli|Jalgaon|Latur|Nagpur|Nashik|Pune|Sangli|Solapur|Washim|Akola|Beed|Chandrapur|Gondia|Jalna|MumbaiCity|Nanded|Osmanabad|Raigad|Satara|Thane|Yavatmal|Amravati|Bhandara|Dhule|Hingoli|Kolhapur|Mumbai Suburban|Nandurbar|Parbhani|Ratnagiri|Sindhudurg|Wardha';
city_states['Manipur']='Bishnupur|Imphal East|Tamenglong|Chandel|Imphal West|Thoubal|Churachandpur|Senapati|Ukhrul';
city_states['Meghalaya']='Meghalaya';
city_states['Mizoram']='Aizawl|Lawngtlai|Saiha|Champhai|Lunglei|Serchhip|Kolasib|Mamit';
city_states['Nagaland']='Dimapur|Longleng|Peren|Wokha|Kephrie|Mokokchung|Phek|Zunheboto|Kohima|Mon|Tuensang';
city_states['Orissa']='Angul|Bargarh|Cuttack|Gajapati|Jajpur|Kandhamal|Khordha|Mayurbhanj|Nuapada|Sambalpur|Balangir|Bhadrak|Deogarh|Ganjam|Jharsuguda|Kendrapara|Nabarangpur|Puri|Subarnapur|Balasore|Boudh|Dhenkanal|Jagatsinghapur|Kalahandi|Kendujhar|Malkangiri|Nayagarh|Rayagada|Sundargarh';
city_states['Puducherry']='Karaikal|Yanam|Mahe|Pondicherry';
city_states['Punjab']='Amritsar|Faridkot|Kapurthala|Moga|Patiala|SAS Nagar|Barnala|Fatehgarh|Sahib|Hoshiarpur|Ludhiana|Muktsar|Rupnagar|TarnTaran|Bathinda|Ferozepur|Jalandhar|Mansa|Nawanshahr|Sangrur';
city_states['Rajasthan']='Ajmer|Baran|Bhilwara|Dholpur|Jaipur|Jhalawar|Karauli|Pali|Sawai Madhopur|Sri Ganganagar|Alwar|Barmer|Bikaner|Churu|Dungarpur|Jaisalmer|Jhunjhunu|Kota|Pratapgarh|Sikar|Tonk|Banswara|Bharatpur|Bundi|Dausa|Hanumangarh|Jalore|Jodhpur|Nagaur|Rajsamand|Sirohi|Udaipur';
city_states['Sikkin']='Sikkim';
city_states['Tamil Nadu']='Ariyalur|Cuddalore|Karur|Nagapattinam|Pudukkottai|Sivaganga|Theni|Tirunelveli|Tiruvarur|Virudhunagar|Chennai|Dharmapuri|Kanchipuram|Krishnagiri|Namakkal|Ramanathapuram|Thanjavur|Thoothukudi|Tiruvallur|Vellore|Coimbatore|Dindigul|Kanyakumari|Madurai|Perambalur|Salem|The Nilgiris|Tiruchirappalli|Tiruvannamalai|Viluppuram';
city_states['Tripura']='Dhalai|West Tripura|North Tripura|South Tripura';
city_states['Uttar Pradesh']='Agra|Ambedkar Nagar|Bagpat|Balrampur|Bareilly|Budaun|Chitrakoot|Etawah|Fatehpur|Ghaziabad|Gorakhpur|Hathras|Jhansi|Kanpur Dehat|Kheri|Lucknow|Mainpuri|Meerut|Muzaffarnagar|RaeBareli|Sant|Kabir Nagar|Shravasti|Sonbhadra|Varanasi|Aligarh|Auraiya|Bahraich|Banda|Basti|Bulandshahar|Deoria|Faizabad|Firozabad|Ghazipur|Hamirpur|Jalaun|Jyotiba Phule Nagar|Kanpur Nagar|Kushinagar|Maharajganj|Mathura|Mirzapur|Pilibhit|Rampur|Sant|Ravidas Nagar|Siddharthnagar|Sultanpur|Allahabad|Azamgarh|Ballia|Barabanki|Bijnor|Chandauli|Etah|Farrukhabad|Gautam Buddha Nagar|Gonda|Hardoi|Jaunpur|Kannauj|Kaushambi|Lalitpur|Mahoba|Mau|Moradabad|Pratapgarh|Saharanpur|Shahjahanpur|Sitapur|Unnao';
city_states['Uttarakhand']='Almora|Champawat|Nainital|Rudraprayag|Uttarkashi|Bageshwar|Dehradun|Pauri|Garhwal|Tehri|Garhwal|Chamoli|Haridwar|Pithoragarh|Udham Singh Nagar';
city_states['West Bengal']='Bankura|Cooch Behar|Hooghly|Malda|North 24 Parganas|South 24 Parganas|Bardhaman|Darjeeling|Howrah|Murshidabad|North|Dinajpur|South|Dinajpur|Birbhum|East Medinipur|Jalpaiguri|Nadia|Purulia|West Medinipur';

function setState()
{
	for (region in city_states)
		document.write('<option value="' + region + '">' + region + '</option>');
}

function set_city_state(oCountrySel, oCity_StateSel)
{
	var city_stateArr;
	oCity_StateSel.length = 1;
	var country = oCountrySel.options[oCountrySel.selectedIndex].text;
	if (city_states[country])
	{
		oCity_StateSel.disabled = false;
		//oCity_StateSel.options[0] = new Option('Select City','');
		city_stateArr = city_states[country].split('|');
		for (var i = 0; i < city_stateArr.length; i++)
			oCity_StateSel.options[i+1] = new Option(city_stateArr[i],city_stateArr[i]);
		document.getElementById('txtplacename').innerHTML = country;
	}
	else oCity_StateSel.disabled = true;
}

function print_city_state(oCountrySel, oCity_StateSel)
{
	var country = oCountrySel.options[oCountrySel.selectedIndex].text;
	var city_state = oCity_StateSel.options[oCity_StateSel.selectedIndex].text;
	if (city_state && city_states[country].indexOf(city_state) != -1)
		document.getElementById('txtplacename').innerHTML = city_state + ', ' + country;
	else document.getElementById('txtplacename').innerHTML = country;
}