pic1= new Image();
pic1.src="Fond.png";
pic2= new Image();
pic2.src="fond01.png";



function xhr(){
var xmlHttp=null;
try{xmlHttp=new XMLHttpRequest();}
catch (e){
try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch (e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}

/*detect/count clicks function */

/*Fin detect/count clicks function */

/*ajax flash tabs*/
first=new xhr();
function flash_01() {
first.open("get", 'flash_01.htm', true);
first.setRequestHeader('If-Modified-Since','Wed, 05 Apr 2006 00:00:00 GMT');
first.onreadystatechange = function() {
if(first.readyState == 1){document.getElementById("container").innerHTML="loading...";}
if(first.readyState == 4){
document.getElementById("container").innerHTML = first.responseText;
                 				}
			};
first.send(null);
               };


second=new xhr();
function flash_02() {
second.open("get", 'flash_02.htm', true);
second.setRequestHeader('If-Modified-Since','Wed, 05 Apr 2006 00:00:00 GMT');
second.onreadystatechange = function() {
if(second.readyState == 1){document.getElementById("container2").innerHTML="loading...";}
if(second.readyState == 4){
document.getElementById("container2").innerHTML = second.responseText;
                 				}
			};
second.send(null);
               };


third=new xhr();
function flash_03() {
third.open("get", 'flash_03.htm', true);
third.setRequestHeader('If-Modified-Since','Wed, 05 Apr 2006 00:00:00 GMT');
third.onreadystatechange = function() {
if(third.readyState == 1){document.getElementById("container3").innerHTML="loading...";}
if(third.readyState == 4){
document.getElementById("container3").innerHTML = third.responseText;
                 				}
			};
third.send(null);
               };



forth=new xhr();
function flash_04() {
forth.open("get", 'flash_04.htm', true);
forth.setRequestHeader('If-Modified-Since','Wed, 05 Apr 2006 00:00:00 GMT');
forth.onreadystatechange = function() {
if(forth.readyState == 1){document.getElementById("container4").innerHTML="loading...";}
if(forth.readyState == 4){
document.getElementById("container4").innerHTML = forth.responseText;
                 				}
			};
forth.send(null);
               };



fifth=new xhr();
function flash_05() {
fifth.open("get", 'flash_05.htm', true);
fifth.setRequestHeader('If-Modified-Since','Wed, 05 Apr 2006 00:00:00 GMT');
fifth.onreadystatechange = function() {
if(fifth.readyState == 1){document.getElementById("container5").innerHTML="loading...";}
if(fifth.readyState == 4){
document.getElementById("container5").innerHTML = fifth.responseText;
                 				}
			};
fifth.send(null);
               };




/*recommander ce blog*/
o= new xhr()
function Validation(){
var params="civilite="+document.recommander_ce_blog.civilite.value+"&nom="+document.recommander_ce_blog.nom.value+"&email="+document.recommander_ce_blog.email.value+"&email_sender="+document.recommander_ce_blog.email_sender.value+"&message="+document.recommander_ce_blog.message.value+"&id="+Math.random();
o.open("post","validation_recommander_ce_blog.php?",true)
o.setRequestHeader('If-Modified-Since','Wed, 05 Apr 2006 00:00:00 GMT');
o.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
/*o.setRequestHeader('Content-Type', 'text/html; charset=UTF-8');*/
o.setRequestHeader("Content-length", params.length);
o.send(params)
o.onreadystatechange=function(){
   if (o.readyState == 4 ) {
var div=document.getElementById('error_message')
div.innerHTML = o.responseText;
if (div.innerHTML=="Merci votre e-mail a été envoyé"){
document.getElementById("recommander_ce_blog").style.display="none";
            }
      }
}

}
/*fin recommander ce blog*/

/*contact depts*/
function validation(){
  if(document.form_contacts_depts.civilite.value==""){
     document.form_contacts_depts.civilite.options[0].style.backgroundColor="#FF5E5E";}
     else  {document.form_contacts_depts.civilite.options[0].style.backgroundColor="white";}

 if(document.form_contacts_depts.nom.value==""){
     document.form_contacts_depts.nom.style.border="2px solid red";}
     else{ document.form_contacts_depts.nom.style.border="2px solid gray";}

 if(document.form_contacts_depts.email.value=="" || document.getElementById("error_message").innerHTML=="un e-mail valide svp")  {
     document.form_contacts_depts.email.style.border="2px solid red";}
     else{ document.form_contacts_depts.email.style.border="2px solid gray";}

   if(document.form_contacts_depts.departement.value==""){
     document.form_contacts_depts.departement.options[0].style.backgroundColor="#FF5E5E";}
     else{ document.form_contacts_depts.departement.options[0].style.backgroundColor="white";}

  if(document.form_contacts_depts.message.value==""){
     document.form_contacts_depts.message.style.border="2px solid red";}
     else{ document.form_contacts_depts.message.style.border="2px solid gray";}

    /* alert(document.myform.departement.options[3].value) */
}

mail= new xhr()
function _mail(){
var params="civilite="+document.form_contacts_depts.civilite.value+"&nom="+document.form_contacts_depts.nom.value+"&email="+document.form_contacts_depts.email.value+"&departement="+document.form_contacts_depts.departement.value+"&message="+document.form_contacts_depts.message.value+"&id="+Math.random();
mail.open("post","validation_contact_depts.php?",true)
mail.setRequestHeader('If-Modified-Since','Wed, 05 Apr 2006 00:00:00 GMT');
mail.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
mail.setRequestHeader("Content-length", params.length);
mail.send(params)
mail.onreadystatechange=function(){
 /*if  (mail.readyState == 1 ){alert("1")}*/
   if (mail.readyState == 4 ) {
  document.getElementById("error_message").innerHTML=mail.responseText;

  if (document.getElementById("error_message").innerHTML=="Merci votre message a été envoyé"){
document.getElementById("form_contacts_depts").style.display="none";
            }
         }
        }
     }
/*fin contact depts*/



/*if (document.images){
pic1= new Image();
pic1.src="";

pic2= new Image();
pic2.src="";

pic3= new Image();
pic3.src="";
}*/



jQuery(document).ready(function(){
/*flash_01();
jQuery("#container").load("flash_01.htm");*/

jQuery("div#adbox a.tab_link:first").addClass('active');

jQuery("div#adbox a.tab_link").click(function(){
jQuery(this).addClass('active').siblings().removeClass('active').siblings("container");
jQuery(this).next("div.container").show().siblings("div.container").hide();
})

jQuery("div#s6").cycle({
    fx:'scrollLeft',
    timeout:2000,
    pause:1
 });


    jQuery("div#s7").cycle({
    fx:'fade',
    speed:   500,
    timeout:6000,
    pause:1
 });

jQuery("div#recommander_cet_article").slideDown(400);

/* alert("zz");*/
});