var xhr = null; 
var n=0;
var page_from;
var fl_calendar = 0;
var tview = "display_data";


function isDate(sDate) 
{
	var scratch = new Date(sDate);
	if (scratch.toString() == "NaN" || scratch.toString() == "Invalid Date") 
	{
		alert("Not a Date");
		return false;
	} 
	else 
	{
	 return true;
	}
}	

function getXhr()
{
if(window.XMLHttpRequest)xhr = new XMLHttpRequest(); 
else if(window.ActiveXObject)
  { 
  try{
     xhr = new ActiveXObject("Msxml2.XMLHTTP");
     } catch (e) 
     {
     xhr = new ActiveXObject("Microsoft.XMLHTTP");
     }
  }
else 
  {
  alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
  xhr = false; 
  } 
}

function mylogon()
{

  getXhr();
  xhr.onreadystatechange = function()
    {
     if(xhr.readyState == 4 && xhr.status == 200)
     {     
	 document.getElementById('thumb_contener').innerHTML=eval(xhr.responseText);
	// cleanXML(xhr.responseXML.documentElement);
     }
	 else
	 {     
	// alert(xhr.readyState);
	 }
    }

   xhr.open("POST",'letmein.php',true);
   xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
 
  
    send_login = document.getElementById('login');
	send_login = send_login.value;
    send_login = encodeURIComponent(send_login);
	send_login = send_login.replace(/'/g, "\'");  
    send_login = send_login.replace("../..", ".."); 
	
	
	send_pwd = document.getElementById('pwd');
	send_pwd = send_pwd.value;
    send_pwd = encodeURIComponent(send_pwd);
	send_pwd = send_pwd.replace(/'/g, "\'");  
    send_pwd = send_pwd.replace("../..", ".."); 
	
	xhr.send("sended_login="+send_login+"&sended_pwd="+send_pwd);
}

function load_icomm(id_memo)
{
  getXhr();
  xhr.onreadystatechange = function()
    {
     if(xhr.readyState == 4 && xhr.status == 200)
     {     
	 document.getElementById('icomment').innerHTML=xhr.responseText;
	// cleanXML(xhr.responseXML.documentElement);
     }
	 else
	 {     
	 //alert(xhr.readyState);
	 }
    }

  xhr.open("POST",'comment_form.php',true);
  xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
  xhr.send("id_memo="+id_memo);
 }


function chgcat2(id_cat)
{
//alert('chgcat2');
getXhr();
xhr.onreadystatechange = function()
    {
     if(xhr.readyState == 4 && xhr.status == 200)
     {     
	 document.getElementById('thumb_contener').innerHTML=xhr.responseText;
	// cleanXML(xhr.responseXML.documentElement);
     }
	 else
	 {     
	 alert(xhr.readyState);
	 }
    }

xhr.open("GET","thumbnails.php?pg="+id_cat,true);
xhr.send(null);
}

function chgcat(id_cat,nb_img)
 {
  //alert(id_next); 
   
  
  getXhr();
  xhr.onreadystatechange = function()
   {
    if(xhr.readyState == 4 && xhr.status == 200)
     {
      // Nous remplacons le contenu du div iris par le retour de "ajax/ajaxiris.php"
	  // alert(xhr.responseText);
      
	  
	  id_img_med_default = document.images['img_med'].src;
	  document.getElementById("img_med").src = id_img_med_default;	  
      document.getElementById('right_top_content').innerHTML = xhr.responseText;
	  if (nb_img < 6)
	  {
		//alert(nb_img); 
		document.getElementById("thumb_contener").style.width = '410px';
		//alert(document.getElementById("thumb_contener").style.width);
		v_vitesse = 0;
		currentleft = 0;
      } 
	  else
	  {
	   t_width = 420*(Math.ceil(nb_img/5));
	   max_scroll_right = (-1)*(t_width - 380);
	   document.getElementById("thumb_contener").style.width = t_width+'px';
	   currentleft = 0;
	   v_vitesse = 8;
	  }
	  
	  
      if($$('.mb').length > 0)//only triggered if 'mb' class found on page
	  {
		var initMultiBox = new multiBox('mb', {
			descClassName: 'multiBoxDesc',//the class name of the description divs
			path: './Files/',//path to mp3 and flv players
			useOverlay: true,//use a semi-transparent background. default: false;
			maxWidth: 1000,//max width (set to false to disable)
			maxHeight: 800,//max height (set to false to disable)
			addDownload: false,//do you want the files to be downloadable?
			pathToDownloadScript: './Scripts/ForceDownload.asp',//if above is true, specify download script
			addRollover: true,//add rollover fade to each multibox link
			addOverlayIcon: true,//adds overlay icons to images within multibox links
			addChain: true,//cycle through all images fading them out then in
			recalcTop: true//subtract the height of controls panel from top position
		});
	  };
	  
	  //var box = {};box = new MultiBox("mb", {descClassName: "multiBoxDesc", useOverlay: true});	  
	 // id_img_med_default = document.getElementById("img_med").src;	
	    
     }
	 else
	 {     
	// alert("state:"+xhr.readyState);
	// alert("status:"+xhr.status);
	 }
   }
  xhr.open("POST",'thumbnails.php',true);
  xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');  
  xhr.send("id_proj="+id_cat);
  //xhr.send("nex="+id_next);
 }

 function chgcat_view_2(id_cat,nb_img)
 {
  //alert(id_next); 
   
  
  getXhr();
  xhr.onreadystatechange = function()
   {
    if(xhr.readyState == 4 && xhr.status == 200)
     {
      // Nous remplacons le contenu du div iris par le retour de "ajax/ajaxiris.php"
	  // alert(xhr.responseText);
   
      document.getElementById('cat_content_detail').innerHTML = xhr.responseText;  
		
	 
	  
	  
      if($$('.mb').length > 0)//only triggered if 'mb' class found on page
	  {
		var initMultiBox = new multiBox('mb', {
			descClassName: 'multiBoxDesc',//the class name of the description divs
			path: './Files/',//path to mp3 and flv players
			useOverlay: true,//use a semi-transparent background. default: false;
			maxWidth: 1000,//max width (set to false to disable)
			maxHeight: 800,//max height (set to false to disable)
			addDownload: false,//do you want the files to be downloadable?
			pathToDownloadScript: './Scripts/ForceDownload.asp',//if above is true, specify download script
			addRollover: true,//add rollover fade to each multibox link
			addOverlayIcon: true,//adds overlay icons to images within multibox links
			addChain: true,//cycle through all images fading them out then in
			recalcTop: true//subtract the height of controls panel from top position
		});
	  };
	  
	  //var box = {};box = new MultiBox("mb", {descClassName: "multiBoxDesc", useOverlay: true});	  
	 // id_img_med_default = document.getElementById("img_med").src;	
	    
     }
	 else
	 {     
	// alert("state:"+xhr.readyState);
	// alert("status:"+xhr.status);
	 }
   }
  xhr.open("POST",'view_2_detail.php',true);
  xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');  
  xhr.send("id_proj="+id_cat);
  //xhr.send("nex="+id_next);
 }

 function preview()
 {
 //alert('coco');
  getXhr();
  xhr.onreadystatechange = function()
   {
     // alert('coco2');
    if(xhr.readyState == 4 && xhr.status == 200)
     {
      // Nous remplacons le contenu du div iris par le retour de "ajax/ajaxiris.php"
	  // alert(xhr.responseText);
      
	//   alert('coco3');
      document.getElementById('preview').innerHTML = xhr.responseText;
  
	  
      if($$('.mb_preview').length > 0)//only triggered if 'mb' class found on page
	  {
		var initMultiBox = new multiBox('mb_preview', {
			descClassName: 'multiBoxDesc',//the class name of the description divs
			path: './Files/',//path to mp3 and flv players
			useOverlay: true,//use a semi-transparent background. default: false;
			maxWidth: 1000,//max width (set to false to disable)
			maxHeight: 800,//max height (set to false to disable)
			addDownload: false,//do you want the files to be downloadable?
			pathToDownloadScript: './Scripts/ForceDownload.asp',//if above is true, specify download script
			addRollover: true,//add rollover fade to each multibox link
			addOverlayIcon: true,//adds overlay icons to images within multibox links
			addChain: true,//cycle through all images fading them out then in
			recalcTop: true//subtract the height of controls panel from top position
		});
	  };
	 
     }
	 else
	 {     
	// alert("state:"+xhr.readyState);
	  //alert("status:"+xhr.status);
	 }
   }
  xhr.open("POST",'vs4/preview_detail.php',true);
  xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');  
  xhr.send("id_proj=1");
  //xhr.send("nex="+id_next);
 }
 
 function charge_comment(submenu,divcontener,paramval)
 { 
   getXhr();
   getXhr();
  xhr.onreadystatechange = function()
    {
     if(xhr.readyState == 4 && xhr.status == 200)
     {     
	 document.getElementById('icomment').innerHTML=xhr.responseText;
	// cleanXML(xhr.responseXML.documentElement);
     }
	 else
	 {     
	 //alert(xhr.readyState);
	 }
    }

   xhr.open("POST",'comment_insert.php',true);
   xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
 
    id_memo = document.getElementById('id_memo');
	id_memo = id_memo.value;
    id_memo = encodeURIComponent(id_memo);
	id_memo = id_memo.replace(/'/g, "\'");  
    id_memo = id_memo.replace("../..", ".."); 
	
	send_name = document.getElementById('send_name');
	send_name = send_name.value;
    send_name = encodeURIComponent(send_name);
	send_name = send_name.replace(/'/g, "\'");  
    send_name = send_name.replace("../..", ".."); 
	
	fl_newsletter = document.getElementById('fl_newsletter');
	fl_newsletter =  fl_newsletter.checked;
    /* fl_newsletter = encodeURIComponent(fl_newsletter);
	fl_newsletter = fl_newsletter.replace(/'/g, "\'");  
    fl_newsletter = fl_newsletter.replace("../..", ".."); 
 */
	send_adress = document.getElementById('send_adress');
	send_adress = send_adress.value;
    send_adress = encodeURIComponent(send_adress);
	send_adress = send_adress.replace(/'/g, "\'");  
    send_adress = send_adress.replace("../..", ".."); 

	send_web = document.getElementById('send_web');
    send_web = send_web.value;
	send_web = encodeURIComponent(send_web);
	send_web = send_web.replace(/'/g, "\'");  
    send_web = send_web.replace("../..", ".."); 

    send_content = document.getElementById('send_content');
    send_content = send_content.value;
    send_content = encodeURIComponent(send_content);
	send_content = send_content.replace(/'/g, "\'");  
    send_content = send_content.replace("../..", ".."); 
 
   // fl_notif = document.getElementById('fl_newsletter');
   //fl_notif = fl_newsletter.checked;
   	
    xhr.send("id_memo="+id_memo+"&fl_newsletter="+fl_newsletter+"&send_name="+send_name+"&send_adress="+send_adress+"&send_web="+send_web+"&send_content="+send_content+"&page_from="+page_from);
  
  }
 
 
 function charge_browse(paramval)
 {
 
 // alert(paramval);
  getXhr();
  xhr.onreadystatechange = function()
   {
    if(xhr.readyState == 4 && xhr.status == 200)
     {
   	    document.getElementById('subcontent').innerHTML = xhr.responseText;	    
	
		multiBox_name = 'browse_img';
	
	 	 if($$('.'+multiBox_name).length > 0)//only triggered if 'mb' class found on page
		 {
			var initMultiBox = new multiBox(multiBox_name, {
				descClassName: 'multiBoxDesc',//the class name of the description divs
				path: './Files/',//path to mp3 and flv players
				useOverlay: true,//use a semi-transparent background. default: false;
				maxWidth: 1280,//max width (set to false to disable)
				maxHeight: 1024,//max height (set to false to disable)
				addDownload: false,//do you want the files to be downloadable?
				pathToDownloadScript: './Scripts/ForceDownload.asp',//if above is true, specify download script
				addRollover: true,//add rollover fade to each multibox link
				addOverlayIcon: true,//adds overlay icons to images within multibox links
				addChain: true,//cycle through all images fading them out then in
				recalcTop: true//subtract the height of controls panel from top position
			});
			};
     }
	 else
	 {     
	// alert("state:"+xhr.readyState);
	// alert("status:"+xhr.status);
	 }
   }
  xhr.open("POST",'browse.php',true);
  xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');  
  xhr.send("path_send="+paramval);
 }
 
  function charge_fileloader(paramval)
 {
 
 // alert(paramval);
  getXhr();
  xhr.onreadystatechange = function()
   {
    if(xhr.readyState == 4 && xhr.status == 200)
     {
   	    document.getElementById('subcontent').innerHTML = xhr.responseText;	    
	
		multiBox_name = 'browse_img';
	
	 	 if($$('.'+multiBox_name).length > 0)//only triggered if 'mb' class found on page
		 {
			var initMultiBox = new multiBox(multiBox_name, {
				descClassName: 'multiBoxDesc',//the class name of the description divs
				path: './Files/',//path to mp3 and flv players
				useOverlay: true,//use a semi-transparent background. default: false;
				maxWidth: 1280,//max width (set to false to disable)
				maxHeight: 1024,//max height (set to false to disable)
				addDownload: false,//do you want the files to be downloadable?
				pathToDownloadScript: './Scripts/ForceDownload.asp',//if above is true, specify download script
				addRollover: true,//add rollover fade to each multibox link
				addOverlayIcon: true,//adds overlay icons to images within multibox links
				addChain: true,//cycle through all images fading them out then in
				recalcTop: true//subtract the height of controls panel from top position
			});
			};
     }
	 else
	 {     
	// alert("state:"+xhr.readyState);
	// alert("status:"+xhr.status);
	 }
   }
  xhr.open("POST",'fileloader.php',true);
  xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');  
  fl_crea = document.getElementById('fl_crea');
  fl_crea = fl_crea.checked;	
  xhr.send("path_send="+paramval+"&fl_crea="+fl_crea);
 }
 
 function change_view(nv)
 {
  //alert(nv);
  tview = nv;
//  alert(tview);
  load_view(nv)
  close_subcontent ();
  }
  
 function load_view(nv)
 {
  //alert(nv);
 // tview = nv;
//  alert(tview);
 // close_subcontent ();
  getXhr();
 // alert('coco');
  xhr.onreadystatechange = function()
   {
    if(xhr.readyState == 4 && xhr.status == 200)
     {
   	    document.getElementById('display_data').innerHTML = xhr.responseText;	    
		
		  if($$('.mb').length > 0)//only triggered if 'mb' class found on page
	  {
		var initMultiBox = new multiBox('mb', {
			descClassName: 'multiBoxDesc',//the class name of the description divs
			path: './Files/',//path to mp3 and flv players
			useOverlay: true,//use a semi-transparent background. default: false;
			maxWidth: 1000,//max width (set to false to disable)
			maxHeight: 800,//max height (set to false to disable)
			addDownload: false,//do you want the files to be downloadable?
			pathToDownloadScript: './Scripts/ForceDownload.asp',//if above is true, specify download script
			addRollover: true,//add rollover fade to each multibox link
			addOverlayIcon: true,//adds overlay icons to images within multibox links
			addChain: true,//cycle through all images fading them out then in
			recalcTop: true//subtract the height of controls panel from top position
		});
	  };
     }
	 else
	 {     
	// alert("state:"+xhr.readyState);
	// alert("status:"+xhr.status);
	 }
   }
  xhr.open("POST",nv+'.php',true);
  xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');  
  xhr.send("type_content=1");
 }
 
 
 function charge_fl_off_online(fl_off_online)
 {
  getXhr();
  xhr.onreadystatechange = function()
   {
    if(xhr.readyState == 4 && xhr.status == 200)
     {
   	    document.getElementById('pt1').innerHTML = xhr.responseText;	    
     }
	 else
	 {     
	// alert("state:"+xhr.readyState);
	// alert("status:"+xhr.status);
	 }
   }
  xhr.open("POST",'portail_content.php',true);
  xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');  
  xhr.send("fl_off_online="+fl_off_online);
 }
 
 function chargesubmenu_portail(submenu,divcontener,paramval)
 {
  //alert(paramval);
 document.getElementById('globsubcontent').style.display='block'; 
 document.getElementById('subcontent').style.display='block';
 document.getElementById('layer7').style.display='block';
  getXhr();
  xhr.onreadystatechange = function()
   {
    if(xhr.readyState == 4 && xhr.status == 200)
     {
      
      document.getElementById('subcontent').innerHTML = xhr.responseText;
 	   multiBox_name = 'browse_img';
	
	 	 if($$('.'+multiBox_name).length > 0)//only triggered if 'mb' class found on page
		 {
			var initMultiBox = new multiBox(multiBox_name, {
				descClassName: 'multiBoxDesc',//the class name of the description divs
				path: './Files/',//path to mp3 and flv players
				useOverlay: true,//use a semi-transparent background. default: false;
				maxWidth: 1280,//max width (set to false to disable)
				maxHeight: 1024,//max height (set to false to disable)
				addDownload: false,//do you want the files to be downloadable?
				pathToDownloadScript: './Scripts/ForceDownload.asp',//if above is true, specify download script
				addRollover: true,//add rollover fade to each multibox link
				addOverlayIcon: true,//adds overlay icons to images within multibox links
				addChain: true,//cycle through all images fading them out then in
				recalcTop: true//subtract the height of controls panel from top position
			});
			};
     }
	 else
	 {     
	 //alert("state:"+xhr.readyState);
	 //alert("status:"+xhr.status);
	 }
   }
  xhr.open("POST",paramval,true);
  xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');  
  xhr.send("sned='rac'");
 }

 
 
 function charge_browse(paramval)
 {
 
 // alert(paramval);
  getXhr();
  xhr.onreadystatechange = function()
   {
    if(xhr.readyState == 4 && xhr.status == 200)
     {
   	    document.getElementById('subcontent').innerHTML = xhr.responseText;	    
	
		multiBox_name = 'browse_img';
	
	 	 if($$('.'+multiBox_name).length > 0)//only triggered if 'mb' class found on page
		 {
			var initMultiBox = new multiBox(multiBox_name, {
				descClassName: 'multiBoxDesc',//the class name of the description divs
				path: './Files/',//path to mp3 and flv players
				useOverlay: true,//use a semi-transparent background. default: false;
				maxWidth: 1280,//max width (set to false to disable)
				maxHeight: 1024,//max height (set to false to disable)
				addDownload: false,//do you want the files to be downloadable?
				pathToDownloadScript: './Scripts/ForceDownload.asp',//if above is true, specify download script
				addRollover: true,//add rollover fade to each multibox link
				addOverlayIcon: true,//adds overlay icons to images within multibox links
				addChain: true,//cycle through all images fading them out then in
				recalcTop: true//subtract the height of controls panel from top position
			});
			};
     }
	 else
	 {     
	// alert("state:"+xhr.readyState);
	// alert("status:"+xhr.status);
	 }
   }
  xhr.open("POST",'browse.php',true);

  xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');  
  xhr.send("path_send="+paramval);
 }
 
  function charge_fileloader(paramval)
 {
 
 // alert(paramval);
  getXhr();
  xhr.onreadystatechange = function()
   {
    if(xhr.readyState == 4 && xhr.status == 200)
     {
   	    document.getElementById('subcontent').innerHTML = xhr.responseText;	    
	
		multiBox_name = 'browse_img';
	
	 	 if($$('.'+multiBox_name).length > 0)//only triggered if 'mb' class found on page
		 {
			var initMultiBox = new multiBox(multiBox_name, {
				descClassName: 'multiBoxDesc',//the class name of the description divs
				path: './Files/',//path to mp3 and flv players
				useOverlay: true,//use a semi-transparent background. default: false;
				maxWidth: 1280,//max width (set to false to disable)
				maxHeight: 1024,//max height (set to false to disable)
				addDownload: false,//do you want the files to be downloadable?
				pathToDownloadScript: './Scripts/ForceDownload.asp',//if above is true, specify download script
				addRollover: true,//add rollover fade to each multibox link
				addOverlayIcon: true,//adds overlay icons to images within multibox links
				addChain: true,//cycle through all images fading them out then in
				recalcTop: true//subtract the height of controls panel from top position
			});
			};
     }
	 else
	 {     
	// alert("state:"+xhr.readyState);
	// alert("status:"+xhr.status);
	 }
   }
  xhr.open("POST",'fileloader.php',true);
  xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');  
  fl_crea = document.getElementById('fl_crea');
  fl_crea = fl_crea.checked;	
  xhr.send("path_send="+paramval+"&fl_crea="+fl_crea);
 }
 
 function charge_fl_off_online(fl_off_online)
 {
  getXhr();
  xhr.onreadystatechange = function()
   {
    if(xhr.readyState == 4 && xhr.status == 200)
     {
   	    document.getElementById('pt1').innerHTML = xhr.responseText;	    
     }
	 else
	 {     
	// alert("state:"+xhr.readyState);
	// alert("status:"+xhr.status);
	 }
   }
  xhr.open("POST",'portail_content.php',true);
  xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');  
  xhr.send("fl_off_online="+fl_off_online);
 }
 
 function chargesubmenu_portail(submenu,divcontener,paramval)
 {
  //alert(paramval);
 document.getElementById('globsubcontent').style.display='block'; 
 document.getElementById('subcontent').style.display='block';
 document.getElementById('layer7').style.display='block';
  getXhr();
  xhr.onreadystatechange = function()
   {
    if(xhr.readyState == 4 && xhr.status == 200)
     {
      
      document.getElementById('subcontent').innerHTML = xhr.responseText;
 	   multiBox_name = 'browse_img';
	
	 	 if($$('.'+multiBox_name).length > 0)//only triggered if 'mb' class found on page
		 {
			var initMultiBox = new multiBox(multiBox_name, {
				descClassName: 'multiBoxDesc',//the class name of the description divs
				path: './Files/',//path to mp3 and flv players
				useOverlay: true,//use a semi-transparent background. default: false;
				maxWidth: 1280,//max width (set to false to disable)
				maxHeight: 1024,//max height (set to false to disable)
				addDownload: false,//do you want the files to be downloadable?
				pathToDownloadScript: './Scripts/ForceDownload.asp',//if above is true, specify download script
				addRollover: true,//add rollover fade to each multibox link
				addOverlayIcon: true,//adds overlay icons to images within multibox links
				addChain: true,//cycle through all images fading them out then in
				recalcTop: true//subtract the height of controls panel from top position
			});
			};
     }
	 else
	 {     
	 //alert("state:"+xhr.readyState);
	 //alert("status:"+xhr.status);
	 }
   }
  xhr.open("POST",paramval,true);
  xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');  
  xhr.send("sned='rac'");
 }

 function chargetextarea(type_area)
 {
  getXhr();
  xhr.onreadystatechange = function()
   {
    if(xhr.readyState == 4 && xhr.status == 200)
     {
     
	  if (type_area == "divmytiny")
		{  
			document.getElementById('divmytiny').display = "none";	  
		}
	  if(type_area == "divtextarea")
	   {     
		document.getElementById('divtextarea').display = "none";	  
		}
	}	
   }
  xhr.open("POST",'area_maj.php',true);
  xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
 
  if (type_area == "divmytiny")
  {
  
    send_tabfrom = document.getElementById('tabfrom');
	send_tabfrom = send_tabfrom.value;
    send_tabfrom = encodeURIComponent(send_tabfrom);
	send_tabfrom = send_tabfrom.replace(/'/g, "\'");  
    send_tabfrom = send_tabfrom.replace("../..", ".."); 

    send_col_name = document.getElementById('col_name');
	send_col_name = send_col_name.value;
    send_col_name = encodeURIComponent(send_col_name);
	send_col_name = send_col_name.replace(/'/g, "\'");  
    send_col_name = send_col_name.replace("../..", ".."); 

    send_key = document.getElementById('key');
	send_key = send_key.value;
    send_key = encodeURIComponent(send_key);
	send_key = send_key.replace(/'/g, "\'");  
    send_key = send_key.replace("../..", ".."); 

    send_val_comment = type_area;	
	
/*	tinyMCE.execCommand('mceFocus', true, 'btext_content_maj' ); */
	send_btext_content_maj = tinyMCE.get('btext_content_maj').getContent();
	send_btext_content_maj = encodeURIComponent(send_btext_content_maj);
	send_btext_content_maj = send_btext_content_maj.replace(/'/g, "\'");  
    send_btext_content_maj = send_btext_content_maj.replace("../..", ".."); 	
	
   }
   else
   {
   
    send_tabfrom = document.getElementById('tabfrom_t');
	send_tabfrom = send_tabfrom.value;
    send_tabfrom = encodeURIComponent(send_tabfrom);
	send_tabfrom = send_tabfrom.replace(/'/g, "\'");  
    send_tabfrom = send_tabfrom.replace("../..", ".."); 

    send_col_name = document.getElementById('col_name_t');
	send_col_name = send_col_name.value;
    send_col_name = encodeURIComponent(send_col_name);
	send_col_name = send_col_name.replace(/'/g, "\'");  
    send_col_name = send_col_name.replace("../..", ".."); 
	
    send_key = document.getElementById('key_t');
	send_key = send_key.value;
    send_key = encodeURIComponent(send_key);
	send_key = send_key.replace(/'/g, "\'");  
    send_key = send_key.replace("../..", ".."); 

    send_val_comment = type_area;

	send_btext_content_maj = document.getElementById('textarea_content_maj');
	send_btext_content_maj = send_btext_content_maj.value;
    send_btext_content_maj = encodeURIComponent(send_btext_content_maj);
	send_btext_content_maj = send_btext_content_maj.replace(/'/g, "\'");  
    send_btext_content_maj = send_btext_content_maj.replace("../..", ".."); 
	
    }
	
  xhr.send("val_comment="+send_val_comment+"&val_tab="+send_tabfrom+"&col_name="+send_col_name+"&the_key="+send_key+"&textarea_content_maj="+send_btext_content_maj);
  
 }
 
 
function startUpload(){
      document.getElementById('f1_upload_process').style.visibility = 'visible';
      document.getElementById('f1_upload_form').style.visibility = 'hidden';
      return true;
}

function stopUpload(success,fk_parent,fk_med,step,fl_existe_db,fl_existe_serv,msg_ret){
    //  var result = '';
//	 alert('success :'+success);
//	 alert('step :'+step);
//	 alert('msg_ret:'+msg_ret);
	  //alert('fl_existe_serv:'+fl_existe_serv);
	 //
	 
	
	 
      if (success == 1)
	  {
         result = '<span class="msg" style="color:green;">Chargement reussi !<br/>'+msg_ret+'<\/span><br/><br/>';
		
		  document.getElementById('send_step').value = step;
      }
      else 
	  {
         result = '<span class="emsg" style="color:red;"> Erreur lors du chargement ! \n '+msg_ret+'<\/span><br/><br/>';
		 if (fl_existe_serv == 1)
		 {
		  document.getElementById('send_fl_ecraser_serv').checked = true;
		  }
		 else
         {		 
		  document.getElementById('send_fl_ecraser_serv').checked = false;
		 }

		if (fl_existe_db == 1)
		 {
		  document.getElementById('send_fl_ecraser_db').checked = true;
		  }
		 else
         {		 
		  document.getElementById('send_fl_ecraser_db').checked = false;
		 }		 
      }
	  
	   document.getElementById('f1_upload_process').style.visibility = 'hidden';
	   document.getElementById('send_fk_parent').value = fk_parent; 
	   
	   
	 // step  = step + 1;
     
	  switch(step)
      {
       case 2 : 
		 document.getElementById('send_step_displayed').value = step+"-"+"Insertion de la vignette";
		break;
		
	   case 3 :
	     document.getElementById('send_fk_img_med').value = fk_med; 
		 document.getElementById('send_step_displayed').value = step+"-"+"Insertion de la previsualisation";
		break;
	   
      }	  
	  
	  if ((step == 1) || (step ==2) || (step == 3))
	  {
      document.getElementById('f1_upload_form').innerHTML = result + '<label>File: <input name="myfile"  type="file" style="color:#000000;" size="50" /><\/label><label><input type="submit" name="submitBtn" class="sbtn" value="Upload" /><\/label>';
      document.getElementById('f1_upload_form').style.visibility = 'visible';      
	  }
	  else
	  {
	   if(step == 4)
	   {
		document.getElementById('f1_upload_form').innerHTML = result ;
		 document.getElementById('f1_upload_form').style.visibility = 'visible';
		}
	  }
      return true;   
}

function chargesubmenu(submenu,divcontener,paramval)
 {
 
 //alert(submenu);
 //alert(divcontener);
 
   if (submenu !='btext_insert')
	{	
	 m_display_chargesubmenu(submenu,divcontener,paramval);
	}
	
	if ((submenu == "calendrier") && (paramval =='') && (fl_calendar == 1))
	{
	  fl_calendar = 0;
	  subtmp = "toto";
	  submenu = 'blog_list';
	  //chargesubmenu('calendrier','blog_form_contener','');
	}
	else
	{
	 if ((submenu == "calendrier") && (paramval =='') && (fl_calendar == 0))
	 {
	   fl_calendar = 1;
	   
	 }
	 else
	 {
	 subtmp = "";
	 fl_calendar = 0;
	 }
	}
    
  var firstSubmenu='';
 if (submenu!='404')
 {
	firstSubmenu=submenu;
 } 
 
//	alert(submenu);
//    alert(paramval);

	
  if ((paramval != 'blog') && (submenu != 'blog_detail') && (submenu !='blog_list') && (submenu !='blog_list_tag') && (submenu !='calendrier') && (submenu !='btext_insert'))
  {
  document.getElementById('layer7').style.display = 'block';   
  }
   
	
  getXhr();
  xhr.onreadystatechange = function()
   {
    if(xhr.readyState == 4 && xhr.status == 200)
     {
      // Nous remplacons le contenu du div iris par le retour de "ajax/ajaxiris.php"	  
	  if (submenu=="mytiny")
	  {
	 
      document.getElementById(divcontener).innerHTML = eval(xhr.responseText);
	  }
	  
	  
	  else
	  {
	  
	  if (submenu == "btext_insert")    // A commenter si on veut voir le retour d'insertion
		 {
			//m_display_chargesubmenu(submenu,divcontener,paramval);
			 divcontener = "subcontent";
			 }
			// document.getElementById('subcontent').style.display = 'block';   
	  
	  
	   document.getElementById(divcontener).innerHTML = xhr.responseText;
	  
      if (submenu == 'news')
	  {
	
		//SAMPLE 4 (walk to item)
		var nS4 = new noobSlide({
			box: $('box4'),
			items: $$('#box4 div'),
			size: 737,
			handles: $$('#handles4 span'),
			onWalk: function(currentItem,currentHandle){
			/*	$('info4').set('html',currentItem.getFirst().innerHTML);  */
				this.handles.removeClass('active');
				currentHandle.addClass('active');
			}
		});
	  }
	   if (submenu == 'weblinks')
	  {
	
		//SAMPLE 4 (walk to item)
		var nS5 = new noobSlide({
			box: $('box4_weblinks'),
			items: $$('#box4_weblinks div'),
			size: 737,
			handles: $$('#handles4 span'),
			onWalk: function(currentItem,currentHandle){
			/*	$('info4').set('html',currentItem.getFirst().innerHTML);  */
				this.handles.removeClass('active');
				currentHandle.addClass('active');
			}
		});
	  }
	  
	  if (submenu == 'bio')
		{
		  multiBox_name = 'blog_detail';
		}
	 else
		{
		  multiBox_name = submenu;	
		}	
	if((submenu == 'news') || (submenu == 'flash_photo')) 
	{
	 	if($$('.news_photo').length > 0)//only triggered if 'mb' class found on page
		{
			var initMultiBox = new multiBox('news_photo', {
				descClassName: 'multiBoxDesc',//the class name of the description divs
				path: './Files/',//path to mp3 and flv players
				useOverlay: true,//use a semi-transparent background. default: false;
				maxWidth: 1000,//max width (set to false to disable)
				maxHeight: 800,//max height (set to false to disable)
				addDownload: false,//do you want the files to be downloadable?
				addRollover: true,//add rollover fade to each multibox link
				addOverlayIcon: false,//adds overlay icons to images within multibox links
				addChain: true,//cycle through all images fading them out then in
				recalcTop: true//subtract the height of controls panel from top position
			});
		}; 
	 }
	else
	 {
	// alert(multiBox_name);
	 if($$('.'+multiBox_name).length > 0)//only triggered if 'mb' class found on page
	 {
		var initMultiBox = new multiBox(multiBox_name, {
			descClassName: 'multiBoxDesc',//the class name of the description divs
			path: './Files/',//path to mp3 and flv players
			useOverlay: true,//use a semi-transparent background. default: false;
			maxWidth: 1000,//max width (set to false to disable)
			maxHeight: 800,//max height (set to false to disable)
			addDownload: false,//do you want the files to be downloadable?
			pathToDownloadScript: './Scripts/ForceDownload.asp',//if above is true, specify download script
			addRollover: true,//add rollover fade to each multibox link
			addOverlayIcon: true,//adds overlay icons to images within multibox links
			addChain: true,//cycle through all images fading them out then in
			recalcTop: true//subtract the height of controls panel from top position
		});
		
	 };
	 }
	 //  var box2 = {};box2 = new MultiBox(submenu, {descClassName: "multiBoxDesc", useOverlay: true});	  
	  }
	   
    }
	 else
	 {     
	 //alert("state:"+xhr.readyState);
	 if (xhr.readyState==4)
	 {
		if(xhr.status==404) 
		{		
	      chargesubmenu(xhr.status)
		}	
	 }
	// alert("status:"+xhr.status);
	 }
   }
   
   page_from = paramval;
   
    if(page_from =='contact' || page_from =='guestbook' || page_from =='weblinks' || page_from =='bio')
	{
	//	alert(page_from);
	//	document.getElementById('page_from').value = page_from;
	//document.getElementById('ombre').style.display='block';
	}
 
   switch (submenu)
	{
	 case 'blog_list_tag':
		 pagename = "blog_list.php";
		break;
		
	 case 'element':
	 	    
		 switch (paramval)
		 {
		  case "charge" :
			 pagename = "element.php";
			 break;
		  case "save" : 		
			 pagename = "element_maj.php";
			 break;
		  case "insert" : 		
			 pagename = "element_maj.php";
			 break; 
		  case "delete" : 		
			 pagename = "element_maj.php";
			 break;  
		  case "new_element" : 		
			 pagename = "element.php";
			 break; 
		  case "recherche" :
			 pagename = "element.php";
			 break;	 
		  }	 
		  break;
		 
    default : 
	
	pagename = submenu+".php";
   
    }	
  
  xhr.open("POST",pagename,true);
  xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
 
 //alert(paramval);
 if(paramval =="blog")
 {
  // new BarackSlideshow('menu', 'menu', 'loading');
 }
  
  
  
  if (submenu=="contact_insert")
  {
    
	send_name = document.getElementById('send_name');
	send_name = send_name.value;
    send_name = encodeURIComponent(send_name);
	send_name = send_name.replace(/'/g, "\'");  
    send_name = send_name.replace("../..", ".."); 

	send_adress = document.getElementById('send_adress');
	send_adress = send_adress.value;
    send_adress = encodeURIComponent(send_adress);
	send_adress = send_adress.replace(/'/g, "\'");  
    send_adress = send_adress.replace("../..", ".."); 

	send_web = document.getElementById('send_web');
    send_web = send_web.value;
	send_web = encodeURIComponent(send_web);
	send_web = send_web.replace(/'/g, "\'");  
    send_web = send_web.replace("../..", ".."); 

    send_content = document.getElementById('send_content');
    send_content = send_content.value;
    send_content = encodeURIComponent(send_content);
	send_content = send_content.replace(/'/g, "\'");  
    send_content = send_content.replace("../..", ".."); 
 
    fl_newsletter = document.getElementById('fl_newsletter');
    fl_newsletter = fl_newsletter.checked;
    
    if(page_from =="contact")
	{
	 divcontener = "subcontent";
	}
	
    xhr.send("send_name="+send_name+"&send_adress="+send_adress+"&send_web="+send_web+"&send_content="+send_content+"&fl_newsletter="+fl_newsletter+"&page_from="+page_from);
  
  }
    
   if (submenu=="btext_insert")
  {  
     
	 send_checkbox_cat = document.getElementById('send_checkbox_cat');
	 send_checkbox_cat = send_checkbox_cat.value;  
	 
     //alert(send_checkbox_cat_val);
	 li_pos_deb = 1;	 
	 li_pos_fin = 8;
	 	 
	 li_pos_fin = send_checkbox_cat.indexOf(",",li_pos_deb);
	 
	  var val_to_send = "";
	 
     do   
	 {
	   li_pos_fin = send_checkbox_cat.indexOf(",",li_pos_deb);
	   
	//   alert(li_pos_fin);
	   
	   if (li_pos_fin != -1)
	   	  {		   
		    ls_temp_check_val = send_checkbox_cat.substring(li_pos_deb, li_pos_fin);		   
	//	   alert(ls_temp_check_val);
		    li_pos_deb = li_pos_fin + 1;		   
		   
		    send_checkbox_name = "send_checkbox_"+ls_temp_check_val;	   
		   
	        send_checkbox_crt = document.getElementById(send_checkbox_name);
			send_checkbox_crt = send_checkbox_crt.checked;
			
		    val_to_send = val_to_send+"&"+send_checkbox_name+"="+send_checkbox_crt;
		   }		   
		  else
			{			 
			 ls_temp_check_val = send_checkbox_cat.substring(li_pos_deb, send_checkbox_cat.length);
			             		
			 send_checkbox_name = "send_checkbox_"+ls_temp_check_val;
	    	 send_checkbox_crt = document.getElementById(send_checkbox_name);
			 send_checkbox_crt = send_checkbox_crt.checked;
			
			 val_to_send = val_to_send+"&"+send_checkbox_name+"="+send_checkbox_crt;
			 }
		  		  
	 }
	 while (li_pos_fin != -1);
	    
	  var ed = tinyMCE.get('btext_content');
      btext_content = ed.getContent();
  
	  btitle = document.getElementById('btitle');
	  btitle = encodeURIComponent(btitle.value);
	  
	  send_checkbox = document.getElementById('send_checkbox');
	  send_checkbox = send_checkbox.checked;
	  
	  //send_checkbox = send_checkbox.value;
	  
	 btext_content = encodeURIComponent(ed.getContent());
	 btext_content = btext_content.replace(/'/g, "\'");  
	 btext_content = btext_content.replace("../..", ".."); 
	 
	 // alert(btext_content);
	    
	  xhr.send("send_checkbox="+send_checkbox+"&btitle="+btitle+"&btext_content="+btext_content+"&page_from="+page_from+val_to_send);
   
  }
   else if(submenu == 'news')
  {  
   xhr.send("submenu="+submenu);
  }
  else if(submenu == 'guestbook_detail')
  {
   xhr.send("id_guestbook="+paramval);
  }
  else if((submenu == 'blog_detail') || (submenu == 'blog_thumb_list'))
  {
   xhr.send("id_memo="+paramval);
  }
  
  else if(submenu == 'blog_list') 
  { 
   if (paramval == '')
   {
	   if (subtmp == 'toto')
	   {
	   send_rech="";
	   }
	   else
	   {
	     send_rech = encodeURIComponent(document.getElementById('send_rech').value);		
	    send_rech = send_rech.replace(/'/g, "\'");  
	    send_rech = send_rech.replace("../..", "..");     
	   }
	   xhr.send("rech="+send_rech);
	}
	
	else
	{
	// alert(paramval);
	  xhr.send("date_send="+paramval);	 
	}
	
  }
  else if(submenu == 'blog_list_tag')
  {    
   xhr.send("send_tag="+paramval);
  }
  
  else if(submenu == 'calendrier')
  {  
   xhr.send("chn_date="+paramval);
  }
    
  else if(submenu == 'element_query')
  {  
   //alert(paramval);
   xhr.send("val_tab="+paramval);
  }
  
  
  else if(submenu == 'element')
  {
    	 
   switch (paramval)
	{
	case 'charge':
	
		val_tab = document.getElementById('val_tab');
		val_tab = val_tab.value;
		 
		send_id = document.getElementById('send_id');
		if(send_id.length > 0)
		{
		send_id=send_id.options[send_id.selectedIndex].value;
		xhr.send("action_to_do="+paramval+"&val_tab="+val_tab+"&send_id="+send_id);
		}
		else
		{
		xhr.send("action_to_do=new_element&val_tab="+val_tab);	
		}
	break;
	
	case 'recherche':
	
		val_tab = document.getElementById('val_tab');
		val_tab = val_tab.value;
		 
		send_col_name_rech = document.getElementById('send_col_name_rech');
		send_col_name_rech = send_col_name_rech.options[send_col_name_rech.selectedIndex].value;
		
		send_rech = encodeURIComponent(document.getElementById('send_rech').value);
	    send_rech = send_rech.replace(/'/g, "\'");  
	    send_rech = send_rech.replace("../..", "..");     
				
	    xhr.send("action_to_do="+paramval+"&val_tab="+val_tab+"&send_col_name_rech="+send_col_name_rech+"&send_rech="+send_rech);
		
	break;
	
	case 'delete':
	
	   //alert('Etes-vous certain de vouloir Effacer cette ligne ?')
	
		val_tab = document.getElementById('val_tab');
		val_tab = val_tab.value;
		 
		send_id = document.getElementById('send_id');
		send_id=send_id.options[send_id.selectedIndex].value;
			    
	    xhr.send("action_to_do="+paramval+"&val_tab="+val_tab+"&send_id="+send_id);
		
	break;
	
	
	case 'save':
	
		 send_col = document.getElementById('send_col');
		 send_col = send_col.value;
	// alert(send_col);
		
		 val_tab = document.getElementById('val_tab');
		 val_tab = val_tab.value;
		 ////alert(val_tab);
		
		// saucissonnage --------------------------------------------------
				
		 var val_input_to_send = "";
		  
	     send_input_val = send_col;
		
		 li_pos_deb = 1;	 
		 li_pos_fin = send_input_val.length;
	
	     do   
		 {
		   li_pos_fin = send_input_val.indexOf(",",li_pos_deb);
		   
		////   alert(li_pos_fin);
		   
		   if (li_pos_fin != -1)
		   	  {		   
			    ls_temp_val = send_input_val.substring(li_pos_deb, li_pos_fin);		   
			//   alert(ls_temp_val);
			    li_pos_deb = li_pos_fin + 1;		   
			   
			    send_name = "send_"+ls_temp_val;			   			   
		    	send_crt = document.getElementById(send_name);
							
				switch (send_crt.type)
				{				
				 case 'checkbox' :									 
					 send_val = send_crt.checked;
				     break;
					 
				 case 'select' :
					//
					break;
					
				 case 'texterea' :
					//
					break;
				 
				 default:
					send_val = send_crt.value;
								  
					send_val = encodeURIComponent(send_val);
					send_val = send_val.replace(/'/g, "\'");  
					send_val = send_val.replace("../..", ".."); 
				
				 }				
				
			    val_input_to_send = val_input_to_send+"&"+send_name+"="+send_val;
			   }		   
			  else
				{			 
				 ls_temp_val = send_input_val.substring(li_pos_deb, send_input_val.length);
				             		
				 send_name = "send_"+ls_temp_val;
		    	 send_crt = document.getElementById(send_name);				
				 send_val= send_crt.value;

				 switch (send_crt.type)
				 {				
				  case 'checkbox' :									 
					 send_val = send_crt.checked;
				     break;
					 
				  case 'select' :
					//
					break;
					
				  case 'texterea' :
					//
					break;
				 
				  default:
					send_val = send_crt.value;
								  
					send_val = encodeURIComponent(send_val);
					send_val = send_val.replace(/'/g, "\'");  
					send_val = send_val.replace("../..", ".."); 				
				 }

				 val_input_to_send = val_input_to_send+"&"+send_name+"="+send_val;
				}
			  		  
		 }
		 while (li_pos_fin != -1);
			
		//alert (val_input_to_send);	
		////--------------------------------------------------------------------
			
		
		
	//	send_id = document.getElementById('send_id');
	//	send_id=send_id.options[send_id.selectedIndex].value;
			    
	    xhr.send("action_to_do="+paramval+"&val_tab="+val_tab+val_input_to_send);	
		
		
	break;
	
	case 'insert':
	
		 send_col = document.getElementById('send_col');
		 send_col = send_col.value;
		 //alert(send_col);
		
		 val_tab = document.getElementById('val_tab');
		 val_tab = val_tab.value;
		 ////alert(val_tab);
		
		// saucissonnage --------------------------------------------------
				
		 var val_input_to_send = "";
		  
	     send_input_val = send_col;
		
		 li_pos_deb = 1;	 
		 li_pos_fin = send_input_val.length;
	
	     do   
		 {
		   li_pos_fin = send_input_val.indexOf(",",li_pos_deb);
		   
		////   alert(li_pos_fin);
		   
		   if (li_pos_fin != -1)
		   	  {		   
			    ls_temp_val = send_input_val.substring(li_pos_deb, li_pos_fin);		   
		////	   alert(ls_temp_check_val);
			    li_pos_deb = li_pos_fin + 1;		   
			   
			    send_name = "send_"+ls_temp_val;			   			   
		    	send_crt = document.getElementById(send_name);
				
				switch (send_crt.type)
				{				
				 case 'checkbox' :									 
					 send_val = send_crt.checked;
				     break;
					 
				 case 'select' :
					//
					break;
					
				 case 'texterea' :
					//
					break;
				 
				 default:
					send_val = send_crt.value;
								  
					send_val = encodeURIComponent(send_val);
					send_val = send_val.replace(/'/g, "\'");  
					send_val = send_val.replace("../..", ".."); 
				
				 }				
				
			    val_input_to_send = val_input_to_send+"&"+send_name+"="+send_val;
			   }		   
			  else
				{			 
				 ls_temp_val = send_input_val.substring(li_pos_deb, send_input_val.length);
				             		
				 send_name = "send_"+ls_temp_val;
		    	 send_crt = document.getElementById(send_name);
				 send_val= send_crt.value;

				 switch (send_crt.type)
				 {				
				  case 'checkbox' :									 
					 send_val = send_crt.checked;
				     break;
					 
				  case 'select' :
					//
					break;
					
				  case 'texterea' :
					//
					break;
				 
				  default:
					send_val = send_crt.value;
								  
					send_val = encodeURIComponent(send_val);
					send_val = send_val.replace(/'/g, "\'");  
					send_val = send_val.replace("../..", ".."); 				
				 }

				 val_input_to_send = val_input_to_send+"&"+send_name+"="+send_val;
				}
			  		  
		 }
		 while (li_pos_fin != -1);
			
		//alert (val_input_to_send);	
		////--------------------------------------------------------------------
			
		
		
	//	send_id = document.getElementById('send_id');
	//	send_id=send_id.options[send_id.selectedIndex].value;
			    
	    xhr.send("action_to_do="+paramval+"&val_tab="+val_tab+val_input_to_send);	
		
		
	break;
	
	
	case 'new_element': 
	
		send_col = document.getElementById('send_col');
		send_col = send_col.value;		
		
		val_tab = document.getElementById('val_tab');
		val_tab = val_tab.value;
		
	//	send_id = document.getElementById('send_id');
	//	send_id=send_id.options[send_id.selectedIndex].value;
			    
	    xhr.send("action_to_do="+paramval+"&val_tab="+val_tab);	
		
	break;
	
	default :
	
		
		val_tab = document.getElementById('val_tab');
		val_tab = val_tab.value;
		 
		//send_id = document.getElementById('send_id');
		//send_id=send_id.options[send_id.selectedIndex].value;
		
		send_id = paramval;
		
		val_tab = document.getElementById('val_tab');
		val_tab = val_tab.value;
	 	 
		send_col_name_rech = document.getElementById('send_col_name_rech');
		send_col_name_rech = send_col_name_rech.options[send_col_name_rech.selectedIndex].value;
		
		send_rech = encodeURIComponent(document.getElementById('send_rech').value);
	    send_rech = send_rech.replace(/'/g, "\'");  
	    send_rech = send_rech.replace("../..", "..");     
		
    //    xhr.send("action_to_do="+paramval);
		
//	alert(paramval);	
	    xhr.send("action_to_do="+paramval+"&val_tab="+val_tab+"&send_col_name_rech="+send_col_name_rech+"&send_rech="+send_rech+"&val_tab="+val_tab+"&send_id="+send_id);

	break;
	//default: alert('Action non définie');
	
	}

     
  }
  else if ((submenu=="mytiny")|| (submenu=="mytextarea"))
  {
  
   // alert(paramval);
   
    saucisson = paramval;
    li_pos_deb = 0;	 
	i=0;
	li_pos_fin = saucisson.length;
	//li_pos_fin = saucisson.indexOf(",",li_pos_deb);
    val_to_send = "";
    do   
	 {
	   li_pos_fin = saucisson.indexOf(",",li_pos_deb);
        
	   if (li_pos_fin != -1)
	   {		   
		   ls_temp_val = saucisson.substring(li_pos_deb, li_pos_fin);		   	       
		   li_pos_deb = li_pos_fin + 1;		
		   if(i==0)
		   {
		    val_to_send = ls_temp_val;
		   }
		   else
		   {
		    val_to_send = val_to_send+"&"+ls_temp_val;
		   }
		}		   
		else
		{			 
		   ls_temp_val = saucisson.substring(li_pos_deb, saucisson.length);			        		
		   if(i==0)
		   {
		    val_to_send = ls_temp_val;
		   }
		   else
		   {
		    val_to_send = val_to_send+"&"+ls_temp_val;
		   }
		}
	  i++;	  		  
	 }
	 while (li_pos_fin != -1);
  //alert(val_to_send);
  xhr.send(val_to_send);
      
  }
  
  else
  {    
   xhr.send("type_content="+firstSubmenu);
   }
 }
 xhr = null;