function getMembers(page,first,letter) {
//mesaj pentru utilizator in timpul cautarii
document.getElementById('listMembers').innerHTML="<div class=\"q-result\"><strong>Cautare in curs ... Va rugam asteptati!</strong></div>";	


	var input;	// hold input value; what users searches for
	var pf ;	// boolean variable; true -> if user want to search for "persoane fizice"; false -> if user want to search for "persoane juridice"
	var filialaIndex;	// holds the index of the selected optiopn from dropdown
	var filiala;		// holds the name of the selected option from dropdown
	var first2; 
	
	input 	= document.getElementById("inputSearch").value; // get the string user to search for it
	first2 	= letter;
		
	pf		= document.getElementById("pf").checked;
	filialaIndex	= document.getElementById("filiala").selectedIndex;			// get the selected node index
	filiala			= document.getElementById("filiala")[filialaIndex].value;	// get the selected node value
	
	search(input,filiala,pf,page,first,first2);
}

function showHideDetails(id){
		if(document.getElementById(id).style.visibility == "visible"){
           document.getElementById(id).style.visibility = "hidden";
           document.getElementById(id).style.height = "0px";
           document.getElementById("details_"+id).value = "mai multe detalii";
        }
        else{
            document.getElementById(id).style.visibility = "visible";
            document.getElementById(id).style.height = "auto";
            document.getElementById("details_"+id).value = "mai putine detalii";
			}
}





function search(input,filiala,pf,page,first,first2){

var searchXmlhttp;
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  searchXmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  // code for IE6, IE5
  searchXmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
else
  {
  alert("Your browser does not support XMLHTTP!");
  }

searchXmlhttp.onreadystatechange=function()
{

if(searchXmlhttp.readyState==4)
  {
  document.getElementById('listMembers').innerHTML=searchXmlhttp.responseText;
  }
  
}
searchXmlhttp.open("GET","http://www.ceccar.ro/searchMembersBKP.php?name="+input+"&currentPage="+page+"&filiala="+filiala+"&pf="+pf+"&first="+first+"&first2="+first2,true);
searchXmlhttp.send(null);
}