function Inint_AJAX() 
{
   try { return new ActiveXObject("Msxml2.XMLHTTP");  } catch(e) {} //IE
   try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {} //IE
   try { return new XMLHttpRequest();          } catch(e) {} //Native Javascript
   alert("XMLHttpRequest not supported");
   return null;
};
function dochange2(src,val,CatName,CatId) {
     //alert(CatId);
	 var req = Inint_AJAX();
	req.onreadystatechange = function () { 
          if (req.readyState==4) {
               if (req.status==200) {
                    document.getElementById(src).innerHTML=req.responseText; //retuen value
               } 
          }
     };
	 fun_blank(src,CatName,CatId)
     req.open("GET", "state_populate.php?data12="+src+"&val12="+val+"&CatName="+CatName+"&CatId="+CatId); //make connection
     req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1"); // set Header
     req.send(null); //send value
	
}

function fun_blank(val,CatName,CatId)
{	//alert(CatName)
	//alert(CatId)
	//alert(val)
	if(val=='rtype' && document.getElementById('pincount1').value !='')
	{//alert(val)
		window.location="Products.php?page=Products&multiple=0&module=1&CatName="+CatName+"&CatId="+CatId;
		/*document.frm.action ="Products.php?page=Products&multiple=0&module=1&CatName="+CatName+"&CatId="+CatId;
		document.frm.submit();
		document.frm.method='post'*/
	}
	if(val=='pin' && document.getElementById('pincount1').value !='')
	{//alert(val)
		window.location="Products.php?page=Products&multiple=0&module=1&CatName="+CatName+"&CatId="+CatId;
		/*document.frm.action ="Products.php?page=Products&multiple=0&module=1&CatName="+CatName+"&CatId="+CatId;
		document.frm.submit();
		document.frm.method='post'*/
	}
	if(val=='frequency' && document.getElementById('frequency1').value !='')
	{	//alert(val)
		window.location="Products.php?page=Products&multiple=0&module=1&CatName="+CatName+"&CatId="+CatId;
		/*document.frm.action ="Products.php?page=Products&multiple=0&module=1&CatName="+CatName+"&CatId="+CatId;
		document.frm.submit();
		document.frm.method='post'*/
	}
}
/*function dochange(val,CatName,CatId) 
{
	//alert(val);
	//document.getElementById('memtypeid').value=val;
	window.location.href="Products.php?page=Products&multiple=0&module=1&CatName="+CatName+"&CatId="+CatId+"&id="+val;
}
*/


function dochange(val) {
    //alert(val) 
	 var req = Inint_AJAX();
	req.onreadystatechange = function () { //alert(req.readyState);
          if (req.readyState==4) {
               if (req.status==200) {
                   document.getElementById('productdetails').innerHTML=req.responseText; //retuen value
               } 
          }
     };
	// fun_blank(src,CatName,CatId)
     req.open("GET", "state_populate.php?idd12="+val); //make connection
     req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1"); // set Header
     req.send(null); //send value
	
}
