//Script de redimensionnement
var wraphandler = {
  init: function() {
    if (!document.getElementById) return;
    // set up the appropriate wrapper
    wraphandler.setWrapper();
    // and make sure it gets set up again if you resize the window
    wraphandler.addEvent(window,"resize",wraphandler.setWrapper);
  },

setWrapper: function() {
    var theWidth = 0;
    if (window.innerWidth) {
	theWidth = window.innerWidth
    } else if (document.documentElement &&
                document.documentElement.clientWidth) {
	theWidth = document.documentElement.clientWidth
    } else if (document.body) {
	theWidth = document.body.clientWidth
    }
    if (theWidth != 0) {
      if (theWidth <960) {
        document.getElementById('publicite').className = 'cache';
      } else {
        document.getElementById('publicite').className = 'visible';
      }
    }
},
// addEvent stuff from John Resig's ejohn.org/projects/flexible-javascript-events
  addEvent: function( obj, type, fn ) {
    if ( obj.attachEvent ) {
      obj['e'+type+fn] = fn;
      obj[type+fn] = function(){obj['e'+type+fn]( window.event );}
      obj.attachEvent( 'on'+type, obj[type+fn] );
    } else {
      obj.addEventListener( type, fn, false );
    }
  }
}

wraphandler.addEvent(window,"load",wraphandler.init);
//Gestion des popup
function ouvreFenetre(nom,type){
	if(type=='info'){
	var taille='width=450,height=450';
	}
	if(type=='glossaire'){
	var taille='width=450,height=250';
	}
	if(type=='adresse'){
	var taille='width=450,height=250';
	}
	var popup=window.open('http://www.bateauxecoles.com/popup.html?contenu='+nom+'','popup','scrollbars=yes,'+taille+'');
}
function ouvreUrl(url){
	var popup=window.open(url,'url');
}
function ouvreImprim(url){
	var popup=window.open(url,'page','scrollbars=yes,toolbar=yes,menubar=yes,width=700,height=650');
}