// script La Gazette des Verts

// affichelayer
var openedMenu = "sub01";
function ShowSubMenu(subMenuName) { 
   if(openedMenu!=subMenuName) {
	   style = document.getElementById(subMenuName).style;
	   state = style.display;
	   if(state == "")
		  style.display = "none";
	   else
	   { 
		  if(openedMenu != "")
				document.getElementById(openedMenu).style.display = "none"; 
		  style.display = "";
		  openedMenu = subMenuName; 
	   }
   }
}
// menu-sous menu principal
window.onload=montre;
function montre(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
if (d) {d.style.display='block';}
}

// preload
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

// ouvrirPopup
	var popupWidth="416";
	var popupHeight="500";
function ouvrirPopup(Link) {
	popup=window.open(Link.href,'popup','menubar=no,scrollbars,toolbar=no,location=no,directories=no,status=yes,RESIZABLE=YES,width='+popupWidth+',height='+popupHeight);
	if (popup.window.focus) { popup.window.focus(); }
	return false;
}

function JumpMenuHttp(selObj){
	var theUrl = selObj.options[selObj.selectedIndex].value;
	if (theUrl == "") return;
	window.open(theUrl);
}

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

//print
function print_now() 
{ 
if (window.print)
{
        window.print();
}
else
{
         var OLECMDID_PRINT = 6;
         var OLECMDEXECOPT_DONTPROMPTUSER = 2;
         var OLECMDEXECOPT_PROMPTUSER = 1; 
         var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>'; 
         document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
         WebBrowser1.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER);
         WebBrowser1.outerHTML = "";
} 
}

// rollover
var imageclick="";
var imagefic="";
function flipImage(nomimg,url){ 
if (nomimg != imageclick){
document[nomimg].src= url;
}
}
function flipImageClick(nomimg,url){ 
document[nomimg].src= url;
}
function fixImage(nomimg,url,url1){
if (imageclick !=""){
   //restore previous image clicked
        document[imageclick].src = imagefic
 }
imageclick = nomimg;
imagefic = url1;
flipImageClick(nomimg,url);
}
 
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];}}
}
