function fade_div(id_div){
	//alert("ok");

      if ($("span#scat_"+id_div).is(":hidden")) {
		  //alert("show - div#scat_"+id_div);
		 document.getElementById('fleche'+id_div).style.display="";
		 document.getElementById('fleche2'+id_div).style.display="none";
        $("span#scat_"+id_div).show(500);
      } else {
		  //alert("hide - div#scat_"+id_div);
		  document.getElementById('fleche'+id_div).style.display="none";
		  document.getElementById('fleche2'+id_div).style.display="";
        $("span#scat_"+id_div).slideUp();
      }
}

function fade_scat(id_div){
	//alert("ok");

      if ($("span2#sscat_"+id_div).is(":hidden")) {
		  //alert("show - div#scat_"+id_div);
		 document.getElementById('s_fleche'+id_div).style.display="";
		 document.getElementById('s_fleche2'+id_div).style.display="none";
        $("span2#sscat_"+id_div).show(500);
      } else {
		  //alert("hide - div#scat_"+id_div);
		 document.getElementById('s_fleche'+id_div).style.display="none";
		 document.getElementById('s_fleche2'+id_div).style.display="";
        $("span2#sscat_"+id_div).slideUp();
      }
}

function show_other_docs(){
	if ($("div#autres_docs").is(":hidden")) {
		  //alert("show - div#scat_"+id_div);
        $("div#autres_docs").show("slow");
      } else {
		  //alert("hide - div#scat_"+id_div);
        $("div#autres_docs").slideUp();
      }
	
}
function display_reco(){
	if ($("div#reco").is(":hidden")) {
		  //alert("show - div#scat_"+id_div);
        $("div#reco").show("slow");
		document.getElementById('title_reco').style.fontWeight="bold";
		$("div#engag").slideUp();
		document.getElementById('title_engag').style.fontWeight="normal";
      } 
}

function display_engag(){
	if ($("div#engag").is(":hidden")) {
		  //alert("show - div#scat_"+id_div);
        $("div#engag").show("slow");
		document.getElementById('title_engag').style.fontWeight="bold";
		 $("div#reco").slideUp();
		document.getElementById('title_reco').style.fontWeight="normal";
      } 
}
function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
 	{
 		// Firefox, Opera 8.0+, Safari
		 xmlHttp=new XMLHttpRequest();
	 }
	catch (e)
 	{
 		//Internet Explorer
		 try
  		 {
  			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  		 }
		catch (e)
  		 {
  			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  		 }
	 }
  return xmlHttp;
} 
function load_search_boxes(){
	
	
	
	
}
function search_tool(page){
	xmlHttp=GetXmlHttpObject();
 	if (xmlHttp==null)
  	{
  		alert ("Browser does not support HTTP Request");
  		return;
  	} 
 	var url="includes/ajax.php";
 	xmlHttp.onreadystatechange=function(){
		 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
           {   
			//alert(xmlHttp.responseText);
			result = xmlHttp.responseText;
			document.getElementById('browse_content').innerHTML = result;
           }
	} 
 	xmlHttp.open("POST",url,true);
	var data = "page="+page+"&type=browse_styles";
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", data.length);
	xmlHttp.setRequestHeader("Connection", "close");
 	xmlHttp.send(data); 

}

function load_tab(j){
	var viewtab = 'tab_'+j;
	for(var i=1;i<7;i++){
		if(document.getElementById('tab_'+i)){
			document.getElementById('tab_'+i).style.display="none";
		}
	}
	$("div#"+viewtab).show(500);
	document.getElementById('page_select_'+j).style.fontWeight="bold";	
}

function display_all_comment(div,content){
	document.getElementById(div).innerHTML=document.getElementById(content).value;
}