var action_w="si";


function getSampleImages(){
	var removeDiv=document.getElementById(action_w);
	removeChild(removeDiv);
	var target="/web?action=si&q="+document.ask.q.value;
	//alert("target  : "+target);
	doCompletion(target);
}
function doCompletion(target){
	initRequest();
	xhr.onreadystatechange=useHttpResponse;
	xhr.open("post", target, true);
	xhr.send(null);
} 
function initRequest(){
	if(window.XMLHttpRequest){
		xhr = new XMLHttpRequest();
		}else if(window.ActiveXObject){
			xhr = new ActiveXObject("Microsoft.XMLHTTP");
	}
} 
function useHttpResponse(){
	if(xhr.readyState == 4){
		if(xhr.status == 200){
			//alert("::::"+xhr.responseText);
			processSearch(xhr.responseText);
	}else{failedTOConnect();}
	
	}
}
function processSearch(result){
	//alert("result before :"+result);
	
	//if(action_w=="newsContent"){
		var resultSet=document.getElementById(action_w);
		resultSet.innerHTML=result;
		getTestSearch("createCookie","");
		//if(!isBreak){getTestSearch("sponsors","");}
	//}
}
function removeChild(parentElement){
	while(parentElement.firstChild){
		parentElement.removeChild(parentElement.firstChild);
	}
}