var resultDropdownName="";
var selname='sele_id_';
var Totelement="";
function GotoForChange(DropdownName,norow,opid,productid)
	{
				
		
		var x1=document.getElementById('all_hid_id').value;
		var a1=x1.indexOf(opid)+opid.length+1;
		var a7='';
		var a8='';	
		
		if(a1 < x1.length)
		{
			var a2=x1.substr(a1,x1.length);
			var a3=a2.split(',');
			var a4='';
			var a5='';
			var a6='';
				
			
			for(var aj=0; aj < a3.length; aj++)
			{
				a4=document.getElementById(selname+a3[aj]).selectedIndex;
				a5=document.getElementById(selname+a3[aj]).options[a4].text;			
				a6+=a5+'~';
			}
			
							
			a6=encodeURIComponent(a6);
		}
		else
		{
			a6='';	
		}
		
		a7=document.getElementById('quantity').selectedIndex;
		a8=document.getElementById('quantity').options[a7].text;
		
		var SelectedIndex=document.getElementById(DropdownName).selectedIndex;
		var Selectedvalue=document.getElementById(DropdownName).options[SelectedIndex].value;			
		
		var url = "ajax-sel-attribute.php?proid="+productid+"&dropId="+Selectedvalue+'&selval='+a6+'&selqty='+a8;
		
		//alert(url);
		
		var isWorking=false;
		if (!isWorking && http)
		{
			http.open("GET", url, true);
			http.onreadystatechange = handleHttpResponse;
			isWorking = true;
			http.send(null);
		}
		
	
	}
	
	<!-- ================= S T A R T     A J A X ================ -->
var http = getHTTPObject(); 
function getHTTPObject() {
   var ro;
    var browser = navigator.appName;
    
    if(browser == "Microsoft Internet Explorer")
	{
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else
	{
        ro = new XMLHttpRequest();
    }
    return ro;
}// JavaScript Document


function handleHttpResponse() 
{
	if (http.readyState == 4) 
	{
		if (http.responseText.indexOf('invalid') == -1) 
		{
			// Use the XML DOM to unpack the city and state data 
			var xmlDocument = http.responseXML;
			//alert(xmlDocument);
			var topic = new Array();	
			topic=xmlDocument.getElementsByTagName("topic");
			//alert("tp"+topic);
			topicValue=topic.item(0).firstChild.nodeValue;
			//alert(topicValue);
			
			//alert("samar");
			
			if(topicValue=='CatList')
			{
				var xSel=new Array();
				var xVal=new Array();
				
				xSel = xmlDocument.getElementsByTagName('AttName');
				xVal = xmlDocument.getElementsByTagName('AttValue');
				xId = xmlDocument.getElementsByTagName('AttID');
				
				qId = xmlDocument.getElementsByTagName('qtyId');
				qVal = xmlDocument.getElementsByTagName('qtyVal');
							
				prcVal = xmlDocument.getElementsByTagName('lastPrc');	
				wtVal = xmlDocument.getElementsByTagName('lastWt');
				
					var s1='';
					var v1='';	
					var t1 ='';	
					var t2 ='';
					var arr1= Array();
					var theid2='';
					var u1=0;
					var u2=0;
					for(var r=0;r<xId.length;r++)
					{						
						t1 = xId.item(r).firstChild.nodeValue;	
						s1=document.getElementById(selname+t1).selectedIndex;
						v1=document.getElementById(selname+t1).options[s1].text;	
						arr1[r]=v1;					
						
					}		
					
					for(var j=0;j<xId.length;j++)
					{						
						var theid1 = xId.item(j).firstChild.nodeValue;						
						document.getElementById(selname+theid1).options.length = 0;					
					}
					
					for(var j=0;j<xId.length;j++)
					{
						var thetext = xSel.item(j).firstChild.nodeValue;
						var theval = xVal.item(j).firstChild.nodeValue;	
						var theid = xId.item(j).firstChild.nodeValue;
						
						if(arr1[j]==thetext)												
							var option = new Option(thetext,theval,true,true);				
						else
							var option = new Option(thetext,theval);						
												
						document.getElementById(selname+theid).options.add(option);				
						
					}
					
					s1=document.getElementById('quantity').selectedIndex;
					v1=document.getElementById('quantity').options[s1].text;	
						
					document.getElementById('quantity').options.length = 0;	
					
					for(var k=0; k<qId.length; k++)
					{
						var qty1 = qId.item(k).firstChild.nodeValue;
						var qty2 = qVal.item(k).firstChild.nodeValue;	
						if(v1==qty2)
							var optionQ = new Option(qty2,qty1,true,true);
						else
							var optionQ = new Option(qty2,qty1);
							
						document.getElementById('quantity').options.add(optionQ);						
					}
					
					var prc1 = prcVal.item(0).firstChild.nodeValue;				
					var wt1 = wtVal.item(0).firstChild.nodeValue;	
					
					document.getElementById('baseprc').value='$'+prc1;					
					prc12=prc1.replace(',','');
					document.getElementById('totalprintin').value=prc12;
					document.getElementById('totalWt').value=wt1;				
				
			
			}
			
			
		}
		isWorking = false;
	}
}
