/* Javascript pour page de Serge Delbono */

/* cookies things */
//by hallcrash (cookie monster)
var bites = document.cookie.split(";"); // This is to break cookie down into an array of bites
var today = new Date();
var expiry = new Date(today.getTime() + 1 * 24 * 60 * 60 * 1000); // 1 jour

function getCookie(name) {
   for (i=0; i < bites.length; i++) {
     nextbite = bites[i].split("="); // break into the "name & value"
     if (nextbite[0] == name) // if the name = true
       return unescape(nextbite[1]); // return this value
  }
  return null; // if there is no match return nothing, nata, zipo!
}
// Set cookie with given name = value pair
function setCookie(name, value) {
    if (value != null && value != "")
      document.cookie=name + "=" + escape(value) + "; expires=" + expiry.toGMTString();
    bites = document.cookie.split(";"); // update all the bites
}

/* Explose la frame */
function noframe()
{
 if (top.location != self.location)
 top.location.href = self.location.href;
}
/* calcule base URL courante */
function mybase()
{
	var chemin=location.href;
	var l = chemin.length;
	l--;
	while (chemin.charAt(l) !="/")
		chemin = chemin.substring(0,l--);
	return chemin;
}

/* ouverture fenêtre annexe */
function openwin(fich, nom)
{
	if ((window.name != "jukebox") && (window.name !="plan")) window.name="parent";
	h= window.innerHeight;
	if (typeof h != "number") h=410;
	x=window.open(fich, nom,
"toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=350,height="+h);
	x.focus() ;
}
/* menu déroulant */
function chgpage(formulaire)
{
if (formulaire.listepages.selectedIndex != 0)
   {
    location.href = formulaire.listepages.options[formulaire.listepages.selectedIndex].value + ".php";
   }
}


