var arrayPlateau = new Array("ascenseur", "autobus", "avenue", "bain", "balpop", "bar", "bibliotheque", "boutique", "bureau", "cabtel", "campagne", "cascade", "cinema", "cirque", "defile", "ecole", "embouteillage", "escalier", "fleuve", "grenier", "hotel", "immeuble", "jardinpublic", "kiosque", "livraison", "manege", "marche", "metro", "montgolfiere", "moto", "musee", "piscine", "place", "plage", "port", "quartieraffaires", "restaurant", "reverbere", "telepherique", "theatre", "train", "zoo");


var arrayPersonnagesInitial = new Array("astronaute", "avocat", "cantatrice", "clochard", "clown", "dompteur", "fantome", "fee", "fillette", "fou", "jardinier", "jongleur", "magicien", "maries", "moine", "nageur", "pompier", "religieuse", "roi", "touriste", "voyante", "astronaute", "avocat", "cantatrice", "clochard", "clown", "dompteur", "fantome", "fee", "fillette", "fou", "jardinier", "jongleur", "magicien", "maries", "moine", "nageur", "pompier", "religieuse", "roi", "touriste", "voyante");

var pointe = "pointe";
var baie = "baie";
var acis = "acis";
var diane1 = "diane1";

var arrayImages = ["Image1.jpg", "Image2.jpg", "Image3.jpg", "Image4.jpg", "Image5.jpg", "Image6.jpg", "Image7.jpg"];


function change_image(x){
	document.getElementById("image").src = "aprevost/images/" + x + ".jpg";
}

function random_place(marcel){
	var x = Math.floor(Math.random() * 42);
	document.getElementById(marcel).src = "memory/lieux/" + arrayPlateau[x] + ".gif";
}

function random_figure(marcel){
	var x = Math.floor(Math.random() * 21);
	document.getElementById(marcel).src = "memory/personnages/" + arrayPersonnagesInitial[x] + ".gif";
}

function memory(){
	window.open("memory/index.html", "memory");
}

function random_memory(){
	var x = Math.floor(Math.random() * 42);
	document.getElementById("nord_ouest").src = "memory/lieux/" + arrayPlateau[x] + ".gif";
	
	var y;
	
	do 
		y = Math.floor(Math.random() * 42)
	while(y==x);
	
	document.getElementById("sud_ouest").src = "memory/lieux/" + arrayPlateau[y] + ".gif";

	random_figure("nord_est");
	random_figure("sud_est");
}


function random_friends(){
	var x = Math.floor(Math.random() * 7);
	document.getElementById("image_friends").src = "film/friends/" + arrayImages[x];
}



function playSon(son){
		son=son.toLowerCase();
	
	//document.getElementById("dummyspan").innerHTML = "<embed src='sons/"+son+".mp3' hidden='true' autostart='true' loop='false'>" ;
	var text = "<object type='application/x-shockwave-flash' data='dewplayer.swf?mp3=sons/"+son+".mp3&amp;autostart=1' width='200' height='20'><param name='wmode' value='transparent' /><param name='movie' value='dewplayer.swf?mp3=sons/"+son+".mp3&amp;autostart=1' /></object>";
			
document.getElementById("dummyspan").innerHTML = text;
	
}


function playLesson(lesson, son)
{
	son=son.toLowerCase();
	
	/*
	chemin = "http://www.lapasserelle.com/sm/ang90mp3/";
	chemin = chemin + lesson + "/sons/" + son + ".rpm";
	document.son.SetSource(chemin);
	document.son.DoPlayPause();
	*/
	
	//document.getElementById("dummyspan").innerHTML = "<embed src='http://www.lapasserelle.com/sm/ang90mp3/"+lesson+"/sons/"+son+".mp3' hidden='true' autostart='true' loop='false'>" ;
	var text = "<object type='application/x-shockwave-flash' data='dewplayer.swf?mp3=sm/ang90mp3/"+lesson+"/sons/"+son+".mp3&amp;autostart=1' width='200' height='20'><param name='wmode' value='transparent' /><param name='movie' value='dewplayer.swf?mp3=sm/ang90mp3/"+lesson+"/sons/"+son+".mp3&amp;autostart=1' /></object>";
			
document.getElementById("dummyspan").innerHTML = text;
	
}


function goToEnglishPage()
{
	   window.location.href="http://lapasserelle.com/sm/ang90mp3/indexa90-fr.php";
}



function affichageLecon(){
var peluche;
peluche=new XMLHttpRequest();
peluche.onreadystatechange=function()
	{
	if(peluche.readyState==4)
  		{
		document.getElementById("affichage").innerHTML = peluche.responseText;
		//document.getElementById("affichage").innerHTML = "bonjour";
 		}
	else
		{
		document.getElementById("affichage").innerHTML = "<i>Please wait a few seconds, the server is preparing the lesson.</i>";
		}
	}
  peluche.open("GET","lesson.php",true);
  peluche.send(null);
}

//--------------------------------------- boutons cours de maths ----------------------------------

function goToMath6()
{
	   window.location.href="http://www.lapasserelle.com/cours-en-ligne/6e_maths/index.html";
}

function goToMath5()
{
	   window.location.href="http://www.lapasserelle.com/cours-en-ligne/5e_maths/index.html";
}

function goToMath4()
{
	   window.location.href="http://www.lapasserelle.com/cours-en-ligne/4e_maths/index.html";
}

function goToMath3()
{
	   window.location.href="http://www.lapasserelle.com/cours-en-ligne/3e_maths/index.html";
}

function goToMath2()
{
	   window.location.href="http://www.lapasserelle.com/cours-en-ligne/2e_maths/index.html";
}

//----------------------------------- fin boutons cours de maths ----------------------------------


function goClips()
{
	   window.open('http://www.lapasserelle.com/multimedia_video_clips.html','interactive video clips');
}

function goTousNosCours()
{
	   window.open('http://www.lapasserelle.com/cours-en-ligne','cours en ligne');
}

function goAllOurCourses()
{
	   window.open('http://www.lapasserelle.com/online_courses','online courses');
}

function goToAnglais()
{
	   window.open('http://www.lapasserelle.com/anglais','anglais');
}

function goToEspagnol()
{
	   window.open('http://www.lapasserelle.com/espagnol','espagnol');
}

function goToSpanish()
{
	   window.open('http://www.lapasserelle.com/spanish','spanish');
}

function goToIngles()
{
	   window.open('http://www.lapasserelle.com/ingles','ingles');
}

function goToAllemand()
{
	   window.open('http://www.lapasserelle.com/german','german');
}

function goToCalculs()
{
		window.open('http://www.lapasserelle.com/cours-en-ligne/compter/apprendre_a_compter_vers_six_ans/index.html','calculs');
	   //window.location.href="http://www.lapasserelle.com/cours-en-ligne/compter/apprendre_a_compter_vers_six_ans/index.html";
}

function goToProbability()
{
		window.open('http://lapasserelle.com/online_courses/elementary_finance/concept_of_probabilities/index.html','probability');
}

function goToEnglishOralTest()
{
		window.open('http://lapasserelle.com/sm/ang90mp3/indexa90_oral_test.php','English');
}


function random_image(){
	var x = Math.floor(Math.random() * 15) + 1 ;
	document.getElementById("image").innerHTML = "<img src='sm/imgs/reading" + x + ".jpg' width='211' heigh='150'>";
}

function random_image_hallelujah(){
	var x = Math.floor(Math.random() * 8) + 1 ;
	document.getElementById("image_hallelujah").innerHTML = "<img src='songs_video/hallelujah/hallelujah" + x + ".gif' width='211' heigh='150' border='0'>";
}

function choose_image(n){
	document.getElementById("image").innerHTML = "<img src='sm/imgs/reading" + n + ".jpg' width='211' heigh='150'>";
}


