var popUp, carte, carte2, puBonus, top, left;

var bookmarkurl="http://www.wildernesspass.com";
var bookmarktitle="WildernessPass - Carnets de voyage";
var sujet="Commentaires WildernessPass";
var a6=".fr", a5="doo", a4="wana", a3="lli@", a2="arte", a1="ocas";
var police = 13;

function addbookmark(){
	if (document.all) window.external.AddFavorite(bookmarkurl,bookmarktitle) 
}

function initBody1() {
	if (parent.frames.length==0) {
		document.getElementById("corps").style.top = "85";
		document.getElementById("barre2").style.top = "65";
		document.getElementById("barre1").style.visibility = "visible"};
}

function initBody2(loc) {
	document.carnets.selCar.selectedIndex = 0;
	document.bonus.selBon.selectedIndex = 0;	
	if (loc == "Plan") {document.getElementById("PL_Site").src = "../Web_Islande/Html_IS/IS_Intro.html"};
	if (loc == "IS") {document.getElementById("IS_Site").src = "IS_Intro.html"};
	if (loc == "PA") {document.getElementById("PA_Site").src = "PA_Intro.html"};
	if (loc == "NZ") {document.getElementById("NZ_Site").src = "NZ_Intro.html"};
	if (loc == "TAS") {document.getElementById("TAS_Site").src = "TAS_Intro.html"};
	if (loc == "NE") {document.getElementById("NE_Site").src = "NE_Intro.html"};

}

function msg() {
	window.location.href='mailto:'+a1+a2+a3+a4+a5+a6+'?Subject='+sujet;
	return false;
}

function chgCarnet(loc) {
	for(i=0;i<document.carnets.selCar.length;i=i+1){ 
        	if(document.carnets.selCar[i].selected == true){
			car = document.carnets.selCar[i].text;
			goCarnet(loc,car)
		} 
        } 
}

function goCarnet(loc,car) {
	path = "../../";
	if (loc == "Index") {path = ""};
	if (loc == "Plan") {path = "../"};
	if (car == "Islande") {urlDest = path + "Web_Islande/Html_IS/Islande.html"};
	if (car == "Patagonie") {urlDest = path + "Web_Patagonie/Html_PA/Patagonie.html"};
	if (car == "Nouvelle Zélande") {urlDest = path + "Web_NouvelleZelande/Html_NZ/Nouvelle_Zelande.html"};
	if (car == "Tasmanie") {urlDest = path + "Web_Tasmanie/Html_TAS/Tasmanie.html"};
	if (car == "Népal - Annapurnas") {urlDest = path + "Web_Nepal/Html_NE/Nepal_Annapurnas.html"};
	var cadre = self.parent;
	cadre.location.href=urlDest;
}

function chgBonus(loc) {
	if (document.bonus.selBon.selectedIndex > 0) {
		path = "../../";
		if (loc == "Index") {path = ""};
		if (loc == "Plan") {path = "../"};
		if (document.bonus.selBon.selectedIndex == 1) {nom = "FondsEcran"; urlBonus = path + "Wp_Accueil/Wp_FondsEcran.html"};
		if (document.bonus.selBon.selectedIndex == 2) {nom = "EcransVeille"; urlBonus = path + "Wp_Accueil/Wp_EcransDeVeille.html"};
		if (document.bonus.selBon.selectedIndex == 3) {nom = "MakingOf"; urlBonus = path + "Wp_Accueil/Wp_MakingOf.html"};
		document.bonus.selBon.selectedIndex = 0;
		top=(screen.height-500)/2;
		left=(screen.width-600)/2;
		puBonus=window.open(urlBonus,nom,'toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,top='+top+',left='+left+',width=600,height=500');
		puBonus.focus();
		return false;
	};
}

function policePlus() {
	if (police < 20) {
		police = police + 1;
		document.getElementById("corps").style.fontSize = String(police) + "px";
	}	
	return false;
}

function policeMoins() {
	if (police > 10) {
		police = police - 1;
		document.getElementById("corps").style.fontSize = String(police) + "px";
		}	
	return false;
}

function ouvrirPopUp(photo, w, h) {
	text = '<html>';
	text += '<body onBlur="self.close()" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0">';
	text += '<img src=' + photo + '>';
	text += '</body>';
	text += '</html>';
	top=(screen.height-h)/2;
	left=(screen.width-w)/2;
	popUp=window.open('','Photo','toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,top='+top+',left='+left+',width='+w+',height='+h);
	popUp.document.write(text);
	popUp.focus();
	popUp.document.close();
	return false;
}

function ouvrirPopUpSb(photo, w, h) {
	text = '<html>';
	text += '<body onBlur="self.close()" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0">';
	text += '<img src=' + photo + '>';
	text += '</body>';
	text += '</html>';
	top=(screen.height-h)/2;
	left=(screen.width-w)/2;
	popUp=window.open('','Photo','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,top='+top+',left='+left+',width='+w+',height='+h);
	popUp.document.write(text);
	popUp.focus();
	popUp.document.close();
	return false;
}

function ouvrirCarte(nom, page, w, h) {
	carte=window.open(page,nom,'toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width='+w+',height='+h);
	carte.moveTo(0,0);
	carte.focus();
	return false;
}

function ouvrirCarte2(nom, page, w, h) {
	carte2=window.open(page,nom,'toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+w+',height='+h);
	carte2.moveTo(0,0);
	carte2.focus();
	return false;
}

function ouvrirCpy(page) {
	top=(screen.height-310)/2;
	left=(screen.width-400)/2;
	popUp=window.open(page,'Copyright','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,top='+top+',left='+left+',width=400,height=310');
	popUp.focus();
	return false;
}
