// JavaScript Document
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);

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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function popup() {
var win; 
var url = "popup_ne.htm";
var nof = "popup";
var opt = "menuBar=0,toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=1,width=380,height=350,left=10,top=10";
win=window.open(url,nof,opt);
}

function calques(c, s, d, dd, ddd, L, R, p){
	MM_showHideLayers('centres','',c,'secteurs','',s,'disciplines','',d, 'domaines', '', dd, 'dispositifs', '', ddd, 'sel', '', L, 'car', '', R);
}

function calque(i){
switch (i)
{
  case 'centres':
    calques('show','hide','hide','hide','hide','hide','hide', 'hide');
   break;
  case 'secteurs':
    calques('hide','show','hide','hide','hide','hide','hide', 'hide');
    break;
  case 'disciplines':
    calques('hide','hide','show','hide','hide','hide','hide', 'hide');
    break;
  case 'domaines':
    calques('hide','hide','hide','show','hide','hide','hide', 'hide');
    break;
  case 'dispositifs':
    calques('hide','hide','hide','hide','show','hide','hide', 'hide');
    break;
  case 'sel':
    calques('hide','hide','hide','hide','hide','show','hide', 'hide');
    break;
  case 'car':
    calques('hide','hide','hide','hide','hide','hide','show', 'hide');
    break;
  case 'partenaires':
    calques('hide','hide','hide','hide','hide','hide','hide', 'show');
    break;
  default:
     calques('hide','hide','hide','hide','hide','hide','hide', 'hide');
   break;
}	
}

// cacher les calques mais pas pour IE
function nocalque(){
	if(navigator.appName != "Microsoft Internet Explorer"){ calque('aucun'); } 
}

// Gestion Fenętres
var newFenetre = null;

//creation d'une fenętre ŕ partir d'une url et d'un chaine de paramčtres 
function  faitFenetre (url, winOpts)
{

	var nomfen="fenetre";
	
	// seule façon de forcer tous les navigateurs ŕ ouvrir une nouvelle fenętre
	//pour les mac fenętre unique = nom unique
	if (navigator.appVersion.indexOf('Macintosh') == -1) nomfen = Math.round(Math.random()*1000);
	
	newFenetre = window.open(url, nomfen , winOpts);
	
	//pour les mac une fenętre unique -> on lui redonne le focus
	if (navigator.appVersion.indexOf('Macintosh') != -1) setTimeout('newFenetre.focus();',250);  
}

function  FE (url)
{
	var winOpts="left=20,top=20,width=800,height=640,resizable=yes,scrollbars=yes,menubar=yes,toolbar=yes,location=yes,status=yes";
	faitFenetre(url , winOpts);
}

function  FEWH (url,w,h)
{
	var winOpts="left=20,top=20,width="+w+",height="+h+",resizable=yes,scrollbars=yes,menubar=yes,toolbar=yes,location=yes,status=yes";
	faitFenetre(url , winOpts);
}

function  FEWH_Min (url,w,h)
{
	 var T=(screen.height-h)/2;
	var  L=(screen.width-w)/2;
	var winOpts="left="+L+",top="+T+",width="+w+",height="+h+",resizable=no,scrollbars=yes,menubar=no,toolbar=no,location=no,status=no";
	faitFenetre(url , winOpts);
}

function  FELTWH (url,l,t,w,h)
{
	var winOpts="left="+l+",top="+t+",width="+w+",height="+h+",resizable=yes,scrollbars=yes,menubar=yes,toolbar=yes,location=yes,status=yes";
	faitFenetre(url , winOpts);
}

function FEU(lien) {
   parametres="toolbar=1,location=0,directories=0,menuBar=1,scrollbars=1,resizable=1,width=800,height=640,left=20,top=20";
   f=window.open(lien,"Newfen",parametres);
   f.focus();
}

function FEP(lien,w,h,x,y) {
   param="toolbar=1,location=0,directories=0,menuBar=1,scrollbars=1,resizable=1,width="+w+",height="+h+",left="+x+",top="+y;
   ff=window.open(lien,"Nouvelle_fenetre",param);
   ff.focus();
}
// Validations W3C

function ixhtml(o){
	o.setAttribute('src','/crdp/neweb/img/validator/valid-xhtml10.gif');
}
function axhtml(o, u){
	o.setAttribute('href','http://validator.w3.org/check?uri='+u);
}
function icss(o){
	o.setAttribute('src','/crdp/neweb/img/validator/valid-css.gif');
}
function acss(o, u){
	o.setAttribute('href','http://jigsaw.w3.org/css-validator/validator?uri='+url);
}
function iwcag(o, A){
	o.setAttribute('src','/crdp/neweb/img/validator/wcag1'+A+'.gif');
}
function awcag(o, u){
	//o.setAttribute('href','http://webxact.watchfire.com/submit.aspx?scanurl='+url);
	o.setAttribute('href','http://www.contentquality.com/mynewtester/cynthia.exe?rptmode=2&url1='+url);
}