// JavaScripts utilisés pour tout le site www.comcannelle.com










///////////////////////////////Préchargement des images///////////////////////////////////



function load() {

	if (document.images) {

		this.length=load.arguments.length;

		for (var i=0;i<this.length;i++) {

			this[i+1]=new Image();

			this[i+1].src=load.arguments[i];

		}

	}

}




//////////////////////////////Mettre la page en favoris web///////////////////////////////////



function ajFavori() {

if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")) {

window.sidebar.addPanel("Comcannelle, Croquez la com.", "http://www.comcannelle.com/", "");

}

else if (window.external) {

window.external.AddFavorite("http://www.comcannelle.com/", "Comcannelle, Croquez la com.");

}

}





///////////////////////////////Mettre l'icone dans les favoris web/////////////////////////////////



 if (document.getElementById)

     {

     fromPub = 0;

     iVolePub = new Image;

     iVolePub.src = "http://www.comcannelle.com/favicon.gif";

    offsetyPub=0;

    HauteurPub = 0;

     place = fromPub;

     xpub = 1;

    ypub = 1;

    }

 

 function RandomDep()

     {

    numimagePub= Math.round(Math.random()*4);

     numimagePub ++;

     return(numimagePub);

     }

  

 function VolimPub()

     {

     if(document.all)

         {

         EcranlargPub = document.body.clientWidth-iVolePub.width;

        EcranhautPub = document.body.clientHeight-iVolePub.height;    

        }

     else

         {

         EcranlargPub = screen.width-100;

         EcranhautPub = screen.height-100;

         }

     if (document.getElementById)

         {

         if (place > EcranlargPub)

             xpub = (-(RandomDep()));

        if (place < fromPub)

             xpub = RandomDep();

         document.getElementById("pubBulle").style.left = (place = place + xpub);

         document.getElementById("pubBulle").style.top = (HauteurPub += ypub)+offsetyPub;

         if (HauteurPub>EcranhautPub)

             ypub = (-(RandomDep()));

         if (HauteurPub<0)

             ypub = RandomDep();

         tempo36 = setTimeout('VolimPub()', 50);

         }

     }

  

 function OffSet()

     {

     if (navigator.appName=="Microsoft Internet Explorer")

            offsetyPub = document.body.scrollTop;

     }

window.onload = VolimPub;

onscroll = OffSet;





/*********************************Flash 8 version ****************************/



<!--

// -----------------------------------------------------------------------------

// Globals

// Major version of Flash required

var requiredMajorVersion = 8;

// Minor version of Flash required

var requiredMinorVersion = 0;

// Minor version of Flash required

var requiredRevision = 0;

// -----------------------------------------------------------------------------

// -->



/**************change la date (JJ/MM/AAAA en AAAA/MM/JJ) pour MySQL ***********/



function changedate(CHAMP,CHAMP1)

{

var date = document.forms[0].elements[CHAMP].value;

var jour = date.substring(0,2);

var mois = date.substring(3,5);

var annee = date.substring(6,10);



date = annee  + "/" + mois  + "/" + jour;



document.forms[0].elements[CHAMP1].value = date;



}

/**************Formulaire de contacts ***********/

windowWidth=200;
windowHeight=278;
if (parseInt(navigator.appVersion) >= 4)window.moveTo((screen.width/2)(windowWidth/2+10),(screen.height/2)-(windowHeight/2+20));

function chiffres2(zone)	//~~ ne saisir que des chiffres ~~
{  zone.value=zone.value.replace(/([^0-9])/g,"");  }
