
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->


var activeSub=0;
var SubNum=0;

function reDo(){ window.location.reload() }
    window.onresize = reDo;


    //Define global variables

	    var timerID = null;
		var timerOn = false;
		var timecount = 1000;
		var what = null;
		var newbrowser = true;
		var check = false;

    	function init(){
    	//  alert ("Running Init");
          if (document.layers) {
                      //  alert ("Running Netscape 4");
                        layerRef="document.layers";
                        styleSwitch="";
                        visibleVar="show";
			screenSize = window.innerWidth;
			what ="ns4";


          }else if(document.all){
                      //  alert ("Running IE");
                        layerRef="document.all";
                        styleSwitch=".style";
                        visibleVar="visible";
			screenSize = document.body.clientWidth + 18;
			what ="ie";

		  }else if(document.getElementById){
                      //  alert ("Running Netscape 6");
                        layerRef="document.getElementByID";
                        styleSwitch=".style";
                        visibleVar="visible";
			what="moz";
		  
		  }else{
		  	//alert("Older than 4.0 browser.");
			what="none";
			newbrowser = false;
		  }
		  
 
		window.status='http://www.alpha-omega.ca';
		check = true;
  	 	}

	// Turns the layers on and off
        function showLayer(layerName){
        	if(check){
        		if (what =="none"){
        			return;
        			}
	        	else if (what == "moz"){
        			document.getElementById(layerName).style.visibility="visible";
        			}
        		else{
                  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
                  }
		 }
        	else {// alert ("Please wait for the page to finish loading.");
        		return;}
		}

        function hideLayer(layerName){
        	if(check){
        		if (what =="none"){
        			return;
        			}
        		else if (what == "moz"){
        			document.getElementById(layerName).style.visibility="hidden";
        			}
        		else{
                  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
				}
        
        	}
        	else {// alert ("Please wait for the page to finish loading.");
        		return;}
        }


		function hideAll(){
				hideLayer('layer1');
				}


		function startTime() {
	        if (timerOn == false) {
                timerID=setTimeout( "hideAll()" , timecount);
                timerOn = true;

	        }

		}


		function stopTime() {
	        if (timerOn) {
    	        clearTimeout(timerID);
                timerID = null;
                timerOn = false;
	        }
		}

		function onLoad(){
			init();
			
			}

//----------------------------------------------------------------
//  Usernames, Passwords & User Pages - These require configuration.
//----------------------------------------------------------------
var successpage = "formulaires_success.php"; // The page users go to after login, if they have no personal page.
var loginpage = "formulaires.php"; //Change this to the page the login panel is on.

var imgSubmit = ""; //Change to the path to your login image,if you don't want the standard button, otherwise do not change.
var imgReset = "";  //Change to the path to your reset image,if you don't want the standard button, otherwise do not change.

var users = new Array();

users[0] = new Array("vivei","wegas666","");
users[1] = new Array("admin-form","5671","");
users[2] = new Array("phenix01","eR8M12u","");
users[3] = new Array("phenix02","Np5t4R0","");
users[4] = new Array("phenix03","OzptIXa","");
users[5] = new Array("phenix04","MJKIzfq","");
users[6] = new Array("phenix05","bnRKVzK","");
users[7] = new Array("phenix06","Y96zpfX","");
users[8] = new Array("phenix07","StWk4Nx","");
users[9] = new Array("phenix08","yrL0z3k","");
users[10] = new Array("phenix09","6Ohsw8v","");
users[11] = new Array("phenix10","AXB4YUd","");
users[12] = new Array("phenix11","JaiE12j","");
users[13] = new Array("phenix12","qSEkn2Z","");
users[14] = new Array("phenix13","zRwpHWM","");
users[15] = new Array("phenix14","DRrZVkC","");
users[16] = new Array("phenix15","FtXXAQ2","");
users[17] = new Array("phenix16","YQAM8IH","");
users[18] = new Array("phenix17","AdJyPAU","");
users[19] = new Array("phenix18","u8Lx5wA","");
users[20] = new Array("phenix19","N8EfJjx","");
users[21] = new Array("phenix20","XXumTIO","");
users[22] = new Array("phenix21","PkXX8uW","");
users[23] = new Array("phenix22","2H1Xdcc","");
users[24] = new Array("phenix23","dseRXUG","");
users[25] = new Array("phenix24","Q2K1Lfs","");
users[26] = new Array("phenix25","ZEaQVaV","");
users[27] = new Array("phenix26","5UgKw8m","");
users[28] = new Array("phenix27","jRVTC30","");
users[29] = new Array("phenix28","oGcaAVY","");
users[30] = new Array("phenix29","w8Qo25K","");
users[31] = new Array("phenix30","1WyfPoS","");
users[32] = new Array("phenix31","wegas666","");
users[33] = new Array("phenix32","imgjmoh","");
users[34] = new Array("phenix33","wegas666","");
users[35] = new Array("phenix34","MQieZZ0","");
users[36] = new Array("phenix35","qMiTxkH","");
users[37] = new Array("phenix36","bO6QSwk","");
users[38] = new Array("phenix37","oiT3q7A","");
users[39] = new Array("phenix38","NKlFx7t","");
users[40] = new Array("phenix39","30lxGks","");
users[41] = new Array("phenix40","cZJTg8K","");
														   // Change these two entries to valid logins.
												           // Add addtional logins, straight after these, as
                                                           // required, followig the same format. Increment the 
											               // numbers in the square brackets, in new each one. Note:
											               // the 3rd parameter is the the page that user goes to
											               // after successful login. Ensure the paths are correct.
                                                           // Make this "" if user has no personal page.
//----------------------------------------------------------------
//  Login Functions
//----------------------------------------------------------------
function login(username,password){
 var member = null;
 var loggedin = 0;
 var members = users.length;
 for(x=0;x<members && !loggedin; x++){
 if((username==users[x][0])&&(password==users[x][1])){
    loggedin = 1;
    member = x;
	break; // User validated, terminate the for loop.
   }
 } 
 
 if(loggedin==1){
  if(users[member][2] != "") {
   successpage = users[member][2];
  }
  setCookie("login",1);
  if (top.location.href != location.href){
   location.href = successpage;           
  }else{
   top.location.href = successpage;  
  }
 }else{
  alert('Accès refusé');
 }  
}

function logout() {
 deleteCookie("login");
 if (top.location.href != location.href){
  location.href = loginpage;           
 }else{
  top.location.href = loginpage;  
 }
}

//----------------------------------------------------------------
// Cookie Handler
//----------------------------------------------------------------
var ckTemp = document.cookie;

function setCookie(name, value) { 
 if (value != null && value != "")
  document.cookie=name + "=" + escape(value) + ";";
 ckTemp = document.cookie;
 }
 
function deleteCookie(name) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

function getCookie(name) { 
 var index = ckTemp.indexOf(name + "=");
 if(index == -1) return null;
  index = ckTemp.indexOf("=", index) + 1;
 var endstr = ckTemp.indexOf(";", index);
 if (endstr == -1) endstr = ckTemp.length;
 return unescape(ckTemp.substring(index, endstr));
 }
  
function checkCookie() {
 var temp = getCookie("login");
 if(!temp==1) {
  alert('Accès refusé'); 
  if(top.location.href != location.href){
   location.href = loginpage;           
  }else{
   top.location.href = loginpage;  
  }
 }
}

//----------------------------------------------------------------
// Login Panel
//----------------------------------------------------------------

function BuildPanel() {
document.write('<form name="logon"><table align="left" border="0"><tr><td align="right">');
document.write('<small><font face="Georgia">Utilisateur:</font></small></td>');
document.write('<td><small><font face="Georgia"><input type="text" name="username" size="20"></font></small></td></tr>');
document.write('<tr><td align="right"><small><font face="Georgia">Mot de passe:</font></small></td>');
document.write('<td><small><font face="Georgia"><input type="password" name="password" size="20"></font></small></td></tr>');
if(imgReset == ""){
 document.write('<tr><td align="right" colspan="2"><p><input type="reset" value="Effacer" name="Reset">');
} else {
 document.write('<tr><td align="right" colspan="2"><p><input type="image" src="'+imgReset+'" name="Reset" onclick="logon.reset();">');
}
if(imgSubmit == ""){
 document.write('<input type="button" value="Entrer" name="Logon" onclick="login(username.value,password.value)">'); 
} else {
 document.write('<input type="image" src="'+imgSubmit+'" name="Logon" onclick="login(username.value,password.value)">');
}
document.write('</p></td></tr></table></form>');
}