/* FUNCTION POUR AFFICHERBALADES */
function ZoneTexteOver(sActionAff, sZoneAff, sZoneCssImg) {
	if(sActionAff == "afficher"){
		var iIndImg = '';
//alert('sActionAff : ' + sActionAff + '; sZoneAff : ' + sZoneAff);
		document.getElementById("ZoneTexteOver").style.display = "block";
		switch (sZoneAff) {
		case "balade01":
			sTexteOver = 'Du Mont Rigaud à la rivière des Outaouais';
			iIndImg = 0;
			break;
		case "balade02":
			sTexteOver = 'Le tour de l\'Île-Perrot';
			iIndImg = 1;
			break;
		case "balade03":
			sTexteOver = 'Chemin des trésors';
			iIndImg = 2;
			break;
		case "balade04":
			sTexteOver = 'Destination Salaberry-de-Valleyfield';
			iIndImg = 3;
			break;
		case "balade05":
			sTexteOver = 'Promenade le long du Canal Soulanges';
			iIndImg = 4;
			break;
		case "balade06":
			sTexteOver = 'Les parcs nature de Beauharnois-Salaberry';
			iIndImg = 5;
			break;
		case "balade07":
			sTexteOver = 'Sur la rive du lac Saint-Louis';
			iIndImg = 6;
			break;
		case "balade08":
			sTexteOver = 'Au fil de la Châteauguay';
			iIndImg = 7;
			break;
		case "balade09":
			sTexteOver = 'Sur les flancs de la Covey Hill';
			iIndImg = 8;
			break;
		case "balade10":
			sTexteOver = 'Sur la rive du lac Saint-François';
			iIndImg = 9;
			break;
		}
		document.getElementById("ZoneTexteOver").innerHTML = sTexteOver;
		if (sZoneCssImg != '') {
			document.getElementById("ZoneImgages").style.display = "inline";
			document.getElementById("ZoneImgages").innerHTML = '<img src="' + b[iIndImg].src + '">';
		}
	} else if(sActionAff == "cacher"){
		sTexteOver = 'Parmi ces 10 Balades, choisissez la vôtre !';
		document.getElementById("ZoneTexteOver").innerHTML = sTexteOver;
		document.getElementById("ZoneTexteOver").style.display = "block";
		if (sZoneCssImg != '') {
			document.getElementById("ZoneImgages").style.display = "none";
		}
	}
}

/* Permet de centraliser l'ouverture des fiches dans le guide en ligne - nous avons normalisé les fiches au niveau des pictogrammes */ 
function GuideEnLigne(iIDSousCategorie, iIDMembre) {
	if ((iIDSousCategorie > 0) && (iIDMembre > 0)) {
//		alert('iIDSousCategorie : ' + iIDSousCategorie + '\niIDMembre : ' + iIDMembre);
		var sUrlReferenceGuideEnLigne = 'http://www.tourisme-suroit.qc.ca/guide_en_ligne/viewfichemembre.asp?idcm=' + iIDSousCategorie + '&id=' + iIDMembre;
		GB_showCenter(document.location.hostname, sUrlReferenceGuideEnLigne, 500, 800)
	}
}

//Ouverture des fiches des membres à partir du site www.tourisme-suroit.qc.ca
function openFiche(sUrl) {
	if (document.location.href.indexOf('balades.ca') != -1) {
		sUrl += '&targetblank=true';
	}
	var intHauteurEcran = screen.height - 75;
	winpopup =	window.open(sUrl,"Fiche", "scrollbars=yes,toolbar=no,menubar=no,location=bo,directories=no,status=no,resizable=yes',width=525,height=" + intHauteurEcran + ", left=0,top=0");
	winpopup.focus();
}
function openFicheGrandeur(sUrl, iWidth, iHeight) {
		winpopup =	window.open(sUrl,"Fiche", "scrollbars=yes,toolbar=no,menubar=no,location=bo,directories=no,status=no,resizable=yes',width=" + iWidth + ",height=" + iHeight + ", left=0,top=0");
		winpopup.focus();
}

// Source: http://lists.evolt.org/archive/Week-of-Mon-20000207/096093.html
// Ferme la fenêtre enfant lorsque nous focussons sur la fenêtre parent sinon la fenêtre reste ouverte
var popupWin = null;
function openWin(url,w,h){
 if (w == 0) {
	w = screen.width - 200;
 }
//alert(screen.width + ':' + w);
 var itop=Math.floor((screen.height-h)/2);
 var ileft=Math.floor((screen.width-w)/2);
 popupWin = window.open(url,"PopupHelp","width="+w+",height="+h+",top="+itop+",left="+ileft+",toolbar=0,resizable=1,menubar=1,scrollbars=1");
  window.name = 'opener';
 }
function scram() {
  if (popupWin != null && popupWin.open) popupWin.close();
 }
window.onfocus=scram;