	    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 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 dealerCity(DD_Product,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");
			 Class1.DealerCity(prod,state,dealerCity_CallBack);
	    }
		
		
		
		function dealerLocation(DD_Product,DD_State,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");
			 Class1.DealerLocation(prod,state,city,dealerLocation_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_State').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");
			 Class1.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 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].LGBRANCH,objTable[i].LGBRANCH);
				
			}
			else
			{
				list.options[list.options.length] = new Option(objTable.Rows[i].LGBRANCH,objTable.Rows[i].LGBRANCH);
			}
		}
	
	}
	
	
	
	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 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");
	}
	