/*
Procédure pour ajouter un nouveau concert OU enlever un concert

*/

var arrId = new Array('20071206', '20070904', '20070621', '20070412', '20070305', '20070213', '20061219', '20061115', '20060926');


// Choisir quel concert ouvrir
function getConcert(id)
{
	gererMenu(id);
	envoieInfo(id);
}


// Gérer le menu, ie, décolorier et colorier
function gererMenu(id)
{
	// décolorier tous
	for (var i=0; i<arrId.length; i++)
	{
		document.getElementById(arrId[i]).className = 'no_over';
	}
	
	// colorier
	if (document.getElementById(id))
	document.getElementById(id).className = 'over';
}


function envoieInfo(param)
{
		http.open('get', 'concerts/'+param+'.shtml');
		http.onreadystatechange = manipuleReponse;
		http.send(null);
}






function creerRequete()
{
	var tempXMLHTTP;
	var navigateur = window.navigator.appName;
	if(navigateur == "Microsoft Internet Explorer")
		tempXMLHTTP = new ActiveXObject("Microsoft.XMLHTTP");
	else
		tempXMLHTTP = new XMLHttpRequest();
	return tempXMLHTTP;
}

http = creerRequete();

function manipuleReponse()
{
	if(http.readyState == 4)
	{
		reponse = http.responseText;
		window.document.getElementById("contenu").innerHTML = reponse;
	}
}

/*CONSOLE NAGANO*/
	var idItem = '1';

	function embedMediaPlayer(_sUrl, _sDiv, _nPlayerWidth, _nScreenHeight, _isAutoStart, _isShowControls, _idBoxOpen, _isVideo, srcImage)
	{
	  var _nPlayerHeight = (_isShowControls || _isShowControls==null) ? (_nScreenHeight+45) : _nScreenHeight;

	  // Cacher tous les box
	  document.getElementById('a'+idItem).style.display = 'none';
	  document.getElementById('a'+_idBoxOpen).style.display = 'block';
	  idItem = ''+_idBoxOpen+'';
	  if (_isVideo == 1)
	  	$id(_sDiv).innerHTML = '';
	else
	  $id(_sDiv).innerHTML = '<img src="'+ srcImage +'">';
	  
	  //if (browserDetect.OS == "Mac" && !av.needFFM) {
	  if (browserDetect.OS == "Mac") {
	   $id(_sDiv).innerHTML = $id(_sDiv).innerHTML + AC_AX_GetContent(
		'id','player',
		'name', 'player', 
		'type','video/quicktime',
		'classid','clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
		'codeBase', 'http://www.apple.com/qtactivex/qtplugin.cab',
		'style','width:'+_nPlayerWidth+'px; height:'+_nPlayerHeight+'px',
		'width', _nPlayerWidth,
		'height', _nPlayerHeight,
		'SRC', _sUrl, 
		'controller', 'true', 
		'bgcolor', 'black', 
		'scale', 'noscale', 
		'EnableJavaScript', 'true', 
		'volume', '9' 
	   );
	  //} else if (browserDetect.OS == "Windows" && !av.needActiveX) {
	  } else if (browserDetect.OS == "Windows") {
	   $id(_sDiv).innerHTML = $id(_sDiv).innerHTML + AC_AX_GetContent(
		'id','player',
		'name', 'player',
		'type','application/x-mplayer2',
		'classid','CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6',
		'codeBase', 'Version=7,0,0,1954',
		'STANDBY', 'Chargement du média...',
		'pluginspage', 'http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/',
		'style','width:'+_nPlayerWidth+'px; height:'+_nPlayerHeight+'px',
		'width', _nPlayerWidth,
		'height', _nPlayerHeight,
		'url', _sUrl,
		'SRC', _sUrl,
		'ShowControls', '1',
		'ShowStatusBar', '0', 
		'autostart',_isAutoStart,
		'uimode',((_isShowControls || _isShowControls==null)?"full":"none"), 
		'scale', 'noscale', 
		'volume', '9'
	   );
	  } else {
	   
	   $id(_sDiv).innerHTML = $id(_sDiv).innerHTML + ''
			   + '<OBJECT'
			   +   ' ID="playerr"'
			   +   ' height="'+_nPlayerHeight+'"'
			   +   ' codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"'
			   +   ' classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"'
			   +   ' STANDBY="Chargement du média..."'
			   +   ' TYPE="application/x-oleobject"'
			   +  '>'
			   + ' <PARAM name="height" value="'+_nPlayerHeight+'">'
			   + ' <PARAM name="autoStart" value="'+_isAutoStart+'">'
			   + ' <PARAM name="stretchToFit" value="0">'
			   + ' <PARAM name="ShowControls" value="1">'
			   + ' <PARAM name="scale" value="noscale">'
			   + ' <PARAM name="uiMode" value="none">'
			   + ' <PARAM name="URL" value="' + _sUrl + '">'
			   + ' <PARAM name="volume" value="9">'
			   + ' <EMBED'
			   + '   type="application/x-mplayer2"'
			   + '   pluginspage="http://www.microsoft.com/windows/mediaplayer/en/default.asp"'
			   + '   src="' + _sUrl + '"'
			   + '   name="player"'
			   + '   id="player"'
			   + '   height="' + _nPlayerHeight + '"'
			   + '   AutoStart="'+ ((_isAutoStart)?1:0)+'"'
			   + '   ShowControls="1"'
			   + '   ShowStatusBar="1"'
			   + '   stretchtofit="0"'
			   + '   wmode="transparent"'
			   + '   scale="noscale"',
			   + '   uimode="'+((_isShowControls || _isShowControls==null)?"full":"none")+'"',
			   + ' >'
			   + ' </EMBED>'
			   + ' </OBJECT>';
			 
	  }
	 
	 };

	function writeMediaPlayer(fichier)
	{
		var htmlCodeToWrite = "<embed src=\""+ fichier +"\" width=\"480\" height=\"270\" showstatusbar=\"false\" type=\"video/x-ms-asf-plugin\" showcontrols=\"true\" showdisplay=\"false\" pluginspage=\"http://microsoft.com/windows/windowsmedia/fr/download/\"></embed>";
		document.getElementById('videoASX').innerHTML = htmlCodeToWrite;
	}

