if (window.XMLHttpRequest)
  {
  xhttp=new XMLHttpRequest()
  }
else
  {
  xhttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
xhttp.open("GET","fileadmin/templates/shadowbox/videos.xml",false);
xhttp.send("");
xmlDoc=xhttp.responseXML;
var file = xmlDoc.getElementsByTagName("fichier")[0].childNodes[0].nodeValue;
var adresse = location.host;
premierVideo = 'http://' + adresse +  file; 
premierVideoEn = premierVideo + '&lngVar=en';
premierVideo=premierVideo+ '&lngVar=fr';
videoAct = 0;
ligneAct = 'ligne1';

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function loadBG(){
	document.getElementById('lien0').className = 'ligneOn';
}

function toggleBG(num){
	document.getElementById('lien'+videoAct).className = ligneAct;
	ligneAct = document.getElementById('lien'+num).className; 
	document.getElementById('lien'+num).className = 'ligneOn';
	videoAct = num;
}

function loadVideo(quel){
	var quelVideo = quel;
	window.document.video_player.SetVariable("videoActuel", quelVideo);
}


function swapVideo(quel){
	var quelVideo = quel;
	window.document.video_player.SetVariable("videoNouveau", quelVideo);
	var clic = 'vrai';
	window.document.video_player.SetVariable("checkClick", clic);
}

function embedFlashObj(Embpath,Embwidth,Embheight,Embvar){
var flashCode = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="'+Embwidth+'" height="'+Embheight+'" title="video_player" id="video_player"><param name="movie" value="'+Embpath+'" /><param name="quality" value="high" /><param name="FlashVars" value="'+Embvar+'"><param name="allowScriptAccess" value="always" /><embed src="'+Embpath+'" quality="high" FlashVars="'+Embvar+'" allowscriptaccess="always" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+Embwidth+'" height="'+Embheight+'" name="video_player"></embed></object>';
document.write(flashCode) ;
}

function openShadowbox(content){
    Shadowbox.open({
        content:    content, 
        player:     ["flv"], 
        height:     750, 
        width:      800
    });
}

function loadBGCarte(){
   loadBG();
   GetMap();
}
