function popup_page(url) {
	popup_document = window.open(url,"page", "width=795, height=768, scrollbars=1");
	popup_document.focus();
return false;
}
function appel_thesaurus(){
popup = window.open("/thesaurus/index.php","thesaurus", "width=795, height=768, scrollbars=1");
popup.focus();
return false;
}
function selectionner(selection){
var XHR = new XHRConnection();
//document.getElementById('').innerHTML = '<p>Recherche en cours</p>';
XHR.appendData("selection", selection);
XHR.sendAndLoad("selectionner.do.php", "GET", affiche_selectionner);
}
function affiche_selectionner(obj){
	if (document.getElementById('selection1').value ==''){
			
			document.getElementById('selection1').value = obj.responseXML.getElementsByTagName('selection').item(0).firstChild.data;
	return false;
	}
	if (document.getElementById('selection2').value ==''){
			
			document.getElementById('selection2').value = obj.responseXML.getElementsByTagName('selection').item(0).firstChild.data;
	return false;
	}
	if (document.getElementById('selection3').value ==''){
			
			document.getElementById('selection3').value = obj.responseXML.getElementsByTagName('selection').item(0).firstChild.data;
	return false;
	}
	alert('vous ne pouvez pas choisir plus de trois termes');
}

function choisir_et_quitter(){
var selection='';
if (!document.getElementById('selection1').value ==''){
selection=document.getElementById('selection1').value;
}
if (!document.getElementById('selection2').value ==''){
selection+=' ; '+document.getElementById('selection2').value;
}
if (!document.getElementById('selection3').value ==''){
selection+=' ; '+document.getElementById('selection3').value;
}
window.opener.document.getElementById('sujet').value = selection;
window.close();
}
function naviguer (terme){
var XHR = new XHRConnection();
XHR.appendData("terme", terme);
XHR.sendAndLoad("naviguer.do.php", "GET", navigue);

}

function navigue (obj){

document.getElementById('navigation').innerHTML=obj.responseXML.getElementsByTagName('navigation').item(0).firstChild.data;;
}