	    var _DropDownObject=null;
	    
	   function wrap()
	    {
			document.getElementById('hdnCityName').value=document.product.ddlCity.options[document.product.ddlCity.selectedIndex].text;	  
	    }    
	    
	    function wrap1()
	    {
	    alert(document.product.ddlCity1.options[document.product.DD_City1.selectedIndex].text);
			document.getElementById('hdnCityName1').value=document.product.ddlCity1.options[document.product.DD_City1.selectedIndex].text;	  
	    }
	     function wrapCity()
	    {
	
				document.getElementById('hdnCityName').value=document.Form1.DD_City.options[document.Form1.DD_City.selectedIndex].value;
				
		
	    }
	    function wrapLocation()
	    {
	    //alert(document.getElementById('DD_Location').value);
			if(document.getElementById('DD_Location').value=="A")
			{
				//alert('aaa');				
				document.getElementById('txtLocation').style.visibility = "visible";
				document.getElementById('txtLocation').focus();
				//hdnLocation.Value
				//document.getElementById('hdnLocation').value = document.getElementById('txtLocation').value;
				
			}
			else
			{
			    document.getElementById('txtLocation').style.visibility = "hidden";
				//alert(document.getElementById('DD_Location').value);
				document.getElementById('hdnLocation').value=document.Form1.DD_Location.options[document.Form1.DD_Location.selectedIndex].value;
			}
	    }
	    
	    function wrapLocation1()
	    {
			//document.getElementById('hdnProduct').value=document.Form1.DD_Product.options[document.Form1.DD_Product.selectedIndex].value;	  
			document.getElementById('hdnLocation1').value=document.Form1.DD_Location1.options[document.Form1.DD_Location1.selectedIndex].value;	  
			//alert(document.getElementById('hdnLocation').value);
	    }
	    //function wrapProducts()
	    //{
			//document.getElementById('hdnProduct').value=document.suplocate.DD_Product.options[document.suplocate.DD_Product.selectedIndex].value;	  
			//alert(document.getElementById('hdnProduct').value);
	    //}
			
				
		//function dealerState(DD_Product,DD_State)
		//{
			//var keyValue=document.getElementById('DD_Product').value;
		    //_DropDownObject=DD_State;
		    //var listt=document.getElementById(_DropDownObject);listt.options.length = 0 ; 
		    //listt.options[listt.options.length]=new Option("Loading...","0");
			//Class1.DealerState(keyValue,dealerState_CallBack);
		
		//}
		function dealerFillCity(DD_State,DD_City)
		{
		
		   
		     var state=document.getElementById('DD_State').value;
		     var city=document.getElementById('DD_City').value;
		      document.getElementById('hdnState').value=state;
		     _DropDownObject=DD_City;
		     var listt=document.getElementById(_DropDownObject);listt.options.length = 0 ; 
		     listt.options[listt.options.length]=new Option("Loading...","0");
			 MobileLocator.DealerFillCITY(state,dealerFillCity_CallBack);
	   }
		function dealerCity(DD_State,DD_City)
		{
		
		   
		     var state=document.getElementById('DD_State').value;
		     var city=document.getElementById('DD_City').value;
		      document.getElementById('hdnState').value=state;
		     _DropDownObject=DD_City;
		     var listt=document.getElementById(_DropDownObject);listt.options.length = 0 ; 
		     listt.options[listt.options.length]=new Option("Loading...","0");
			 MobileLocator.DealerCITY(state,dealerCity_CallBack);
	   }
		
	//	function dealerCity1(DD_State,DD_City)
	//	{
	//	     //var prod = document.getElementById('DD_Product').value;
	//	     var state=document.getElementById('DD_State').value;
	//	     var city=document.getElementById('DD_City').value;
	//	     //document.getElementById('hdnProduct').value=prod;
	//	     document.getElementById('hdnState').value=state;
	//	     _DropDownObject=DD_City;
	//	     var listt=document.getElementById(_DropDownObject);listt.options.length = 0 ; 
	//	     listt.options[listt.options.length]=new Option("Loading...","0");
	//		 MobileLocator.DealerCity(state,dealerCity_CallBack);
	//    }
		
		function dealerLocation(DD_City,DD_Location)
		{
		
		    //var prod = document.getElementById('DD_Product').value;
		     //var state=document.getElementById('DD_State').value;
		     var city=document.getElementById('DD_City').value;
		     //document.getElementById('hdnProduct').value=prod;
		     //document.getElementById('hdnState').value=state;
		     document.getElementById('hdnCityName').value=city;
		     _DropDownObject=DD_Location;
		     var listt=document.getElementById(_DropDownObject);listt.options.length = 0 ; 
		     listt.options[listt.options.length]=new Option("Loading...","0");
			 //alert('sds');
			 MobileLocator.DealerLocation(city,dealerLocation_CallBack);
	    }
	    
	    function dealerLocation1(DD_City1,DD_Location1)
		{
		    //var prod = document.getElementById('DD_Product').value;
		     //var state=document.getElementById('DD_State').value;
		     var city=document.getElementById('DD_City1').value;
		     //document.getElementById('hdnProduct').value=prod;
		    // document.getElementById('hdnState').value=state;
		     document.getElementById('hdnCityName1').value=city;
		     _DropDownObject=DD_Location1;
		     var listt=document.getElementById(_DropDownObject);listt.options.length = 0 ; 
		     listt.options[listt.options.length]=new Option("Loading...","0");
			 //alert('sds');
			 MobileLocator.DealerLocation(city,dealerLocation1_CallBack);
	    }
	    

	   //Changes made by Anand 
	   
	   
	   
	   function dealerProduct(DD_Product,DD_State,DD_City,DD_Product)
	   {
		    var prod = document.getElementById('DD_Product').value;
		     //var state=document.getElementById('DD_State1').value;
		     var city=document.getElementById('DD_City').value;
		     document.getElementById('hdnProduct').value=prod;
		     //document.getElementById('hdnState').value=state;

		     document.getElementById('hdnCityName').value=city;//document.Form1.DD_City.options[document.Form1.DD_City.selectedIndex].text;
			 //alert(prod);
		     //alert(state);
		     //alert(city);
		     
		     _DropDownObject=DD_Product;
		     var listt=document.getElementById(_DropDownObject);listt.options.length = 0 ; 
		     listt.options[listt.options.length]=new Option("Loading...","0");
			 MobileLocator.DealerLocation(prod,state,city,dealerLocation_CallBack);
	   }
	   
			   
	   
	   
	   function dealerState_CallBack(response) 
		{
			
		var objTable = response.value;
		
		var count=0;
		var NoOfRows;
		if(objTable.Rows==null)
		{
			count=1;
			NoOfRows=objTable.length;
			//alert(NoOfRows);
		}

		else
		{
			count=2;
			NoOfRows=objTable.Rows.length;
			//alert(NoOfRows);
		}

	   
		if(objTable == null || typeof(objTable) != "object") { return; } 
		 
		var list=document.getElementById(_DropDownObject);list.options.length = 0 ; 
		list.options[list.options.length]=new Option("Select State","0");
			
		for(var i = 0 ; i < NoOfRows; i++) 
		{    
			if(count==1)
			{	
				list.options[list.options.length] = new Option(objTable[i].STATE,objTable[i].STATE);
				
			}
			else
			{
				list.options[list.options.length] = new Option(objTable.Rows[i].STATE,objTable.Rows[i].STATE);
			}
		}
	
	}
	function dealerFillCity_CallBack(response) 
		{
			
		var objTable = response.value;
		
		var count=0;
		var NoOfRows;
		if(objTable.Rows==null)
		{
			count=1;
			NoOfRows=objTable.length;
			//alert(NoOfRows);
		}

		else
		{
			count=2;
			NoOfRows=objTable.Rows.length;
			//alert(NoOfRows);
		}

	   
		if(objTable == null || typeof(objTable) != "object") { return; } 
		 
		var list=document.getElementById(_DropDownObject);list.options.length = 0 ; 
		list.options[list.options.length]=new Option("Select City","0");
			
		for(var i = 0 ; i < NoOfRows; i++) 
		{    
			if(count==1)
			{	
				list.options[list.options.length] = new Option(objTable[i].CITY,objTable[i].CITY);
				
			}
			else
			{
				list.options[list.options.length] = new Option(objTable.Rows[i].CITY,objTable.Rows[i].CITY);
			}
		}
	
	}
	   
		function dealerCity_CallBack(response) 
		{
			
		var objTable = response.value;
		
		var count=0;
		var NoOfRows;
		if(objTable.Rows==null)
		{
			count=1;
			NoOfRows=objTable.length;
			//alert(NoOfRows);
		}

		else
		{
			count=2;
			NoOfRows=objTable.Rows.length;
			//alert(NoOfRows);
		}

	   
		if(objTable == null || typeof(objTable) != "object") { return; } 
		 
		var list=document.getElementById(_DropDownObject);list.options.length = 0 ; 
		list.options[list.options.length]=new Option("Select City","0");
			
		for(var i = 0 ; i < NoOfRows; i++) 
		{    
			if(count==1)
			{	
				list.options[list.options.length] = new Option(objTable[i].CITY,objTable[i].CITY);
				
			}
			else
			{
				list.options[list.options.length] = new Option(objTable.Rows[i].CITY,objTable.Rows[i].CITY);
			}
		}
	
	}
	
		
	
//	function dealerLocation_CallBack(response) 
//		{
//		var objTable = response.value;
		
//		var count=0;
//		var NoOfRows;
//		if(objTable.Rows==null)
//		{
//			count=1;
//			NoOfRows=objTable.length;
//			//alert(NoOfRows);
//		}

//		else
//		{
//			count=2;
//			NoOfRows=objTable.Rows.length;
//			//alert(NoOfRows);
//		}

	   
//		if(objTable == null || typeof(objTable) != "object") { return; } 
		 
//		var list=document.getElementById(_DropDownObject);list.options.length = 0 ; 
//		list.options[list.options.length]=new Option("Select Location","0");
//		for(var i = 0 ; i < NoOfRows; i++) 
//			if(count==1)
//			{	
//				list.options[list.options.length] = new Option(objTable[i].LOCATION,objTable[i].LOCATION);
				
//			}
//			else
//			{
//				list.options[list.options.length] = new Option(objTable.Rows[i].LOCATION,objTable.Rows[i].LOCATION);
//			}
//		}
	
//	}
	
	
	
	function branchCity_CallBack(response) 
		{
			
		var objTable = response.value;
		
		var count=0;
		var NoOfRows;
		if(objTable.Rows==null)
		{
			count=1;
			NoOfRows=objTable.length;
			//alert(NoOfRows);
		}

		else
		{
			count=2;
			NoOfRows=objTable.Rows.length;
			//alert(NoOfRows);
		}

	   
		if(objTable == null || typeof(objTable) != "object") { return; } 
		 
		var list=document.getElementById(_DropDownObject);list.options.length = 0 ; 
		list.options[list.options.length]=new Option("Select City","0");
			
		for(var i = 0 ; i < NoOfRows; i++) 
		{    
			if(count==1)
			{	
				list.options[list.options.length] = new Option(objTable[i].CITY,objTable[i].CITY);
				
			}
			else
			{
				list.options[list.options.length] = new Option(objTable.Rows[i].CITY,objTable.Rows[i].CITY);
			}
		}
	
	}
	
	

		function calCity_CallBack(response) 
		{
			
		var objTable = response.value;
		var count=0;
		var NoOfRows;
		if(objTable.Rows==null)
		{
			count=1;
			NoOfRows=objTable.length;
		}

		else
		{
			count=2;
			NoOfRows=objTable.Rows.length;
		}

	   
		if(objTable == null || typeof(objTable) != "object") { return; } 
		 
		var list=document.getElementById(_DropDownObject);list.options.length = 1 ; 
			
		for(var i = 0 ; i < NoOfRows; i++) 
		{    

			if(count==1)
			{
				list.options[list.options.length] = new Option(objTable[i].CITY,objTable[i].REGIONINFOID);
				
			}
			else
			{
				list.options[list.options.length] = new Option(objTable.Rows[i].CITY,objTable.Rows[i].REGIONINFOID);
			}
		}
	
	}
	
	
		function dealerLocation_CallBack(response) 
		{
		
		var objTable = response.value;
		var count=0;
		var NoOfRows;
		if(objTable.Rows==null)
		{
			count=1;
			NoOfRows=objTable.length;
		}

		else
		{
			count=2;
			NoOfRows=objTable.Rows.length;
		}

	   
		if(objTable == null || typeof(objTable) != "object") { return; } 
		 
		var list=document.getElementById(_DropDownObject);list.options.length = 0 ; 
		list.options[list.options.length]=new Option("Select Location","0");
		
			
		for(var i = 0 ; i < NoOfRows; i++) 
		{    
			
			if(count==1)
			{
				list.options[list.options.length] = new Option(objTable[i].LOCATION,objTable[i].LOCATION);
				
			}
			else
			{
				list.options[list.options.length] = new Option(objTable.Rows[i].LOCATION,objTable.Rows[i].LOCATION);
			}
		}

		list.options[list.options.length]=new Option("Other","A");
	   if(document.getElementById('DD_City').value=="A")
			{
				document.getElementById('divCity').style.display ="block";
				document.getElementById('txtLocation').style.visibility = "visible";
				document.getElementById('DD_Location').style.display="none";
				
			}
			else
			{
				document.getElementById('txtLocation').style.visibility = "hidden";
			
			document.getElementById('DD_Location').style.display="block";
			   document.getElementById('divCity').style.display ="none";
				 document.getElementById('hdnCityName').value=document.Form1.DD_City.options[document.Form1.DD_City.selectedIndex].value;
				 //alert(document.getElementById('hdnCityName').value);
			}
	}
	
	
	function dealerLocation1_CallBack(response) 
		{
		
		var objTable = response.value;
		var count=0;
		var NoOfRows;
		if(objTable.Rows==null)
		{
			count=1;
			NoOfRows=objTable.length;
		}

		else
		{
			count=2;
			NoOfRows=objTable.Rows.length;
		}

	   
		if(objTable == null || typeof(objTable) != "object") { return; } 
		 
		var list=document.getElementById(_DropDownObject);list.options.length = 0 ; 
		list.options[list.options.length]=new Option("Select","0");
		
			
		for(var i = 0 ; i < NoOfRows; i++) 
		{    
			
			if(count==1)
			{
				list.options[list.options.length] = new Option(objTable[i].LOCATION,objTable[i].LOCATION);
				
			}
			else
			{
				list.options[list.options.length] = new Option(objTable.Rows[i].LOCATION,objTable.Rows[i].LOCATION);
			}
		}

		list.options[list.options.length]=new Option("All","A");
	
	}
	
		
	
	function dealerProduct_CallBack(response) 
	{
		
		var objTable = response.value;
		var count=0;
		var NoOfRows;
		if(objTable.Rows==null)
		{
			count=1;
			NoOfRows=objTable.length;
			//alert(NoOfRows);
		}

		else
		{
			count=2;
			NoOfRows=objTable.Rows.length;
			//alert(NoOfRows);
		}

	   
		if(objTable == null || typeof(objTable) != "object") { return; } 
		
		var list=document.getElementById(_DropDownObject);list.options.length = 0 ; 
		list.options[list.options.length]=new Option("Select Product","0");
		//list.options[list.options.length]=new Option("All","A");
		//var list=document.getElementById(_DropDownObject);list.options.length = 1 ; 
			
		for(var i = 0 ; i < NoOfRows; i++) 
		{    
			
			if(count==1)
			{
				//alert("1");
				list.options[list.options.length] = new Option(objTable[i].PRODUCTS,objTable[i].PRODUCTS);
				
			}
			else
			{
				list.options[list.options.length] = new Option(objTable.Rows[i].PRODUCTS,objTable.Rows[i].PRODUCTS);
			}
		}
		list.options[list.options.length]=new Option("All","A");
	}
	
