
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
url_Array[1] = "http://www.youtube.com/v/h-WTa0OVU8I?fs=1&hl=en_US";  //Surcharge 
url_Array[2] = "http://www.youtube.com/v/vbyKY7RWG9A&amp;hl=en_US&amp;fs=1&amp;";  //Papayes 
url_Array[3] = "http://www.youtube.com/v/P-JRcC2SpLU&amp;hl=en_US&amp;fs=1&amp;";  //Chanteur Country 
url_Array[4] = "http://www.youtube.com/v/IvUruLJNavA&amp;hl=en_US&amp;fs=1&amp;";  //Blues 
url_Array[5] = "http://www.youtube.com/v/7ps5NWEDwGc&amp;hl=en_US&amp;fs=1&amp;";  //Paradis 
url_Array[6] = "http://www.youtube.com/v/WYUuPYK76Is&amp;hl=en_US&amp;fs=1&amp;";  //Borneo 
url_Array[7] = "http://www.youtube.com/v/EYr77ZmJ8JE&amp;hl=en_US&amp;fs=1";  //Banc 
url_Array[8] = "http://www.youtube.com/v/bOwLtop4HxE&amp;hl=en_US&amp;fs=1&amp;";  //Chaises 
url_Array[9] = "http://www.youtube.com/v/UPpZV1DcPxw&amp;hl=en_US&amp;fs=1&amp;";  //Cons 
url_Array[10] = "http://www.youtube.com/v/MfV18UqKvF8&amp;hl=en_US&amp;fs=1&amp;";  //Stuntman 
url_Array[11] = "http://www.youtube.com/v/xs4hVuBS8vo?fs=1&amp;hl=en_US";  //California 
url_Array[12] = "http://www.youtube.com/v/7TgRzoo_FxA&amp;hl=en_US&amp;fs=1&amp;";  //Viviane 
url_Array[13] = "http://www.youtube.com/v/C-PWC52C-ZI?fs=1&amp;hl=en_US";  //Caledonie 
url_Array[14] = "http://www.youtube.com/v/6V690nASWXU&amp;hl=en_US&amp;fs=1&amp;";  //Loin 
url_Array[15] = "http://www.youtube.com/v/Bm7yFpoUVjk?fs=1&amp;hl=en_US";  //Sorti 
url_Array[16] = "http://www.youtube.com/v/0ppuWbXn_p0?fs=1&amp;hl=en_US";  //Sunset 
url_Array[17] = "http://www.youtube.com/v/9Q0ZAcUfM24&amp;hl=en&amp;fs=1&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/IndexChanteurCountry.jpg"; 
bild_Array[1] = "images/IndexBluesEnDo.jpg"; 
bild_Array[2] = "images/IndexMamanMeDisait.jpg"; 
bild_Array[3] = "images/IndexPapayes.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 = "";
}

