// script verney-carron

// 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);

//popup
function popup(page) {
  window.open(page,"annuaire","scrollbars=yes,width=500,height=600,resizable=yes,alwaysraised=yes,toolbar=no,locationbar=no,titlebar=no,menubar=no,statusbar=no");
}

// 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 = "";
} 
}

// affichesousmenugauche
var openedMenu = "";
function ShowSubMenu(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; 
   } 
}

// 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];}}
}
// Cookie
function getCookieVal(offset)
{
var endstr=document.cookie.indexOf (";", offset);
if (endstr==-1) endstr=document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function LireCookie(nom)
{
var arg=nom+"=";
var alen=arg.length;
var clen=document.cookie.length;
var i=0;
while (i<clen)
{
var j=i+alen;
if (document.cookie.substring(i, j)==arg) return getCookieVal(j);
i=document.cookie.indexOf(" ",i)+1;
if (i==0) break;

}
return null;
}
function afficheForm()
{
// Affiche le formulaire de login si pas de cookie et le cache si déjà présent
var bIsLog=(LireCookie("id")!=null);
if (bIsLog)
	{
	document.getElementById("divLogin").style.display = "none";
	document.getElementById("divPasLogin").style.display = "";
	var vLogin=LireCookie("vc2007b");
	document.getElementById("spanIdNomPrenom").innerHTML=vLogin;
	}
else
	{
	var vLogin=LireCookie("vc2007");
	if (vLogin==null)	{	vLogin="Votre E-Mail";	}
	document.getElementById("chpLogin").value=vLogin;
	document.getElementById("divLogin").style.display = "";
	document.getElementById("divPasLogin").style.display = "none";
	}
}


