/* The variable http will hold our new XMLHttpRequest object. */
var httpObj = createRequestObject();

/*Holds a fields id when we are doing a callback */
var id=-1;

function searchAll(page){			
	document.getElementById('searchtagresponse').innerHTML="<div class=\"full\" style=\"text-align:center\" /><img src=\"images/indicator.gif\" /></div>";
	enableButtons(false);	
	
	if(document.getElementById('searchtag')) {
		find = document.getElementById('searchtag').value;
	}
		
	var params = "action=searchall";
    	params    += "&query=" + find;
	params    += "&page=" + page;
                     	
	/*httpObj.abort; Not IE6 Compatible */ 
	httpObj.open('post',  'actions.inc.php');
	httpObj.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	httpObj.setRequestHeader("Content-length", params.length);    
	httpObj.onreadystatechange = updateSearchByListTag;	
	httpObj.send(params);
	return true;
}

function searchAllUsingGet(page, find){		
	document.getElementById('searchtagresponse').innerHTML="<div class=\"full\" style=\"text-align:center\" /><img src=\"images/indicator.gif\" /></div>";
	enableButtons(false);
	
	var params = "action=searchall";
	params    += "&query=" + find;
	params    += "&page=" + page;
                     
	/*httpObj.abort;*/
	httpObj.open('post',  'actions.inc.php');
	httpObj.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
        httpObj.setRequestHeader("Content-length", params.length);    
	httpObj.onreadystatechange = updateSearchByListTag;
        httpObj.send(params);
	return true;
}


function updateSearchByListTag(){					
	if(httpObj.readyState == 4){				
		document.getElementById('searchtagresponse').innerHTML=httpObj.responseText;		
	}
	
	enableButtons(true);
}