	    var _DropDownObject=null;
	    
	   function wrap()
	    {
			document.getElementById('hdnCityName').value=document.product.ddlCity.options[document.product.ddlCity.selectedIndex].text;	  
	    }
	    
	    
	    function wrapLocation()
	    {
			//document.getElementById('hdnProduct').value=document.Form1.DD_Product.options[document.Form1.DD_Product.selectedIndex].value;	  
			document.getElementById('hdnLocation').value=document.Form1.DD_Location.options[document.Form1.DD_Location.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 calCity(ddlState,ddlCity)
		{
		     var keyValue=document.getElementById('ddlState').value;
		     _DropDownObject=ddlCity;
			 Class1.FillCity(keyValue,calCity_CallBack);
	 
		}
		
		function calCompCity(ddlState,ddlCity)
		{
		     var keyValue=document.getElementById('ddlState').value;
		     _DropDownObject=ddlCity;
			 Class1.FillCompCity(keyValue,branchCity_CallBack);
	 
		}
		
		
		function dealerCity(DD_State,DD_City)
		{
		     var keyValue=document.getElementById('DD_State').value;
		     _DropDownObject=DD_City;
		     var listt=document.getElementById(_DropDownObject);listt.options.length = 0 ; 
		     listt.options[listt.options.length]=new Option("Loading...","0");
			 Class1.DealerCity(keyValue,dealerCity_CallBack);
	    }
		
		
		function locatorState(DD_State,DD_City)
		{
		
		     var keyValue=document.getElementById('DD_State').value;
		     _DropDownObject=DD_City;
			 //alert(_DropDownObject);
		     var listt=document.getElementById(_DropDownObject);listt.options.length = 0 ; 
		     listt.options[listt.options.length]=new Option("Loading...","0");
			 Class1.LocatorCity(keyValue,locatorCity_CallBack);
	    }
	    
	   function locatorCity(DD_State,DD_City,DD_Product)
	   {
			 var state=document.getElementById('DD_State').value;
		     var city=document.getElementById('DD_City').value;
		     document.getElementById('hdnCityName').value=city;
		      _DropDownObject=DD_Product;
		      //alert(document.getElementById('DD_State').value);
		      //alert(document.getElementById('DD_City').value);
		     var listt=document.getElementById(_DropDownObject);listt.options.length = 0 ; 
		     listt.options[listt.options.length]=new Option("Loading...","0");
			 Class1.ServiceLocation(state,city,serviceLocation_CallBack);
	  
	   }
	   
	   function LocatorLocation(DD_State,DD_City,DD_Location)
	   {
		     var state=document.getElementById('DD_State').value;
		     var city=document.getElementById('DD_City').value;
		     document.getElementById('hdnCityName').value=city;//document.Form1.DD_City.options[document.Form1.DD_City.selectedIndex].text;
		     _DropDownObject=DD_Location;
		     var listt=document.getElementById(_DropDownObject);listt.options.length = 0 ; 
		     listt.options[listt.options.length]=new Option("Loading...","0");
			 Class1.ServiceLocation(state,city,serviceLocation_CallBack);
	   }
	   
	   
	   function branchState(DD_State,DD_City)
		{
		     var keyValue=document.getElementById('DD_State').value;
		    _DropDownObject=DD_City;
		     var listt=document.getElementById(_DropDownObject);listt.options.length = 0 ; 
		     listt.options[listt.options.length]=new Option("Loading...","0");
			 Class1.BranchCity(keyValue,branchCity_CallBack);
			 
	    }
	    
	   function branchCity(DD_State,DD_City)
	   {
			 var state=document.getElementById('DD_State').value;
		     var city=document.getElementById('DD_City').value;
		     document.getElementById('hdnCityName').value=city;
		     //alert(city);
	   }
	   
	   //Changes made by Anand 
	   
	   
	   
	   function dealerProduct(DD_State,DD_City,DD_Product)
	   {
		     var state=document.getElementById('DD_State').value;
		     var city=document.getElementById('DD_City').value;
		     var location="A";
		     document.getElementById('hdnCityName').value=city;//document.Form1.DD_City.options[document.Form1.DD_City.selectedIndex].text;
		     _DropDownObject=DD_Product;
		     var listt=document.getElementById(_DropDownObject);listt.options.length = 0 ; 
		     listt.options[listt.options.length]=new Option("Loading...","0");
			 Class1.DealerProduct(state,city,location,dealerProduct_CallBack);
	   }
	   
		function dealerLocation(DD_State,DD_City,DD_Product,DD_Location)
	   {
			//alert("Anand");
		     var state=document.getElementById('DD_State').value;
		    // alert(state);
		     var city=document.getElementById('DD_City').value;
		    //  alert(city);
		     var produts=document.getElementById('DD_Product').value;  
		     document.getElementById('hdnProduct').value=produts;
		     //hdnProduct.Value
		    // alert(produts);
		     document.getElementById('hdnCityName').value=city;//document.Form1.DD_City.options[document.Form1.DD_City.selectedIndex].text;
		     _DropDownObject=DD_Location;
		     var listt=document.getElementById(_DropDownObject);listt.options.length = 0 ; 
		     listt.options[listt.options.length]=new Option("Loading...","0");
			 Class1.DealerLocation(state,city,produts,dealerLocation_CallBack);
	   }
		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 locatorCity_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 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].LGBRANCH,objTable[i].LGBRANCH);
				
			}
			else
			{
				list.options[list.options.length] = new Option(objTable.Rows[i].LGBRANCH,objTable.Rows[i].LGBRANCH);
			}
		}

		list.options[list.options.length]=new Option("All","A");
	
	}
	
	
	
	
	function serviceLocation_CallBack(response) 
		{
		
		var objTable = response.value;
		//alert(objTable);
		var count=0;
		var NoOfRows;
		//alert(NoOfRows);
		if(objTable.Rows==null)
		{
			count=1;
			NoOfRows=objTable.length;
		}

		else
		{
			count=2;
			NoOfRows=objTable.Rows.length;
			//strRows = objTable.Rows;
		}
		//alert(count);
	    //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");
			
		for(var i = 0 ; i < NoOfRows; i++) 
		{    
			
			if(count==1)
			{
				list.options[list.options.length] = new Option(objTable[i].SERVICEAVAILABLE,objTable[i].SERVICEAVAILABLE);
				
			}
			else
			{
				//strf = objTable.Rows[0].SERVICEAVAILABLE;
				//alert(objTable.Rows[i].SERVICEAVAILABLE);
				//if(
				//alert(NoOfRows);
				
				list.options[list.options.length] = new Option(objTable.Rows[i].SERVICEAVAILABLE,objTable.Rows[i].SERVICEAVAILABLE);
			}
		}
		
		/*if(count==2)
		{
				for(var z = 0 ; z < NoOfRows; z++) 
				{
					temp=objTable.Rows[z].SERVICEAVAILABLE;
				    
				    
					for(var x = 0 ; x <z; x++) 
					{
						if(objTable.Rows[x].SERVICEAVAILABLE==temp)
						{  
							
							list.options[list.options.length]=new Option(objTable.Rows[x].SERVICEAVAILABLE,objTable.Rows[x].SERVICEAVAILABLE);
						}
				        else
				        {
				          //fillvalues(objTable.Rows[x].SERVICEAVAILABLE);
				        }
							//list.options[list.options.length]=new Option(objTable.Rows[x].SERVICEAVAILABLE,objTable.Rows[x].SERVICEAVAILABLE);
				        
					}
				}
		
		
		}*/
		
		
	
	}
	
	function fillvalues(val)
	{
		var list=document.getElementById('DD_Product');list.options.length = 0 ; 	
		list.options[list.options.length]=new Option("Select Product","0");	
		list.options[list.options.length]=new Option(val,val);  
	
	}
	
	
	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");
	}
	