
/***********************************************
* Switch Menu script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
		if(el.style.display != "block"){ //DynamicDrive.com change
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu") //DynamicDrive.com change
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}

function non(clic) {
var msg="Opération réservée à celui qui a créé ce site";
if (navigator.appName == 'Netscape' && clic.which==3) {
alert(msg);
return false;}
else
if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) {
alert(msg);
return false;
}
return true;
}
document.onmousedown = non;


function affich_menu(site)
{
<!-- Keep all menus within masterdiv-->
document.write('<div id="masterdiv">');
if (site=="chien")
{
document.write('	<div class="menutitle" onclick="SwitchMenu(\'sub1\')">Info site</div>');
document.write('	<span class="submenu" id="sub1">');
document.write('		- <a href="../Pages_html_fra/plan.php">Plan du site</a>');
document.write('	</span>');
document.write('	<div class="menutitle" onclick="SwitchMenu(\'sub2\')">Infos chiens</div>');
document.write('	<span class="submenu" id="sub2">');
document.write('		- <a href="../Pages_html_fra/Infos.php">Infos Arka</a><br>');
document.write('		- <a href="../Pages_html_fra/dico.php">Mon vocabulaire</a><br>');
document.write('    - <a href="../faq/index.php">FAQ chiens</a><br>');
document.write('	</span>');

document.write('	<div class="menutitle" onclick="SwitchMenu(\'sub3\')">Encyclo chiens</div>');
document.write('	<span class="submenu" id="sub3">');
document.write('		- <a href="../Pages_html_fra/encyclo_chien.php">Encyclopédie</a><br>');				
document.write('		- <a href="../Pages_html_fra/liste_alpha.php">Liste alphabétique</a><br>');
document.write('		- <a href="../Pages_html_fra/liste_alpha_c.php">Liste avec synonymes</a><br>');
document.write('		- <a href="../Pages_html_fra/liste_photo_cherchee.php">Photos recherchées</a><br>');
document.write('		- <a href="http://arkasdogs.webheberg.com/galerie/">Des autres photos</a><br>');
document.write('		- <a href="../Pages_html_fra/liste_sites.php">Liste des sites participant</a><br>');
document.write('    - <a href="../Pages_html_fra/Lire_new_avis.php">Voir les avis des maîtres</a><br>');
document.write('	</span>');

document.write('	<div class="menutitle" onclick="SwitchMenu(\'sub5\')">Album photo</div>');
document.write('	<span class="submenu" id="sub5">');
document.write('		- <a href="../Pages_html_fra/Photo1.php">Page 1</a>&nbsp;');
document.write('		- <a href="../Pages_html_fra/Photo2.php">Page 2</a><br>');
document.write('		- <a href="../Pages_html_fra/Photo3.php">Page 3</a>&nbsp;');
document.write('		- <a href="../Pages_html_fra/Photo4.php">Page 4</a><br>');
document.write('		- <a href="../Pages_html_fra/Photo5.php">Page 5</a>&nbsp;');
document.write('		- <a href="../Pages_html_fra/Photo6.php">Page 6</a><br>');
document.write('		- <a href="../Pages_html_fra/Photo7.php">Page 7</a>&nbsp;');
document.write('  	- <a href="../Pages_html_fra/Photo8.php">Page 8</a><br>			');					
document.write('  	- <a href="../Pages_html_fra/Photo9.php">Page 9</a>&nbsp;');
document.write('  	- <a href="../Pages_html_fra/Photo10.php">Page 10</a><br>');
document.write('  	- <a href="../Pages_html_fra/Photo11.php">Page 11</a>&nbsp;');
document.write('  	- <a href="../Pages_html_fra/Photo12.php">Page 12</a><br>');
document.write('  	- <a href="../Pages_html_fra/Photo13.php">Page 13</a>&nbsp;	');
document.write('  	- <a href="../Pages_html_fra/Photo14.php">Page 14</a><br>');
document.write('  	- <a href="../Pages_html_fra/Photo15.php">Page 15</a>&nbsp;	');
document.write('  	- <a href="../Pages_html_fra/Photo16.php">Page 16</a><br>		');
document.write('  	- <a href="../Pages_html_fra/Photo17.php">Page 17</a>&nbsp;	');
document.write('  	- <a href="../Pages_html_fra/Photo18.php">Page 18</a><br>');			
document.write('  	- <a href="../Pages_html_fra/Photo19.php">Page 19</a>&nbsp;	');	
document.write('  	- <a href="../Pages_html_fra/Photo20.php">Page 20</a><br>');	
document.write('	</span>');
document.write('	<div class="menutitle" onclick="SwitchMenu(\'sub4\')">Divers</div>');
document.write('	<span class="submenu" id="sub4">');
document.write('		- <a href="../Pages_html_fra/SlideShow.php">Slideshow</a><br>');
document.write('		- <a href="../Pages_html_fra/fondus.php">Fondus enchaînés</a><br>');
document.write('		- <a href="../Pages_html_fra/famille.php">La famille</a><br>');
document.write('		- <a href="../Pages_html_fra/Copains2.php">Les copains</a>');		
document.write('	</span>');
document.write('</div>');
}
if (site=="canards")
{
document.write('	<div class="menutitle" onclick="SwitchMenu(\'sub1\')">Info site</div>');
document.write('	<span class="submenu" id="sub1">');
document.write('		- <a href="../Pages_html_fra/Plan_ca.php">Plan du site</a><br>');
document.write('		- <a href="../Pages_html_fra/historique.php">Historique de l\'élevage</a>');
document.write('	</span>');
document.write('	<div class="menutitle" onclick="SwitchMenu(\'sub2\')">Infos carolins</div>');
document.write('	<span class="submenu" id="sub2">');
document.write('		- <a href="../Pages_html_fra/Carolin.php">Généralités</a><br>');
document.write('		- <a href="../Pages_html_fra/Carolin_fam.php">Mme Mr et les petits</a><br>');
document.write('		- <a href="../Pages_html_fra/Carolin_12.php">12 mois d\'un carolin</a><br>');
document.write('		- <a href="../Pages_html_fra/caneton_caro.php">L\'évolution des canetons</a><br>');
document.write('	</span>');
document.write('	<div class="menutitle" onclick="SwitchMenu(\'sub3\')">Infos mandarins</div>');
document.write('	<span class="submenu" id="sub3">');
document.write('		- <a href="../Pages_html_fra/Mandarin.php">Généralités</a><br>');
document.write('		- <a href="../Pages_html_fra/Mandarin_fam.php">Mme Mr et les petits</a><br>');
document.write('		- <a href="../Pages_html_fra/Mandarin_12.php">12 mois d\'un mandarin</a><br>');
document.write('		- <a href="../Pages_html_fra/caneton_mandarin.php">L\'évolution des canetons</a><br>');
document.write('		- <a href="../Pages_html_fra/mignon.php">Un cas particulier</a><br>');
document.write('	</span>');
document.write('	<div class="menutitle" onclick="SwitchMenu(\'sub6\')">Infos sarcelles</div>');
document.write('	<span class="submenu" id="sub6">');
document.write('		- <a href="../Pages_html_fra/Sarcelle.php">Généralités</a><br>');
document.write('		- <a href="../Pages_html_fra/S_Collier.php">Sarcelles à Collier</a><br>');
document.write('		- <a href="../Pages_html_fra/S_Versicolore.php">Sarcelles versicolores</a><br>');
document.write('	</span>');
document.write('	<div class="menutitle" onclick="SwitchMenu(\'sub5\')">Album photo</div>');
document.write('	<span class="submenu" id="sub5">');
document.write('		- <a href="../Pages_html_fra/Photoc1.php">Page 1</a>&nbsp;');
document.write('		- <a href="../Pages_html_fra/Photoc2.php">Page 2</a><br>');
document.write('		- <a href="../Pages_html_fra/Photoc3.php">Page 3</a>&nbsp;');
document.write('		- <a href="../Pages_html_fra/Photoc4.php">Page 4</a><br>');
document.write('		- <a href="../Pages_html_fra/Photoc5.php">Page 5</a>&nbsp;');
document.write('		- <a href="../Pages_html_fra/Photoc6.php">Page 6</a><br>');
document.write('		- <a href="../Pages_html_fra/Photoc7.php">Page 7</a><br>');
document.write('	</span>');
document.write('	<div class="menutitle" onclick="SwitchMenu(\'sub4\')">Divers</div>');
document.write('	<span class="submenu" id="sub4">');
document.write('		- <a href="../Pages_html_fra/photos.php">Slideshow</a><br>');
document.write('	</span>');
document.write('</div>');
}

if (site == "accueil") {

   var ckUtil = new CJL_CookieUtil("cookie_mwid", 100);
   var nom_user = ckUtil.getSubValue("Identifier");
	 if (nom_user=="Vrai")
    {
    document.write('	<div class="menutitle" onclick="SwitchMenu(\'sub1\')">Statistiques</div>');
    document.write('	<span class="submenu" id="sub1">');
    document.write('		- <a href="../Pages_html_fra/lire_log.php">Utilisation</a>');
    document.write('	</span>');
    document.write('	<div class="menutitle" onclick="SwitchMenu(\'sub2\')">Espace photos</div>');
    document.write('	<span class="submenu" id="sub2">');
    document.write('		- <a href="http://www.mwangelique.be/cpg">Galerie photo</a><br>');
    document.write('	</span>');
    document.write('	<div class="menutitle" onclick="SwitchMenu(\'sub3\')">Désinscription</div>');		
    document.write('	<span class="submenu" id="sub3">');
    document.write('		- <a href="../Pages_html_fra/desinscription.php">Se désinscrire</a>');
    document.write('	</span>');
		document.write('	<div class="menutitle" onclick="SwitchMenu(\'sub4\')">Les commentaires</div>');
    document.write('	<span class="submenu" id="sub4">');
    document.write('		- <a href="../Pages_html_fra/Lire_new_comments.php">Derniers commentaires</a><br>');
    document.write('		- <a href="../Pages_html_fra/Lire_comments.php" target=_new>Tous vos commentaires</a>');
    document.write('	</span>');
    document.write('</div>');
    }
}
}

function menu_e(liste)
{
				 if (liste.le_groupe.value>0) 
				 {
//				 	alert ("OK"+liste.le_groupe.value);
				 		window.location="../Pages_html_fra/groupe_chien.php?numero="+liste.le_groupe.value;
//						window.location=fichier;
					}
}

function verif(qui, code)
{
ckUtil = new CJL_CookieUtil("cookie_mw", 300);
tableau = new Array(2);
cookieVal = ckUtil.getSubValue("id_first_name");
if (cookieVal)
	 { tableau[0]=cookieVal}
else
	 { tableau[0]="Invité"}

cookieVal = ckUtil.getSubValue("id_last_name");
if (cookieVal)
	 { tableau[1]=cookieVal}
else
	 { tableau[1]="****"}		

if (tableau[0]==qui && tableau[1]==code)
	 {
// mettre le cookie identifier à vrai
	 ckUtil = new CJL_CookieUtil("cookie_mwid", 300);
	 ckUtil.setSubValue("Identifier", "Vrai");
	 alert ("Bienvenue "+qui);
	 window.location.href="../Pages_html_fra/nouv_head.php";
// rafraîchir la page  
   }
else
	 {
	 alert("Identification erronée");
	 }
}

function passer_fra()
{
  nom=document.URL;
  position=nom.lastIndexOf("_fra");
  if (position==-1)
  {
	nom=nom.replace("ned","fra");
	window.location.href=nom;
  }
  else
  {
  alert ("Vous êtes déjà sur le site francophone")
  }
}

function passer_ned()
{
  nom=document.URL;
  position=nom.lastIndexOf("_ned");
  if (position==-1)
  {
	nom=nom.replace("fra","ned");
	window.location.href=nom;
  }
  else
  {
  alert ("U bent al op de nederlandse site")
  }
}

function montrer(site)
{

photo = new Array(4);
photo[0]="../Photos/n_accueil.gif";
photo[1]="../Photos/site_chien.JPG";
photo[2]="../Photos/n_canards.gif";
photo[3]="../Chiens/titre_encyclo.gif";

lien = new Array(4);
lien[0]="../Pages_html_fra/nouv_head.php";
lien[1]="../Pages_html_fra/nouv_head_ch.php";
lien[2]="../Pages_html_fra/nouv_head_ca.php";
lien[3]="../Pages_html_fra/encyclo_chien.php";

taille = new Array(4);
taille[3]=90;
if (site=="accueil")
	 {
	 taille[0]=80;
	 taille[1]=50;
	 taille[2]=50;
	 }
else
		if (site=="chien")
	 {
	 taille[0]=50;
	 taille[1]=80;
	 taille[2]=50;
	 }
	 else
	 	 {
	 taille[0]=50;
	 taille[1]=50;
	 taille[2]=80;
	 }

// ecriture de la bannière + drapeaux
document.write('<table align="center" width="780" border=0><tr>');
document.write('<td width=180 align="center">');
document.write('<a href="javascript:passer_ned()"><img src="../Photos/nl.gif" alt="nederlands" border="0" width="30" height="30"></a>&nbsp;&nbsp;&nbsp;&nbsp;');
document.write('<a href="javascript:passer_fra()"><img src="../Photos/fr.gif" alt="français" border="0" width="30" height="30"></a></td>');
document.write('<td><p align="center"><img src="../Photos/n_banniere.jpg" width="600" height="70"></td></tr></table>')

// écriture form 
document.write('<table align="center" width="780" border=0><tr>');
document.write('<td align="right" valign="center" width="160">');
document.write('<form action="post" name="identif">');
document.write('Pseudo&nbsp;:&nbsp;<input maxlength="10" size="10" name="id_first_name" /><br>');
document.write('Code&nbsp;:&nbsp;<input name="id_last_name"  type="password" maxlength="10" size="10"  /><br>');
document.write('<button name="but_ok" onclick="verif(identif.id_first_name.value,identif.id_last_name.value)">ok</button><br>');


   var f = document.forms[0];
   var ckUtil = new CJL_CookieUtil("cookie_mw", 300);
   function setFieldFromCookie(fieldId)
   {
	  var cookieVal = ckUtil.getSubValue(fieldId);
	  if( cookieVal )
	  {
	     f[fieldId].value = cookieVal;
	  }
   }
   setFieldFromCookie("id_first_name");
//   setFieldFromCookie("id_last_name");
	 if (document.identif.id_first_name.value == "")
	 { 	 
	 		 document.write('<a href="../Pages_html_fra/inscript.php">S\'inscrire</a>');
	 }
document.write('</form></td>');
// écriture images de sites
document.write('<td align="center" valign="bottom"><a href="'+lien[3]+'"><img src="'+photo[3]+'" border="0" alt="Encyclo_chien" width=70 height=50"</a></td>');
for (i=0;i<3;i++)
{
document.write('<td align="center" valign="bottom"><a href="'+lien[i]+'"><img src="'+photo[i]+'" border="0" alt="Accueil" width="160" height="'+taille[i]+'"</a></td>');
}
document.write('</tr></table>');
document.write('<table align="center" width="780">');
// menu
document.write('<td width="160">&nbsp;</td>');
document.write('<td align="center" bgcolor="#9999ff"  width="640"><font style="font-family: Verdana, Arial, Helvetica, sans-serif;  color:#ffffff" size=1><b>');
document.write('<a href="http://www.arkasdogs.be/forum/"><font style="font-family: Verdana, Arial, Helvetica, sans-serif;  color:#ffffff" size=1>Forum</a> |'); 
document.write('<a href="http://www.arkasdogs.be/wagoldbook/index.php"><font style="font-family: Verdana, Arial, Helvetica, sans-serif;  color:#ffffff" size=1> Livre d\'or</a> |');
document.write('<a href="../Pages_html_fra/lettre.php"><font style="font-family: Verdana, Arial, Helvetica, sans-serif;  color:#ffffff" size=1>Newsletter</a> |'); 
document.write('<a href="../Pages_html_fra/message.php"><font style="font-family: Verdana, Arial, Helvetica, sans-serif;  color:#ffffff" size=1>Message</a> | ');
document.write('<a href="../Pages_html_fra/nouv_head_ch.php"><font style="font-family: Verdana, Arial, Helvetica, sans-serif;  color:#8D1A1A" size=1>Site Chiens</a> | </font>');
document.write('<a href="../Pages_html_fra/nouv_head_ca.php"><font style="font-family: Verdana, Arial, Helvetica, sans-serif;  color:#8D1A1A" size=1>Site Canards</a> | </font>');
document.write('<a href="../Pages_html_fra/Search_engine.php"><font style="font-family: Verdana, Arial, Helvetica, sans-serif;  color:#ffffff" size=1>Recherche</a> | ');
document.write('<a href="../Pages_html_fra/musique.php"><font style="font-family: Verdana, Arial, Helvetica, sans-serif;  color:#ffffff" size=1>Musique</a> | ');
document.write('<a href="../Pages_html_fra/nouveau.php"><font style="font-family: Verdana, Arial, Helvetica, sans-serif;  color:#ffffff" size=1>New</a> | ');
document.write('<a href="../Pages_html_fra/liens.php"><font style="font-family: Verdana, Arial, Helvetica, sans-serif;  color:#ffffff" size=1>Liens</a></font>');
document.write('</td>');
}

/**
 * Copyright (C) 2002-2003, CodeHouse.com. All rights reserved.
 * CodeHouse(TM) is a registered trademark.
 *
 * THIS SOURCE CODE MAY BE USED FREELY PROVIDED THAT
 * IT IS NOT MODIFIED OR DISTRIBUTED, AND IT IS USED
 * ON A PUBLICLY ACCESSIBLE INTERNET WEB SITE.
 * 
 * CodeHouse.com JavaScript Library Module: Cookie Utility Class
 *
 * You can obtain this script at http://www.codehouse.com
 */
function CJL_CookieUtil(name, duration, path, domain, secure)
{
   this.affix = "";
   
   if( duration )
   {   	  
      var date = new Date();
	  var curTime = new Date().getTime();
		if (duration==-1)
		{
		date.setTime(curTime -1);	
		alert(curTime);
		}
		else
		{
	  date.setTime(curTime + (1000 * 60 * duration));
		}	
	  this.affix = "; expires=" + date.toGMTString();
   }
   
   if( path )
   {
      this.affix += "; path=" + path;
   }
   
   if( domain )
   {
      this.affix += "; domain=" + domain;
   }

   if( secure )
   {
      this.affix += "; secure=" + secure;
   }
   
      
   function getValue()
   {
      var m = document.cookie.match(new RegExp("(" + name + "=[^;]*)(;|$)"));

      return m ? m[1] : null;   
   }
   
   this.cookieExists = function()
   {
      return getValue() ? true : false;
   }
      
   this.expire = function()
   {
      var date = new Date();
	  date.setFullYear(date.getYear() - 1);
	  document.cookie=name + "=noop; expires=" + date.toGMTString(); 
   }
        
   this.setSubValue = function(key, value)
   {
      var ck = getValue();

      if( /[;, ]/.test(value) )
      {
         //Mac IE doesn't support encodeURI
		 value = window.encodeURI ? encodeURI(value) : escape(value);
      }

      
      if( value )
      {
         var attrPair = "@" + key + value;

         if( ck )
         {
             if( new RegExp("@" + key).test(ck) )
	         {
		        document.cookie =
				   ck.replace(new RegExp("@" + key + "[^@;]*"), attrPair) + this.affix;
	         }
	         else
	         {
		        document.cookie =
				   ck.replace(new RegExp("(" + name + "=[^;]*)(;|$)"), "$1" + attrPair) + this.affix;
	         }
         }
         else
         {
	        document.cookie = name + "=" + attrPair + this.affix;
         }
      }
      else
      {      
	     if( new RegExp("@" + key).test(ck) )
	     {
	        document.cookie = ck.replace(new RegExp("@" + key + "[^@;]*"), "") + this.affix;
	     }
      }
   }

      
   this.getSubValue = function(key)
   {
      var ck = getValue();

      if( ck )
      {
         var m = ck.match(new RegExp("@" + key + "([^@;]*)"));

	     if( m )
	     {
	        var value = m[1];

	        if( value )
	        { 
	           //Mac IE doesn't support decodeURI
			   return window.decodeURI ? decodeURI(value) : unescape(value);
	        }
	     }
      }
   }
}
