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_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 openWindow(mypage, myname, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl + ',scrollbars=' + scroll + ',noresizable';
	win = window.open(mypage, myname, winprops);
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
// onclick="openWindow('page.html','name','width','height','yes ou no pour scrollbar'); return false"

// PopUp LEGAL
function popUpLegal(url) {
	fenetre=window.open(url,"int","resizable=no,width=600,height=487,scrollbars=yes");
}


// FOLDOUTMENU script
function SwitchMenu(obj, objtype) {
	if (document.getElementById) {
		var el = document.getElementById(obj);
		var ar = document.getElementById("masterdiv").getElementsByTagName("span");
//		var ar_li = document.getElementById("masterdiv").getElementsByTagName("li");
		if (el.style.display != "block") {
			for (var i=0; i<ar.length; i++) {
				if ( ar[i].className == objtype + "menu" ) {
					ar[i].style.display = "none";
//					ar_li[i].style.listStyleImage="url(../img/img_up.gif)";
				}
			}
			el.style.display = "block";
//			event.srcElement.style.listStyleImage="url(../img/img_down.gif)";
			
		} else {
			el.style.display = "none";
//			event.srcElement.style.listStyleImage="url(../img/img_up.gif)";
		}
	}
}

// Fonction pour les rollover menuGarnier
function rollGarnier(quel_b,bouton) {
	if (document.images) {
		document.images[quel_b].src=eval(bouton+".src");
	}
}

// nommé les images 
if (document.images) {
	arrow_o = new Image(4,6);arrow_o.src = "http://garnier.ca/img/menu_garnier/arrow_o.gif";
	arrow_n = new Image(4,6);arrow_n.src = "http://garnier.ca/img/menu_garnier/arrow.gif";
	arrowGarnier_o = new Image(4,6);arrowGarnier_o.src = "http://garnier.ca/img/menu_garnier/arrowGarnier_o.gif";
	arrowGarnier_n = new Image(4,6);arrowGarnier_n.src = "http://garnier.ca/img/menu_garnier/arrowGarnier.gif";
}

// Fonction pour les rollover
function roll(quel_b,bouton) {
	if (document.images) {
		document.images[quel_b].src = "../img/"+bouton+".gif";
	}
}
// nommé les images 
/*if (document.images) {
	arrow_o = new Image(4,6);arrow_o.src = "../img/arrow_o.gif";
	arrow_n = new Image(4,6);arrow_n.src = "../img/arrow.gif";
	arrow_o = new Image(4,6);arrow_o.src = "../img/arrow_o.gif";
	arrow_n = new Image(4,6);arrow_n.src = "../img/arrow.gif";
}*/


//return if user is on WIN IE, or not
function isMSIE() {
	//detection de browser
	var browserType = navigator.appName
	var browserOS = navigator.platform
	
	//IE 5+ pour Windows
	if( ( browserType.indexOf("Microsoft") != -1 ) && ( browserOS.indexOf("Win32") != -1 ) ) {
		browserType = "IE"
		browserOS = "Windows"
		return true;
	} else {
		return false;
	}
}
// show/hide div
function verifScreen() {
	if(screen.width > 800){
		
		if (!document.getElementById) return;
		s = document.getElementById('garnier');
		
		s.style.display = 'block';
	}
}

