
var imagePath = "/"; // pour utilisation sur le serveur
//imagePath = "../"; // pour utilisation local
//imagePath = ""; // pour utilisation local

// loader le CSS fix pour netscape4
if ((self.name == "contenu") || (self.name == "menu")) {
	CSNSFix();
}

// trouver la profondeur d'un fichier
function fileDeep() {
		smallPath = location.pathname.split("/");
		var level = "";
		var i = smallPath.length - 3;
		do {
			var item = smallPath[i];
			level = level + "../";
			i--;
		}
		while ((item != "") && (item != "quartier"));
		return level
}

// remettre le contenu dans son frameset
function verifyContenu(titre, image) {
	if ((self.name != "contenu") && (this.window.name != "PrintVersion")) {
		level = fileDeep();
		var newPage = '<html>\n<head>\n<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">\n<meta name="description" content="Quartier &eacute;ph&eacute;m&egrave;re - Fonderie Darling Foundry - Centre d\'arts visuels / Visual Arts Centre">\n\t<meta name="keywords" content="Art contemporain, art contemporain, Artistes, artistes, Art, Arts, art, arts, montr&eacute;al, montr&eacute;al, ateliers d\'artistes, location de salle, exposition, Art actuel, art actuel, installations, installations, art in situ, r&eacute;sidences d\'artistes, Fonderie Darling, Darling Foundry, Quartier &Eacute;ph&eacute;m&egrave;re, Quartier &eacute;ph&eacute;m&egrave;re, contemporary art, Contemporary art, artists, Artists, montreal, Montreal, artists studios, rooms rental, exhibitions, actual art, installations, in site projects, artists residencies">\n<title>Quartier &eacute;ph&eacute;m&egrave;re &gt; ';
		newPage += titre;
		newPage +='</title>\n</head>\n\n<frameset rows="94,*,94" border="0" framespacing="0" frameborder="no">\n<frame src="' + level + 'haut.html" name="haut" noresize scrolling="no">\n<frameset cols="232,*" border="0" framespacing="0" frameborder="no">\n<frame src="' + level.substr(3) + 'menu.html" name="menu" noresize scrolling="no">\n';
		newPage += '<frame src="' + self.location + '?qe" name="contenu" noresize>\n</frameset>\n<frame src="' + level + 'bas.html" name="bas" noresize scrolling="no">\n</frameset>\n</html>"';
		document.title = 'Quartier éphémère > ' + titre;
		document.write(newPage);
		document.close();
	} else {
		if (this.window.name == "PrintVersion") {
			this.window.print();
		} else {
			image = imagePath + "img/haut/" + image;
			MM_swapImage('section?haut','',image,0);
		}
	}
}

function printWin(){
	window.open(document.URL,'PrintVersion','toolbar=yes,location=no,status=no,menubar=yes,scrollbars=yes,resizable=yes');
}

// remettre le menu dans son frameset
function verifyMenu(image) {
	if (self.name != "menu") {
		self.location = "index.html";
	} else {
		image = imagePath + "img/bas/" + image;
		MM_swapImage('section?bas','',image,0);
	}
}

// remettre le haut et le bas de page dans leur frameset
function verifyOther() {
	if (self == top) {
		self.location = "index.html";
	}
}

var hideDelay;

// maintenir les news
function alauneStay() {
	if (hideDelay) {
		clearTimeout(hideDelay);
	}
}

// afficher les news
function alauneOn() {
	if (hideDelay) {
		clearTimeout(hideDelay);
	}
	if (document.getElementById)
	  {
		news = document.getElementById('alaune');
		news.style.visibility='visible';
	  }
	  else if (document.all)
	  {
		document.all.alaune.style.visibility='visible';
	  }
	  else if (document.layers)
	  {
		document.layers.alaune.visibility='visible';
	  }
}

// partir le delai
function alauneOff() {
	hideDelay = setTimeout('alauneHide()', 5000);
}

// cacher les news
function alauneHide() {
	if (document.getElementById)
	  {
		news = document.getElementById('alaune');
		news.style.visibility='hidden';
	  }
	  else if (document.all)
	  {
		document.all.alaune.style.visibility='hidden';
	  }
	  else if (document.layers)
	  {
		document.layers.alaune.visibility='hidden';
	  }
}


// CSS Fix pour netscape 4
function CSFixFct() {
	var d = document; var w = window;
	if (d.cs.csFix.w != w.innerWidth || d.cs.csFix.h != w.innerHeight) {
		d.location = d.location; }
}
function CSNSFix() { 
	var d = document; var w = window;
	if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
		if (typeof d.cs == 'undefined') { 
			d.cs = new Object;
			d.cs.csFix = new Object; 
		} else if (CSIsFrame (w) == true) CSFixFct();
		d.cs.csFix.w = w.innerWidth;
		d.cs.csFix.h = w.innerHeight; 
		window.onresize = CSFixFct;
	  }
}
function CSIsFrame (window) {
	var rootWindow = window.parent;
	if (rootWindow == 'undefined') return false;
	for (i = 0; i < rootWindow.frames.length; i++) {
		if (window == rootWindow.frames[i]) return true;}
	return false;
}


// Macromedia Stuff

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


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_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_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_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

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;
}