//Chargement
function FormLoading() {
	document.getElementById('loading').style.display = 'block';	
	return true;		
	}

//Popup
	function popup(theURL,winName,features) {
	window.open(theURL,winName,features);
	}

//Recommander
	function Recommander() {
	window.open('recommander.php','recommander','width=540,height=360,scrollbars=0');
	}

//Lien URL
	function GoLink(theURL) {
	document.location.href=''+theURL+'';
	}

//Retour
function Retour() {
	history.back(-1);
	}

//Confirmation
function ConfLink(txt,url) {
	if( confirm(txt) )
	 document.location.href=''+url+'';
	}

//Téléchargement refusé
function NoDownload() {
	alert("Pour télécharger ce cours, vous devez être inscrit et connecté à Torah-Box.com... Inscrivez-vous en deux minutes !");
	GoLink('/inscription.php');
	}

//Afficher / Masquer
function HiddenShow(zone) {
	current=(document.getElementById(zone).style.display == 'none') ? 'block' : 'none';
	document.getElementById(zone).style.display = current;
	}

//Menu
function jump(targ,selObj) {
	var MyJump = selObj.options[selObj.selectedIndex].value;
	selObj.selectedIndex = 0;
	eval(targ+".location='"+MyJump+"'");
	}

//Explorer
function Explorer() {
	HiddenShow('explorer');
	}

function SetFileName(MyValue) {
	if( confirm("Le nouveau fichier sera "+MyValue+" ?") ) {
		parent.formulaire.fichier.value = MyValue;
		self.close();
		}
	}

function GetMP3Data() {
	MyFile = document.formulaire.fichier.value;
	if( MyFile == '' ) {
		alert('Veuillez sélectionner un fichier.');
		document.getElementById('explorer').style.display = 'block';
		}
	else {
		if( confirm('Attention les informations actuelles seront écrasées !') )
			//window.open('get_mp3.php?f='+MyFile);
			mp3.location='get_mp3.php?f='+MyFile;	
	}
}

//Sélection multiple des catégories
function SelectCategorie() {
var selObj = document.formulaire.liste_categorie;

var SelectedList = '';
for(var i = 0; i < selObj.length; i++) {
if( selObj.options[i].selected == true )
	SelectedList += (selObj.options[i].value + ":");
}
if( SelectedList != '' )
	SelectedList = ":" + SelectedList;

document.formulaire.categorie.value = SelectedList;
}

//Images réactives
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}