// OUVERTURE SATORI EN SPECTACLE 
function satori (url,nom,nom_page1) {
	  var w=(window.screen.width)-15;
	  var h=(window.screen.height)-15;
	  var Configuration="'toolbar=no, menubar=no, location=no, directories=no, status=no, resizeable=yes, scrollbars=yes, width="+w+", height="+h+", left=" + 0 + ", top=" + 0;
	  window.open(url);
  	  
}

function homepage(){
	style.behavior='url(#default#homepage)';
	setHomePage('http://www.odcreunion.com/');
}
function flashWindow(width,height) {
	x = (640 - width)/2; 
	y = (480 - height)/2;	
	if (screen) {
		y = (screen.availHeight - height)/2;
		x = (screen.availWidth - width)/2;
	}
	if (screen.availWidth > 1800) { 
		x = ((screen.availWidth/2) - width)/2; 
	} 
	window.open('programmation/plan_salle.htm','newWin','width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
}

// FONCTION OUVERTURE DU SITE EN PAGE D'ACCUEIL
function accueil (url,nom,nom_page1) {
	  var w=window.screen.width;
	  var h=window.screen.height;
	  var Configuration="'toolbar=no, menubar=no, location=no, directories=no, status=no, resizeable=yes, scrollbars=yes, width="+w+", height="+h+", left=" + 0 + ", top=" + 0;
	  window.open(url,nom,Configuration);
  	  window.open(nom_page1,'contenu');
}

// PARAMETRAGE DU SCRIPT
var tjs_delai=20;
var tjs_max=20;
var tjs_mode=1; // 0 - calque toujours en haut de page / 1 - calque en bas

// LE RESTE NE CHANGE PAS
var tjs_hauteur=0;

function PrintCalque(height) {
	tjs_hauteur=height;
	/*if ((document.all)||(document.getElementById)) {
		var Z="<DIV id='tomber' style='position:absolute;left:"+left+";top:"+top+";width:"+width+";height:"+height+"'>"+contenu+"</DIV>";
	} else {
		var Z="<LAYER name='tomber' left="+left+" top="+top+" width="+width+" height="+height+">"+contenu+"</LAYER>";
	}
	document.write(Z);*/
	setTimeout("Start()",tjs_delai);
}
function Start() {
	MoveLayer("tomber",GetTop("tomber"));
	setTimeout("Start()",tjs_delai);
}
function Debug() {
	var obj=document.body
	var Z="";
	for (var i in obj) {
		Z+=i+"="+obj[i]+"\n";
	}
	alert(Z);
}
function MoveLayer(nom,top) {
	if (document.getElementById) { //IE5 et NS6
		document.getElementById(nom).style.top=top;
	}
	if ((document.all)&&(!document.getElementById)) { //IE4 seul
		document.all[nom].style.top=top;
	}
	if (document.layers) { //NS4.X seul
		document.layers[nom].top=top;
	}
}
function GetTop(nom) {
	// Partie 1 : Récupération de la position du calque et de la page
	if (document.getElementById) { //IE5 
		var pos=parseInt(document.getElementById(nom).style.top);
		var wintop=parseInt(document.body.scrollTop);
		var avail=document.body.clientHeight;
	}
	if ((document.getElementById)&&(!document.all)) { //NS6
		var pos=parseInt(document.getElementById(nom).style.top);
		var wintop=parseInt(window.pageYOffset);
		var avail=window.innerHeight;
	}
	if ((document.all)&&(!document.getElementById)) { //IE4 seul
		var pos=parseInt(document.all[nom].style.top);
		var wintop=parseInt(document.body.scrollTop);
		var avail=document.body.clientHeight;
	}
	if (document.layers) { //NS4.X seul
		var pos=parseInt(document.layers[nom].top);
		var wintop=parseInt(window.pageYOffset);
		var avail=window.innerHeight;
	}

	// Partie 2 : Traitement de la position 
	if (tjs_mode==0) { // toujours en haut
		var delta=Math.ceil((pos-wintop)/3);
		if (delta>tjs_max) {delta=tjs_max;}
		if (delta<-1*tjs_max) {delta=-1*tjs_max;}
		var top=pos-delta;
	}
	if (tjs_mode==1) {// toujours en bas
		var delta=Math.ceil((pos-(wintop+avail-tjs_hauteur)));
		if (delta>tjs_max) {delta=tjs_max;}
		if (delta<-1*tjs_max) {delta=-1*tjs_max;}
		var top=pos-delta;
	}
	// AJOUT S. WEBER
	if (top < 70)
		top = 70;
	// FIN AJOUT S. WEBER
	return top;
}


function charger(nom_page1,nom_page2) {
	parent.frames["contenu_jazz"].window.location=nom_page1;
	parent.frames["menu_jazz"].window.location=nom_page2;
}
	
	function haut_gauche(url, nom ,w,h){  
	  var Configuration="'toolbar=no, menubar=no, location=no, directories=no, status=no, resizeable=no, scrollbars=no, width="+w+", height="+h+", left=" + 0 + ", top=" + 0;
	  window.open(url,nom,Configuration);
//	  onClick="plein('histoire/vue_aerienne.htm','photo')"
}
function Submitform()
			{
			if  (document.sub.mail.value=='') alert("Adresse email non valide");
			else 
				{
				if ( ((document.sub.mail.value.indexOf('@',1))==-1)||(document.sub.mail.value.indexOf('.',1))==-1 )
				      alert("Adresse Email non valide");
      				 
				else 	document.sub.submit();
			 	}
			
			 }
			 
function favoris(){
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
if (browserName == "Microsoft Internet Explorer" & browserVer >= 4) {
window.external.AddFavorite('http://www.odcreunion.com/', 'ODC :: office départemental de la culture :: saint denis, île de la réunion ::');
}
}

function change_site() {
var site = document.menu.popup.selectedIndex;
{
window.location.href =
document.menu.popup.options[site].value;
}
}
Scroleto = 0;
function ScrollH() {
	while(Scroleto!=700){
		this.scroll(1,Scroleto)
		Scroleto++;
	}
}
function ScrollB() {
	while(Scroleto!=700){
		this.scroll(-1,Scroleto)
		Scroleto++;
	}
}

function plein(url, nom){  
	  var w=(window.screen.width)-10;
	  var h=(window.screen.height)-10;
	  var Configuration="'toolbar=no, menubar=no, location=no, directories=no, status=no, resizeable=yes, scrollbars=yes, width="+w+", height="+h+", left=" + 0 + ", top=" + 0;
	  window.open(url,nom,Configuration);
//	  onClick="plein('histoire/vue_aerienne.htm','photo')"
}

function fenetre1(w,h,url, nom){  
	  var Left=(window.screen.width-800)/2;
	  var Top=(window.screen.height-600)/2;
	  var Configuration="'toolbar=no, menubar=no, location=no, directories=no, status=no, resizeable=no, scrollbars=yes, width="+w+", height="+h+", left=" + Left + ", top=" + Top;
	  window.open(url,nom,Configuration);
//	  onClick="centrer('800','600','4_outils/plan.htm','plan')"
}

function gauche (w,h,url, nom){  
	  var Left=0;
	  var Top=0;
	  var Configuration="'toolbar=no, menubar=no, location=no, directories=no, status=no, resizeable=no, scrollbars=no, width="+w+", height="+h+", left=" + Left + ", top=" + Top;
	  window.open(url,nom,Configuration);
}
function centrer (w,h,url, nom){  
	  var Left=window.screen.width/2-(w/2);
	  var Top=window.screen.height/2-(h/2);
	  var Configuration="'toolbar=no, menubar=no, location=no, directories=no, status=no, resizeable=yes, scrollbars=yes, width="+w+", height="+h+", left=" + Left + ", top=" + Top;
	  window.open(url,nom,Configuration);
//	  onClick="centrer('800','600','histoire/vue_aerienne.htm','photo')"
}

function centrerScroll (w,h,url, nom){  
	  var Left=window.screen.width/2-(w/2);
	  var Top=window.screen.height/2-(h/2);
	  var Configuration="'toolbar=no, menubar=no, location=no, directories=no, status=no, resizeable=no, scrollbars=yes, width="+w+", height="+h+", left=" + Left + ", top=" + Top;
	  window.open(url,nom,Configuration);
//	  onClick="centrerScroll('800','600','histoire/vue_aerienne.htm','photo')"
}

function scrollH(debut, fin, vitesse){ 
		for (H=debut; H>=fin; H=vitesse){
			window.scroll(H,0)
		}
}
function scrollV(debut, fin, vitesse){ 
		for (V=debut; V>=fin; V=vitesse){
			window.scroll(V,0)
		}
}



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 pleinEcran(){
     window.resizeTo(screen.width,screen.height);    //on agrandit la fenetre à la taille de l'écran
     haut=screen.height-parent.document.body.clientHeight;  //calcul de la hauteur des barres d'outils
     window.moveTo (-5,-haut+27) ;  //on place la fenetre pour ne plus voir les barres de l'explorer
     window.resizeTo(screen.width+10,screen.height+haut);  //on agrandit la fenetre de façon à ne voir que la page
     
     //Ce test sert dans le cas ou la fenetre ie etait en mode agrandie
     if ((document.body.clientHeight > 768 && screen.height == 768) || (document.body.clientHeight > 600 && screen.height == 600) ){
	  var eccart = parent.document.body.clientHeight - screen.height;
	  window.moveTo (-5,-haut+27+eccart);
          window.resizeTo(screen.width+10,screen.height+haut-eccart);
     }
}


function voir(ID_MENU1) { 
  if (navigator.appName=='Microsoft Internet Explorer')  {
       document.all.ID_MENU1.style.visibility='visible'
  } else {
       document.getElementById('ID_MENU1').style.visibility='visible'
  }
;}

function masquer(ID_MENU1) {
  if (navigator.appName=='Microsoft Internet Explorer') {
       document.all.ID_MENU1.style.visibility='hidden'
  } else {
       document.getElementById('ID_MENU1').style.visibility='hidden'
  }
;} 
