	/*
	Please Use this file where ever you need Country, State and City selection
	vCountry - Array for Country
	vState - Array for States
	vCity - Array for Cities
	*/
	
	function f_FillCountries(ObjCountryListBox,ObjStateListBox)
	{
		var i;
		var vIndexOut;
		vIndexOut = 1;
		ObjCountryListBox.options[0]=new Option('--select--','0');
		for (i=0;i<vCountry.length;i++)
		{
			ObjCountryListBox.options[vIndexOut]=new Option(vCountry[i][2],vCountry[i][0]);
			vIndexOut++;
		}
		f_FillStates(0,ObjStateListBox)
	}
	
	function f_FillStates(vCountryId,ObjStateListBox,ObjStateTextBox)
	{
		//alert(ObjStateTextBox.className);
		var i;
		ObjStateListBox.length = 0; 		
		var vIndex;
		vIndex = 1;
		ObjStateListBox.options[0]=new Option('--select--','0');
		var check;
		check = 1;
		//alert(vStates.length);
		for (i=0;i<vStates.length;i++)
		{
			if (vStates[i][2]==vCountryId)
			{
				check = 0;
				ObjStateListBox.options[vIndex]=new Option(vStates[i][1],vStates[i][0]);				
				vIndex = vIndex + 1
			}
		}
		//alert('indira');
		//alert(ObjStateTextBox.className);
		if (check==1)
		{
		//alert('enter');
		ObjStateListBox.style.display = 'none';
		ObjStateTextBox.className = 'show';
		//ObjStateTextBox.style.visibility = 'visible';
		//ObjStateTextBox.style.display = 'block';
		//alert(ObjStateTextBox.className);
		}
		else if (check==0)
		{
		ObjStateListBox.style.display = 'block';
		ObjStateTextBox.className = 'hide';
		ObjStateTextBox.value='';
		}
	}	
	
	function f_CCFillStates(vCountryId,ObjStateListBox,ObjStateTextBox)
	{
		//alert(ObjStateTextBox.className);
		var i;
		ObjStateListBox.length = 0; 		
		var vIndex;
		vIndex = 1;
		ObjStateListBox.options[0]=new Option('--select--','0');
		var check;
		check = 1;
		//alert(vStates.length);
		for (i=0;i<vStates.length;i++)
		{
			if (vStates[i][2]==vCountryId)
			{
				check = 0;
				ObjStateListBox.options[vIndex]=new Option(vStates[i][1],vStates[i][0]);				
				vIndex = vIndex + 1
			}
		}
		//alert('indira');
		//alert(ObjStateTextBox.className);
		if (check==1)
		{
		//alert('enter');
		ObjStateListBox.style.display = 'none';
		ObjStateListBox.className = 'hide';
		//ObjStateTextBox.style.visibility = 'visible';
		//ObjStateTextBox.style.display = 'block';
		//alert(ObjStateTextBox.className);
		}
		else if (check==0)
		{
		//ObjStateListBox.style.display = 'block';
		//ObjStateListBox.className = 'hide';
		//ObjStateTextBox.value='';
		}
	}


	function f_SetGeo(vCntrId, vObjCountryList, vStId, vObjStateList)
	{
		f_SetCountry(vCntrId, vObjCountryList);
		f_FillStates(vCntrId,vObjStateList);
		f_SetState(vStId, vObjStateList);	
	}
	
	function f_SetCountry(Id, vObjCountryList)
	{
		var i;
		for(i=0; i < vObjCountryList.length; i++)
		{
			if(Id == vObjCountryList.options[i].value)
			{
				vObjCountryList.selectedIndex = i;
			}
		}
	}

	function f_SetState(Id, vObjStateList)
	{
		var i;		
		for(i=0; i < vObjStateList.length; i++)
		{
			if(Id == vObjStateList.options[i].value)
			{
				vObjStateList.selectedIndex = i;
			}
		}
	}

	
