function getxmlhttpobject()
{
	var xmlhttp=null;
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlhttp=new XMLHttpRequest();
	}
	catch (e)
	{
		//Internet Explorer
		try
		{
			xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlhttp;
}
//manoj code
// function for filter table
function filter(term, _id, type)
{
	xmlhttp=getxmlhttpobject();
	var suche = term.value.toLowerCase();
	var table = document.getElementById(_id);
	var ele;
	var query='';
	if (table.rows)
	{
			ele = '';
			query=query+"txtval="+suche;
			query=query+"&type="+type;
			for (var r = 0; r < table.rows.length; r++)
			{
				table.rows[r].style.display = 'none';
			}
			document.getElementById("filter").innerHTML='Searching...';
			xmlhttp.onreadystatechange=function()
			{
				if (xmlhttp.readyState==4)
				{
					document.getElementById("filter").innerHTML=xmlhttp.responseText;
					//document.getElementById("filt").value=suche;
					//parent.frames['content'].location.reload(true);
				}
			}
			xmlhttp.open("GET","passnext.php?action=searchtable&"+query,true);
			xmlhttp.send(null);
			//return false;

			/*
			for (var ctr=0; ctr < (table.rows[r].cells.length -1); ctr++)
			{
				
				ele += table.rows[r].cells[ctr].innerHTML.replace(/<[^>]+>/g,"")+ ' ';				
			}

			if (ele.toLowerCase().indexOf(suche) >=0)
			{
				table.rows[r].style.display = '';
			}
			else 
			{
				table.rows[r].style.display = 'none';
			}
			*/
		//}
	}	
}
// function for save n delete

function datafetch(action,type,page) 
{ 
	//alert(type);
	xmlhttp4=getxmlhttpobject(); 
	xmlhttp4.onreadystatechange=function(){ 
		if (xmlhttp4.readyState==4){ 
			document.getElementById('allnews').innerHTML=xmlhttp4.responseText; 
		} 
	} 
    xmlhttp4.open("GET","pass.php?action=mgt_pagging&page="+page+"&type="+type,true); 
    xmlhttp4.send(null); 
}	


function showState(str){
	//alert(str);
	
	//showMethod(str);
	xmlhttp=getxmlhttpobject();	
	document.getElementById("model").innerHTML='<img src="images/working1.gif">';	
	//document.getElementById("cityname").innerHTML='<select name="city" class="blacktext"  id="city" style="width:172px"><option value="">&nbsp;</option></select>';
		xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4)
		{	
			//alert(xmlhttp.responseText);
			document.getElementById("model").innerHTML=xmlhttp.responseText;
		}
	}
	
	//alert("pass.php?action=changestatus&"+query)
	xmlhttp.open("GET","passnext.php?action=showAllModels&class=Indexpage&dc=yes&gsm_brand="+str,true);
	xmlhttp.send(null);
}




function showminssms(str){
	//alert(str);
	
	//showMethod(str);
	xmlhttp=getxmlhttpobject();	
	document.getElementById("showminssms").innerHTML='<img src="images/working1.gif">';	
	//document.getElementById("cityname").innerHTML='<select name="city" class="blacktext"  id="city" style="width:172px"><option value="">&nbsp;</option></select>';
		xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4)
		{	
			//alert(xmlhttp.responseText);
			document.getElementById("showminssms").innerHTML=xmlhttp.responseText;
		}
	}
	
	//alert("pass.php?action=changestatus&"+query)
	xmlhttp.open("GET","passnext.php?action=showAllMinSms&class=Indexpage&dc=yes&gsm_brand_model="+str,true);
	xmlhttp.send(null);
}







function showCity(str){
	//alert(str);
		//document.getElementById("statevalue").value=str;
	//var country = document.storefrm.country.value;
	//alert(document.getElementById("m__country").value);
	
	xmlhttp=getxmlhttpobject();
	document.getElementById("cityname").innerHTML='<img src="images/working1.gif">';
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4)
		{	
			//alert(xmlhttp.responseText);
			document.getElementById("cityname").innerHTML=xmlhttp.responseText;
		}
	}
	//alert(country);
	//alert("pass.php?action=changestatus&"+query)
	xmlhttp.open("GET","passnext.php?action=showCity&class=Postproject&dc=yes&state="+str,true);
	xmlhttp.send(null);
}




	

