// JavaScript Document


function autosuggesttemplatell()
{

var searchtext =document.getElementById('searchtext').value;
var searchtext1 ='sasa';

alert(searchtext1);
if(searchtext!=""){
 
var getcomobotext =searchtext1.split('@$#');
var noofcontent =getcomobotext.length;
var z="";
for(var i=0; i<noofcontent; i++)
{

var getcomobotextlower = getcomobotext[i].toLowerCase();
var searchtextlower    = searchtext.toLowerCase();

if(getcomobotextlower.match(searchtextlower))
  {
  
  var gt =getcomobotext[i];
  var getid =gt.split('#$@');
   
  
   
   //alert(getid[0]);
  // document.getElementById('canned').value =getid[0];
  // var cannedd="canned";
   
	//var makelower =getid[1].toLowerCase();   
	var ff=makelower.replace(searchtextlower, "<font color='green'  size='+1'><b><i>"+searchtextlower+"</i></b></font>"); 
	//z=z+"<br/><b><a href='javascript:getcontent("+getid[0]+")'>"+ff+"</a></b>";

   
   
   
  // var x =getid[0];
  // alert(x);
   
   //opts[x].selected = true;
   
 
  
  }

 var srchcombo =document.getElementById("srchcombo");
   srchcombo.innerHTML=z; 

}


//document.getElementById.value=fixedid[];
}else{
var srchcombo =document.getElementById("srchcombo");
   srchcombo.innerHTML=""; 
}
}
		
		
	function getHTTPObject() {
	var xmlhttp;
	
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
	{
		try 
		{
			xmlhttp = new XMLHttpRequest();
		} catch (e) {
		xmlhttp = false;
		}
	}
	return xmlhttp;
}	
		
		
var httpmatch = getHTTPObject();
var httpmatch1 = getHTTPObject();

var httpdisans = getHTTPObject();

function autosuggesttemplate()
{
var searchtext =document.getElementById('searchtext').value;
//alert("sapan string length"+searchtext.length);
if(searchtext!="" && searchtext.length>2){
httpmatch.abort();

 var srchcombo =document.getElementById("srchcombo");
   srchcombo.innerHTML="<center><img src='http://www.directorymaximizer.com/images/ajax-loader.gif'><font color='#990000'><b>Please wait, while we find the most relevant answers..</b>..</font></center>"; 


var sUrl="http://www.directorymaximizer.com/activekb/fq-analyze3.php";
httpmatch.open("POST", sUrl, true);
params="searchtext="+searchtext;
httpmatch.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
httpmatch.onreadystatechange=getmatchtext;

httpmatch.send(params);
}
else{
 var srchcombo =document.getElementById("srchcombo");
   srchcombo.innerHTML=""; 

}
}


function getmatchtext()
{
 if (httpmatch.readyState ==4) 
		{
			//document.getElementById("processu").style.display='none';
			var response = httpmatch.responseText;
			
			//alert(response);
			if(response!="")
			{
			
			 var srchcombo =document.getElementById("srchcombo");
   srchcombo.innerHTML=response; 
   
   //document.getElementById("srchcombo").style.border-left="1px solid #669900";
  
    
   
   }
   else{
   
    var srchcombo =document.getElementById("srchcombo");
   srchcombo.innerHTML=""; 
   
    }
        }

}

function displaydiv12(qid)
{
var hidediv="sar"+qid;
vardivid = document.getElementById(hidediv).style.display='none';

}


<!--*********************************************************-->

function displaydiv(searchtext,qid)
{


//alert("cuming to here");
httpdisans.abort();
var sUrl="fq-analyze2.php";
httpdisans.open("POST", sUrl, true);
params="searchtext="+searchtext+"&qid="+qid;
//alert(params);
httpdisans.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
httpdisans.onreadystatechange=divfinal;

httpdisans.send(params);


}


function divfinal()
{


 if (httpdisans.readyState ==4) 
		{
			//document.getElementById("processu").style.display='none';
			var response = httpdisans.responseText;
			
			//alert(response);
			if(response!="")
			{
			
		//	var vardivid="sa"+response;
			
	//		 var srchcombo1 =document.getElementById(vardivid);
   //srchcombo1.style.display='block'; 
   
   			//window.open('http://www.directorymaximizer.com/activekb/questions/'+response,'mywindow','width=5000,height=5000');
   
   //document.getElementById("srchcombo").style.border-left="1px solid #669900";
  
    
   
   }
   else{
   
   
   
    }
        }



}


function displaydiv1(searchtext,qid)
{


var h="sah"+qid;

document.getElementById(h).style.display='block'; 

var d="sad"+qid;
document.getElementById(d).style.display='none'; 
//alert("cuming to here");
httpdisans.abort();
var sUrl="http://www.directorymaximizer.com/activekb/fq-analyze2.php";
httpdisans.open("POST", sUrl, true);
params="searchtext="+searchtext+"&qid="+qid;
//alert(params);
httpdisans.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
httpdisans.onreadystatechange=divfinal1;

httpdisans.send(params);


}


function divfinal1()
{


 if (httpdisans.readyState ==4) 
		{
			//document.getElementById("processu").style.display='none';
			var response = httpdisans.responseText;
			
			//alert(response);
			if(response!="")
			{
			
			
			//window.open('http://www.directorymaximizer.com/activekb/questions/'+response,'mywindow','width=5000,height=5000');
			
			
			//var vardivid="sar"+response;
			
			// var srchcombo1 =document.getElementById(vardivid);
 //  srchcombo1.style.display='block'; 
   
   //document.getElementById("srchcombo").style.border-left="1px solid #669900";
  
    
   
   }
   else{
   
   
   
    }
        }



}




function autosuggesttemplate1()
{
var searchtext =document.getElementById('searchtext').value;
//alert("sapan string length"+searchtext.length);
if(searchtext!="" && searchtext.length>2){
httpmatch1.abort();
var sUrl="fq-analyze1.php";
httpmatch1.open("POST", sUrl, true);
params="searchtext="+searchtext;
httpmatch1.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
httpmatch1.onreadystatechange=getmatchtext1;

httpmatch1.send(params);
}
else{
 var srchcombo1 =document.getElementById("srchcombo1");
   srchcombo1.innerHTML=""; 

}
}


function getmatchtext1()
{
 if (httpmatch1.readyState ==4) 
		{
			//document.getElementById("processu").style.display='none';
			var response = httpmatch1.responseText;
			
			//alert(response);
			if(response!="")
			{
			
			 var srchcombo1 =document.getElementById("srchcombo1");
   srchcombo1.innerHTML=response; 
   
   //document.getElementById("srchcombo").style.border-left="1px solid #669900";
  
    
   
   }
   else{
   
    var srchcombo1 =document.getElementById("srchcombo1");
   srchcombo1.innerHTML=""; 
   
    }
        }

}



