// Menu links
var MenuLINK = new Array();
MenuLINK[0]="../index.html";
MenuLINK[1]="11ronde.html";
MenuLINK[2]="21WhatIs.html";
MenuLINK[3]="31bioHLB.html";
MenuLINK[4]="41mission.html";
MenuLINK[5]="51Stages.html";
MenuLINK[6]="BL0006.html";
MenuLINK[7]="mailto:infos@biodanza-med.com";
MenuLINK[8]="AS0003.html";
MenuLINK[9]="91Boutique.html";
MenuLINK[10]="101LocalLinks.html";

// Sub Menu links
var MNL=new Array(10)
for (i=1; i<=10; i++) MNL[i]=new Array()
MNL[2][1]="21WhatIs.html"; MNL[2][2]="22bioRTA.html"; MNL[2][3]="23IBF.html"; MNL[2][4]="25talks.html";
MNL[3][1]="31bioHLB.html"; MNL[3][2]="32eventsHLB.html";
MNL[4][1]="41mission.html"; MNL[4][2]="42teachers.html"; MNL[4][3]="43becoming.html"; MNL[4][4]="44plan.html"; 
MNL[4][5]="45calendar.html"; MNL[4][6]="46excelence.html"; MNL[4][7]="47rules.html";
MNL[6][1]="BL0006.html"; MNL[6][2]="62archives.html";
MNL[8][1]="AS0002.html"; MNL[8][2]="82archives.html";
MNL[10][1]="101LocalLinks.html"; MNL[10][2]="102Links.html";

/**
 * init() routines , run after the onLoad event
 */
function init(pPageID1, pPageID2, pLanguage){
	
	SetMainMenu(pPageID1);
	if(pPageID1==99 || pPageID2==99){
	}else{
	SetSubMenu(pPageID1,pPageID2);
	}
	CurrentLanguage=pLanguage;
	//loadMyMap;
	
}// end of the 'init()' function

/**
 * building of main menu
 */
function SetMainMenu(pID){
	var S =""; var L="";
	
	if(pID==0){L=CurrentLanguage+'/';}
	
	for (i=0; i<=10; i++){
		if(i==pID){
			S=S+'<LI class=\"xnavc\">'+MenuMSG[i]+'</LI>';
		}else{
			if(i==7){
				S=S+'<LI><A href=\"'+MenuLINK[i]+'\">'+MenuMSG[i]+'</A>'+'</LI>';
			}else{
				S=S+'<LI><A href=\"'+L+MenuLINK[i]+'\">'+MenuMSG[i]+'</A>'+'</LI>';
			}
		}
	}
	var M = document.getElementById("navmain");	
	M.innerHTML=S;
	
}// end of the 'SetMainMenu()' function

/**
 * building of sub menu
 */
function SetSubMenu(pID1,pID2){
	var S =""; var Loop = 0;
	
	switch(pID1){
		case 0  : break;
		case 1  : break;
		case 2  : Loop = 4; break;
		case 3  : Loop = 2; break;
		case 4  : Loop = 7; break;
		case 5  : break;
		case 6  : Loop = 2; break;
		case 7  : break;
		case 8  : Loop = 2; break;
		case 9  : break;
		case 10 : Loop = 2; break;
	}

	for (i=1; i<=Loop; i++){
		if(i==pID2){
			S=S+'<LI class=\"xnavc\">'+MN[pID1][i]+'</LI>';
		}else{
			S=S+'<LI><A href=\"'+MNL[pID1][i]+'\">'+MN[pID1][i]+'</A>'+'</LI>';
		}
	}

	var M = document.getElementById("navsub");	
	M.innerHTML=S;
	
}// end of the 'SetSubMenu()' function

/**
 * form validation routines
 */
function FormValidation(pForm){
	if (pForm.FirstName.value == ""){
		window.alert(errorMSG['NoFirstName']);
		pForm.FirstName.focus();
		return (false);
	}
	if (pForm.LastName.value == ""){
		window.alert(errorMSG['NoLastName']);
		pForm.LastName.focus();
		return (false);
	}	
	if (pForm.from.value == ""){
		window.alert(errorMSG['NoEmail']);
		pForm.from.focus();
		return (false);
	}
	if (IsMailOK(pForm.from.value)==false){
		pForm.from.focus();
		return (false);
	}		
}// end of the 'FormValidation()' function


/**
 * email validation
 */
function IsMailOK(pMail) {
	var strFormat=RegExp("^([a-zA-Z0-9_-])+([.]?[a-zA-Z0-9_-]{1,})*@([a-zA-Z0-9-_]{2,}[.])+[a-zA-Z]{2,4}$");
	if(!strFormat.exec(pMail)){
		alert(errorMSG['NoValidMail']);
		return false;
	}else{
		return true;
	}
}// end of the 'IsMailOK()' function


/**
 * Hide function
 */
function hide(pID){
	if (document.getElementById(pID).className == "hidden") { 
	 document.getElementById(pID).className = "visible"; 
	} else { 
	 document.getElementById(pID).className = "hidden"; 		 
	}  	
}// end of the 'hide()' function


/**
 * Display/Hide in stages pages the descriptif/details
 */
function hidestage(pPicturesSwitch){
	hide('STdetail'); hide('MSTdetail'); hide('STinscription');	
	hide('STdescription'); hide('MSTdescription');
	if (pPicturesSwitch==1){hide('PICinfos'); hide('PICdescriptif');}
}// end of the 'hidestage()' function