// JavaScript Document







// State lists



var states = new Array();



states['14'] = new Array('Andaman and Nicobar Islands~1','Andhra Pradesh~2','Arunachal Pradesh~3','Assam~4','Bihar~5','Chandigarh~6','Chhattisgarh~7','Dadra and Nagar Haveli~8','Daman and Diu~9','Delhi~10','Goa~11','Gujarat~12','Himachal Pradesh~13','Jammu and Kashmir~14','Jharkhand~15','Karnataka~16','Kerala~17','Lakshadweep~18','Madhya Pradesh~19','Maharashtra~20','Manipur~21','Meghalaya~22','Mizoram~23','Nagaland~24','Orissa~25','Puducherry~26','Punjab~27','Rajasthan~28','Sikkim~29','Tamil Nadu~30','Tripura~31','Uttarakhand~32','Uttar Pradesh~33','West Bengal~34','Haryana~38','Uttaranchal~39');



//states['16'] = new Array('Alaska~43','California~44','Hawaii~45','New york~46','Texas~47');





// City lists



var cities = new Array();



cities['14'] = new Array();



cities['14']['1'] = new Array('Other~194');



cities['14']['2'] = new Array('Hyderabad~47','Vijayawada~122','Rajahmundry~130','Warangal~133','Visakhapatnam~137','Secunderabad~139','Nellore~141','Other~153');



cities['14']['3'] = new Array('Bomdila~165','Ziro~166','Pasighat~167','Deomali~168','Basar~169','Malinithan~170','Tawang~171','Other~248');



cities['14']['4'] = new Array('Guwahati~53','Tezpur~172','Dibrugarh~173','Kaziranga~174','Silchar~175','Gossaigaon~176','Other~177');



cities['14']['5'] = new Array('Patna~72','Aurangabad~178','Muzaffarpur~179','Bodh Gaya~180','Bhagalpur~181','Arrah~182','Pataliputra~183','Samstipur~184','Munger~185','Other~249');



cities['14']['6'] = new Array('Chandigarh~44','Other~250');



cities['14']['7'] = new Array('Gogaon~228','Jhagrakhand~229','Frezarpur~230','Bhilai~231','Raipur~232','Other~251');



cities['14']['8'] = new Array('Other~252');



cities['14']['9'] = new Array('Other~254');



cities['14']['10'] = new Array('New delhi~38','Quila Rai Pithora~146','Mehrauli~147','Siri~148','Tughlakabad~149','Firozabad~150','Shergarh~151','Shahjehabanad~152','Other~256','Noida~321');



cities['14']['11'] = new Array('Goa-panaji~54','Curti~195','Davorlim~196','Curchorem Cacora~197','Curchorem Cacora~198','Other~257');



cities['14']['12'] = new Array('Ahmedabad~40','Rajkot~64','Surat~65','Bharuch~154','Bhavnagar~155','Diu~156','Dwarka~157','Gandhinagar~158','Jamnagar~159','Junagadh~160','Kutch~161','Porbandar~162','Vadodara~163','Valsad~164','Other~258');



cities['14']['13'] = new Array('Kulu~199','Chamba~200','Hamirpur~201','Sarahan~202','Daulatpur~203','Other~260');



cities['14']['14'] = new Array('Gulmarg~204','Kargil~205','West Of Leh~206','Ladakh~207','Hiranagar~208','Panamik~209','Tourism In Leh District~210','Other~262');



cities['14']['15'] = new Array('Ranchi~186','Jamshedpur~187','Tata~188','Bokaro~189','Deoghar~190','Bokaro Steel City~191','Dhanbad~192','Jugsalai~193','Other~263');



cities['14']['16'] = new Array('Bengaluru~37','Mysore~62','Bidar~219','Bijapur~220','Belgaum~221','Konnur~222','Mudgal~223','Mundargi~224','Bagalkot~225','Udupi~226','Other~227');



cities['14']['17'] = new Array('Kochi~59','Ernakulam~236','Kolikod~237','Trivandrum~238','Coachin~239','Other~266');



cities['14']['18'] = new Array('Other~267');



cities['14']['19'] = new Array('Bhopal~52','Indore~56','Gwalior~112','Other~268');



cities['14']['20'] = new Array('Mumbai~14','Solapur~35','Nagpur~49','Aurangabad~51','Nashik~63','Thane~66','Kolhapur~73','Satara~74','Pune~77','Sangli~78','Phanala~79','Amravati~97','Buldhana~102','Dhule~103','Balapur~105','Ahmed Nagar~106','Jalgaon~316','Other~270');



cities['14']['21'] = new Array('Mayang Imphal~307','Bishnupur~308','Ningthoukhong~309','Moirang~310','Other~272');



cities['14']['22'] = new Array('Baghmara~302','Mairang~303','Cherrapunjee~304','Cherrapunji~305','Tura~306','Other~273');



cities['14']['23'] = new Array('Lawngtlai~295','Khawhai~298','Lunglei~299','Khawzawl~300','Mamit~301','Other~274');



cities['14']['24'] = new Array('Mokokchung~233','Mon~234','Wokha~235','Other~276');



cities['14']['25'] = new Array('Puri~211','Cuttack~212','Berhampur~213','Patnagarh~214','Konark~215','Barapali~216','Ghantapada~217','Other~218');



cities['14']['26'] = new Array('Other~278');



cities['14']['27'] = new Array('Amritsar~50','Jalandhar~57','Ludhiana~61','Patiala~313','Jalandara~314','Faridkot~315','Other~279');



cities['14']['28'] = new Array('Jaipur~41','Other~281');



cities['14']['29'] = new Array('Mangan~288','Namchi~284','Ghezing~286','Other~282');



cities['14']['30'] = new Array('Chennai~39','Coimbatore~69','Agartala~271','Madurai~311','Thiruchirappalli~312','Other~283');



cities['14']['31'] = new Array('Udaipur~269','Kumarghat~275','Unakoti~277','Dharmanagar~280','Other~285');



cities['14']['32'] = new Array('Badrinathpuri~252','Dwarahat~255','Askot~259','Laksar~261','Gochar~264','Other~265');



cities['14']['33'] = new Array('Kanpur~58','Lucknow~60','Agra~67','Allahabad~68');



cities['14']['34'] = new Array('Kolkata~42','Durgapur~240','Shantiniketan~241','Bardhaman~242','Jalpaiguri~243','Siliguri~244','Howrah~245','Asansol~246','Nabadwip~247','Other~287');



cities['14']['35'] = new Array('Gurgaon~55','Faridabad~71','Other~289');



cities['14']['36'] = new Array('Dehradun~70','Other~290');


cities['14']['39'] = new Array('Rudrapur~325');



cities['16'] = new Array();


/*
cities['16']['43'] = new Array('Other~291');



cities['16']['44'] = new Array('Los angeles~80','San diego~81','San jose~82','San francisco~83','Other~292');



cities['16']['45'] = new Array('Aiea~84','Captain cook~85','Eleele~86','Ewa beach~87','Other~293');



cities['16']['46'] = new Array('Albany~88','Amsterdam~89','Auburn~90','Batavia~91','Other~294');



cities['16']['47'] = new Array('Abbott~92','Bacon~93','Calvert~94','Daingerfield~95','Other~296');
*/




function setStates(country,state,city, stateValue) 

{



  cntrySel = document.getElementById(country);



	if (cntrySel != null)

	{

	  stateList = states[cntrySel.value];

		

	  changeSelect(state, stateList, stateList,stateValue);

	

	  setCities(country,state,city,'');

	}

}







function setCities(country,state,city, cityValue) 

{



  cntrySel = document.getElementById(country);



	if (cntrySel != null)

	{

	  stateSel = document.getElementById(state);

	 

	  cityList = cities[cntrySel.value][stateSel.value];

	

	  changeSelect(city, cityList, cityList, cityValue);

	}

}







function changeSelect(fieldID, newOptions, newValues, selectValue) 

{

	selectField = document.getElementById(fieldID);

	selectField.options.length = 0;

	

	if (newOptions != null) 

	{

		if (newOptions.length != null)

		{

			for (i=0; i< newOptions.length; i++) 

			{

				var splitValue = newOptions[i].split("~");

				selectField.options[i] = new Option(splitValue[0], splitValue[1]);

				

				//i != 0 && i == selectValue

				if(splitValue[1] == selectValue) { selectField.options[i].selected = true; }

			}

		}

	}

}







function addLoadEvent(func) 

{

	var oldonload = window.onload;

	

	if (typeof window.onload != 'function') 

	{

		window.onload = func;

	} 

	else 

	{

		window.onload = function() {

			if (oldonload) 

			{

				oldonload();

			}

			func();

		}

	}

}



addLoadEvent(function() 

{

	setStates();

});



function getValuesDropdown()

{

	document.getElementById('p_pstate').value = document.getElementById('profile_pstate').selectedIndex;

	document.getElementById('p_pcity').value = document.getElementById('profile_pcity').selectedIndex;

	document.getElementById('u_pstate').value = document.getElementById('uprofile_pstate').selectedIndex;

	document.getElementById('u_pcity').value = document.getElementById('uprofile_pcity').selectedIndex;

}
