
var theSound;
var theImage;
var soundPlays = "";
var bild_Array = new Array();
var url_Array = new Array();

/*---switch on and off certain elements via CSS ---*/

function showhideElement(Element, state){ 
      var theElement = document.getElementById(Element); 
      theElement.style.visibility = state; 
 } 

/*---Browser check ---*/


	Browser = navigator.appName;
	
	// read the cookie to get the Username 
	// var the_info = new Array();
	// readTheCookie(the_info);
	
	function TellWindowParameters(){
	  alert("'"+Browser+"'"+
		"\nscreen.Height: "+screen.height+
		"\nscreen.Width: "+screen.width+
		"\nwindow.screenTop: "+window.screenTop+
		"\nwindow.screenLeft: "+window.screenLeft+
		"\nscreen.availHeight: "+screen.availHeight+
		"\nscreen.availWidth: "+screen.availWidth+
		"\nwindow.innerHeight: "+window.innerHeight+
		"\nwindow.innerWidth: "+window.innerWidth);
	}


/*---Image switch in Preview Frame PAGE CINEMA---*/

	function replaceimg(theelement,theimage){
	document.getElementById(theelement).src = "../photos/acteur/"+theimage;
	}	


/*---Movie switch in Preview Frame PAGE VIDEOS---*/
url_Array[0] = "http://www.youtube.com/v/Vhs9ykZ0CCY?fs=1&amp;hl=en_US";  //Country Heroes - Toujours Debout
url_Array[1] = "http://www.youtube.com/v/h-WTa0OVU8I?fs=1&hl=en_US";  //Surcharge - Toujours Debout 
url_Array[2] = "http://www.youtube.com/v/vbyKY7RWG9A&amp;hl=en_US&amp;fs=1&amp;";  //Papayes - Toujours Debout
url_Array[3] = "http://www.youtube.com/v/P-JRcC2SpLU&amp;hl=en_US&amp;fs=1&amp;";  //Chanteur Country  - Toujours Debout
url_Array[4] = "http://www.youtube.com/v/IvUruLJNavA&amp;hl=en_US&amp;fs=1&amp;";  //Blues - Toujours Debout 
url_Array[5] = "http://www.youtube.com/v/7ps5NWEDwGc&amp;hl=en_US&amp;fs=1&amp;";  //Paradis - Toujours Debout 
url_Array[6] = "http://www.youtube.com/v/WYUuPYK76Is&amp;hl=en_US&amp;fs=1&amp;";  //Borneo  - Toujours Debout
url_Array[7] = "http://www.youtube.com/v/EYr77ZmJ8JE&amp;hl=en_US&amp;fs=1";  //Banc - Mots pour Maux
url_Array[8] = "http://www.youtube.com/v/bOwLtop4HxE&amp;hl=en_US&amp;fs=1&amp;";  //Chaises - Mots pour Maux
url_Array[9] = "http://www.youtube.com/v/UPpZV1DcPxw&amp;hl=en_US&amp;fs=1&amp;";  //Cons - Mots pour Maux
url_Array[10] = "http://www.youtube.com/v/MfV18UqKvF8&amp;hl=en_US&amp;fs=1&amp;";  //Stuntman - Mots pour Maux
url_Array[11] = "http://www.youtube.com/v/xs4hVuBS8vo?fs=1&amp;hl=en_US";  //California - California
url_Array[12] = "http://www.youtube.com/v/7TgRzoo_FxA&amp;hl=en_US&amp;fs=1&amp;";  //Viviane - California
url_Array[13] = "http://www.youtube.com/v/C-PWC52C-ZI?fs=1&amp;hl=en_US";  //Caledonie - Bout de Vie
url_Array[14] = "http://www.youtube.com/v/6V690nASWXU&amp;hl=en_US&amp;fs=1&amp;";  //Loin - Bout de Vie
url_Array[15] = "http://www.youtube.com/v/Bm7yFpoUVjk?fs=1&amp;hl=en_US";  //Sorti - Grand Cru
url_Array[16] = "http://www.youtube.com/v/0ppuWbXn_p0?fs=1&amp;hl=en_US";  //Sunset - Grand Cru
url_Array[18] = "http://www.youtube.com/v/-sn9OniDX3M?fs=1&amp;";  //Country Roads - Mots pour Maux
url_Array[19] = "http://www.youtube.com/v/nrZC5lrG1Qs?fs=1&amp;hl=en_US";  //Artiche - Bout de Vie
url_Array[20] = "http://www.youtube.com/v/SX9JPkqnN84?fs=1&amp;hl=en_US";  //Fauteuil Cinema - Grand Cru
url_Array[21] = "http://www.youtube.com/v/UvAQqc0Ef_4?fs=1&amp;hl=en_US";  //Atlantique Dauphine - Bout de Vie
url_Array[22] = "http://www.youtube.com/v/LNpVNPil94U?fs=1&amp;hl=en_US";  //L'hiver est triste - California
url_Array[23] = "http://www.youtube.com/v/O_NcolnWbpA?fs=1&amp;hl=en_US";  //It's better in the Bahamas - Grand Cru
url_Array[24] = "http://www.youtube.com/v/wviy6QA9qUg?fs=1&amp;hl=en_US";  //Saturne - Bout de Vie
url_Array[25] = "http://www.youtube.com/v/iM0vteyJct0?fs=1&amp;hl=en_US";  //Bateaux - Bout de Vie
url_Array[26] = "http://www.youtube.com/v/Heu1_nG_9yM?version=3";  //Gadjo - Bout de Vie
url_Array[27] = "http://www.youtube.com/v/CN8bNcBRvPo?version=3";  //Etoile Filante - Grand Cru
url_Array[28] = "http://www.youtube.com/v/btRQTtYeUMk?version=3";  //Priere - Grand Cru
url_Array[29] = "http://www.youtube.com/v/CmdmcHorDa4?version=3";  //Le bateau - California
url_Array[30] = "http://www.youtube.com/v/3fbnS2Epduc?version=3";  //Signal de detresse - Grand Cru
url_Array[31] = "http://www.youtube.com/v/EBkUzCVG2TU?version=3";  //Chanson impossible - California
url_Array[32] = "http://www.youtube.com/v/hLqAE4O9xxk?version=3";  //Chef - California
url_Array[33] = "http://www.youtube.com/v/OGBMlMhzek0?version=3";  //Poele - Mots pour Maux
url_Array[34] = "http://www.youtube.com/v/fQ7BNyip52Q?version=3";  // Faits Divers - Grand Cru
url_Array[36] = "http://www.youtube.com/v/AJf2QUtIE0c?version=3";  //Elle - California
url_Array[37] = "http://www.youtube.com/v/n3_t-KbFyTA?version=3";  // Theme for Eva - Bout de Vie
url_Array[38] = "http://www.youtube.com/v/0j5kSwtWeXA?version=3";  //Nouvelle - Bout de Vie
url_Array[39] = "http://www.youtube.com/v/7QoU21lUH6w?version=3";  // Jalousie - Bout de Vie
url_Array[40] = "http://www.youtube.com/v/CUtkwQHK0TA?version=3";  //Bonjour Madame - Bout de Vie
url_Array[41] = "http://www.youtube.com/v/HAprYlO-mlQ?version=3";  //Au bout du Chemin- Toujours Debout
url_Array[42] = "http://www.youtube.com/v/OaQ8KcZINiM?version=3";  //Fiancée de Boismorand - Bout de Vie
url_Array[43] = "http://www.youtube.com/v/F6-RNHZ-fdI?version=3";  //40ans - Mots pour Maux
url_Array[44] = "http://www.youtube.com/v/wNUOvXFnhzE?version=3";  //Maman me disait - Toujours Debout
url_Array[45] = "http://www.youtube.com/v/pDstnzp8DqI?version=3";  //Apparition - California
url_Array[46] = "http://www.youtube.com/v/doWQlilQcYE?version=3";  //Terre D'asile - Mots pour Maux
url_Array[47] = "http://www.youtube.com/v/NrASSBYCX9s?version=3";  //A Stephane - California
url_Array[48] = "http://www.youtube.com/v/nkOW3kyg-YI?version=3&amp;hl=en_US&amp;rel=0";  //ont emporte ma biere - California
url_Array[49] = "http://www.youtube.com/v/d1JxRW7ANbA?version=3&amp;hl=en_US&amp;rel=0";  //Goelette - Mots pour Mux
url_Array[100] = "http://www.youtube.com/v/apuB72zKWLc?version=3";  //Blue Bayou
url_Array[101] = "http://www.youtube.com/v/90wk2EGj2DY?version=3&amp;hl=en_US&amp;rel=0";  //Dream a little dream
url_Array[150] = "http://www.youtube.com/v/7oU1YgoFG2U?fs=1&amp;hl=en_US";  //Johnny b. Goode 
url_Array[151] = "http://www.youtube.com/v/5MkNky32ev0?version=3";  //Want my Fleetwood Back 
url_Array[152] = "http://www.youtube.com/v/0u5GbgMgvDI?version=3";  //Wonder where you are tonight 
url_Array[153] = "http://www.youtube.com/v/ZhYyq9ZTGqg?version=3&amp;hl=en_US&amp;rel=0";  //Lodi
url_Array[200] = "http://www.youtube.com/v/ZT9795OtfZg?version=3&amp;hl=en_US&amp;";  //Groland 



function replacevideo(themovie){
	document.getElementById('movie').src = url_Array[themovie];
	document.getElementById('movieparameter').value = url_Array[themovie];
}


/*---External link ---*/

	function ExternalLink(URL){
	  if (Browser=="Opera"){
		window.open(URL,'_blank','location=yes');
	  } // opera
	  else if (Browser=="Microsoft Internet Explorer"){
		theHeight = screen.availHeight-200;
		theWidth = screen.availWidth-100;
		command = "open(URL,'_blank','width="+theWidth+",height="+theHeight+",left=100,top=0,location=yes,toolbar=yes,scrollbars=yes,status=yes,resizable=yes');";
		eval(command);
	  } // internet explorer
	  else {
		window.open(URL,'_blank');
	  }
	}

// replace image via Javascript

	function changeImage(Element, URL){
		var theElement = document.getElementById(Element);
		theElement.src = URL;
	}


function replaceSpan(text,box){
       var theBox = document.getElementById(box);
       theBoxChild = theBox.childNodes[0];
       theBoxChild.nodeValue = text;
} // replaceSpan



// NOTES BEHAVIOR via Javascript

	function changenote(Shows){
               spectacleObj = document.getElementById('spectacle');
               note1Obj = document.getElementById('note1');
               note2Obj = document.getElementById('note2');
               note3Obj = document.getElementById('note3');
               anchorObj = document.getElementById('anchor');
               if (Shows=="Joie"){
                       replaceSpan('Y\'a d\'la Joie','textlink');
                       anchorObj.href = "content.php?page=yadlajoie";
                       spectacleObj.src ="images/notes/previewjoie.jpg";
                       note1Obj.src ="images/notes/yadlajoie_on.png";
                       note2Obj.src ="images/notes/hamac_off.png";
                       note3Obj.src ="images/notes/chansons_off.png";  
                       		}
                else if (Shows=="Hamac"){
                       replaceSpan('Hamac','textlink');
                       anchorObj.href = "content.php?page=hamac";
                       spectacleObj.src ="images/notes/previewhamac.jpg";
                       note1Obj.src ="images/notes/yadlajoie_off.png";
                       note2Obj.src ="images/notes/hamac_on.png";
                       note3Obj.src ="images/notes/chansons_off.png";   
                       		}
                else if (Shows=="Chansons"){
                       replaceSpan('Seul en scène','textlink');
                       anchorObj.href = "content.php?page=millechansons";
                       spectacleObj.src ="images/notes/previewchansons.jpg";
                       note1Obj.src ="images/notes/yadlajoie_off.png";
                       note2Obj.src ="images/notes/hamac_off.png";
                       note3Obj.src ="images/notes/chansons_on.png";        
               			}         
	}
	
	

// ZUFALL BILD HOME via Javascript

function random_number(min,max) {
    return (Math.round((max-min) * Math.random() + min));
}

function zufallbild(){
	imgObj=document.getElementById("indexbild");
	imgObj.src=bild_Array[random_number(0,bild_Array.length-1)];
}

bild_Array[0] = "images/indexzufall/Index1.jpg"; 
bild_Array[1] = "images/indexzufall/Index2.jpg"; 
bild_Array[2] = "images/indexzufall/Index3.jpg"; 
bild_Array[3] = "images/indexzufall/Index4.jpg"; 
bild_Array[4] = "images/indexzufall/Index5.jpg"; 
bild_Array[5] = "images/indexzufall/Index6.jpg"; 






// NEWSTICKER via Javascript
function ticker_setup(){
       tickerPause = false;
       tickerObj = document.getElementById("TICKER");

       tickerBodyObj = document.getElementById("TICKER_BODY");
       tickerBodyObj.innerHTML = tickerBodyObj.innerHTML + tickerBodyObj.innerHTML;
       ticker();
}



function ticker() {
       if(!tickerPause){
               tickerObj.scrollLeft = tickerObj.scrollLeft+2; // ++;
       }
//alert("ScrollWidth: "+tickerObj.scrollWidth + "\noffsetWidth"+tickerObj.offsetWidth + "\nscrollLeft"+tickerObj.scrollLeft);
       if(tickerObj.scrollLeft >= (tickerObj.scrollWidth/2)){
               tickerObj.scrollLeft = 0;
       }
       window.setTimeout("ticker()", 25);
}




/*---POP UP BLOW UP IMAGE ---*/


var displayWidth = 0;
var displayHeight = 0;

function PopupCentrer(theImage){
       // getting height and width of the visible portion of the page (display)
       if(!window.innerWidth){
               if(!(document.documentElement.clientWidth == 0)){
                       displayWidth = document.documentElement.clientWidth;
                       displayHeight = document.documentElement.clientHeight;
               } else {
                       displayWidth = document.body.clientWidth;
                       displayHeight = document.body.clientHeight;
               }
       } else {
               displayWidth = window.innerWidth;
               displayHeight = window.innerHeight;
       }
       // setting height/width of the DIV containing the image to the maximum size of the display and switching it on
       containerObj = document.getElementById('showimagecontainer');
       containerObj.style.visibility = "visible";          
       containerObj.style.height=displayHeight+"px";
       containerObj.style.width=displayWidth+"px";

       // switching on the background
       backgroundObj = document.getElementById('showbackground');
       backgroundObj.style.visibility = "visible";

       // loading the large image and pushing it down into the center
       imageObj = document.getElementById('showbigimage');
       imageObj.style.visibility = "hidden";          
       imageObj.src = theImage;
       imageObj.onload = move; 
}


// pushing the image down into the center

function move(){
       imgHeight = imageObj.height;
       margin = (displayHeight-imgHeight)/2;
       imageObj.style.top = margin+"px";
       imageObj.style.visibility = "visible";          
}


// switching the two DIVs off

function disappear(){
       containerObj = document.getElementById('showimagecontainer');
       containerObj.style.visibility = "hidden";          
       backgroundObj = document.getElementById('showbackground');
       backgroundObj.style.visibility = "hidden";
       imageObj = document.getElementById('showbigimage');
       imageObj.style.visibility = "hidden";          
       imageObj.src = "";
}

// PopUp Video

function myWindow(address) {
window.open( address, "myWindow",
"status = 1, height = 344, width = 425, resizable = 0" )
}





