

/*=================================================================
Function: popup
Purpose:  pop a new html window
==================================================================*/
function popup(poste,tailleW,tailleH) {
  window.open(poste,"poste","Width="+tailleW+",Height="+tailleH+",scrollbars=yes,menubar=no,resizable=yes");
}



/*=================================================================
Function: langue
Purpose:  change /en for /fr and vice-versa for language change
==================================================================*/
function langue()
{
	var the_url = document.URL;
	if (the_url.indexOf("/en/", 0)!=-1){
		document.location = the_url.replace(/((?:\/)|(?:%2F))en\1/gi, "$1fr$1");
	}	
	else if (the_url.indexOf("/de/", 0)!=-1){
		document.location = the_url.replace(/((?:\/)|(?:%2F))de\1/gi, "$1fr$1");
	}	
	else if (the_url.indexOf("/fr/", 0)!=-1){
		document.location = the_url.replace(/((?:\/)|(?:%2F))fr\1/gi, "$1en$1");
	}
	else {
	}	
}



/*=================================================================
Function: ClickabletTable
Purpose:  la couleur de fond d'une table avec une url
==================================================================*/

	function ChangeColor(tableRow, highLight)
	{
			if (highLight)
			{
				tableRow.style.backgroundColor = '#EEE';
			}
			else
			{
				tableRow.style.backgroundColor = '#FFF';
			}
	}
	function DoNav(theUrl)
	{
		document.location.href = theUrl;
	}
	
	
	

/*=================================================================
Function: Random image
Purpose:  add a number to change image randomely
Copyright: 2002 Bontrager Connection, LLC
==================================================================*/
//
// Type the number of images you are rotating.

NumberOfImagesToRotate = 1;

// Specify the first and last part of the image tag.

FirstPart = '<img src="home';
LastPart = '.png" height="522" width="461">';

function printImage() {
var r = Math.ceil(Math.random() * NumberOfImagesToRotate);
document.write(FirstPart + r + LastPart);
}





/*=================================================================
Function: AUDIO PLAYER
==================================================================*/
var ap_instances = new Array();

function ap_stopAll(playerID) {
	for(var i = 0;i<ap_instances.length;i++) {
		try {
			if(ap_instances[i] != playerID) document.getElementById("audioplayer" + ap_instances[i].toString()).SetVariable("closePlayer", 1);
			else document.getElementById("audioplayer" + ap_instances[i].toString()).SetVariable("closePlayer", 0);
		} catch( errorObject ) {
			// stop any errors
		}
	}
}

function ap_registerPlayers() {
	var objectID;
	var objectTags = document.getElementsByTagName("object");
	for(var i=0;i<objectTags.length;i++) {
		objectID = objectTags[i].id;
		if(objectID.indexOf("audioplayer") == 0) {
			ap_instances[i] = objectID.substring(11, objectID.length);
		}
	}
}

var ap_clearID = setInterval( ap_registerPlayers, 100 );
