// JavaScript Document

// desactiver les messages d'erreur
function NoError()
	{
	return true;
	}
window.onerror=NoError;

function custom_print() { // version nettement simplifiee
	window.print();
}

function goHist(a) 
{
   history.go(a);     
}

function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function zoom(id_layer) {
	if (id_layer != '') zoomLayer(id_layer);
}

function zoomLayer(id_layer) {
	var item = null;
	if (document.getElementById) {
		item = document.getElementById(id_layer);
	} else if (document.all){
		item = document.all[id_layer];
	} else if (document.layers){
		item = document.layers[id_layer];
	}
	
	if (!item) { // stand by
	} else if (item.style) {
		if (item.style.display == "none") {
			item.style.display = "";
		} else {
			item.style.display = "none";
		}
	} else {
		item.visibility = "show";
	}
}
// ajout dans les favoris
nav = navigator.appName.substring(0,3);
ver = navigator.appVersion.substring(0,1)

function addFavFR()
{
if (nav == "Mic" && ver >= 4)
	{
	url_site="http://www.podcast-player.com/en/";
	titre_site = "podcast-player.com - Podcast Player Online";
	document.write('<a class="langue" href="#" onclick="window.external.AddFavorite(url_site, titre_site);return(false);">Add podcast-player.com into your favorites</a> | ')
	}
else
	{
	// document.write('Faites CTRL+D pour ajouter ce site à vos favoris!')
	}
}

function addFavNL()
{
if (nav == "Mic" && ver >= 4)
	{
	url_site="http://www.podcast-player.com/nl/";
	titre_site = "podcast-player.com - Thuisbezorging en prestaties";
	document.write('<a class="langue" href="#" onclick="window.external.AddFavorite(url_site, titre_site);return(false);">Voeg podcast-player.com toe aan uw favorieten</a> | ')
	}
else
	{
	// document.write('Voeg podcast-player.com toe aan uw favorieten met CTRL+D')
	}
}

function redimPlaylist(){ 
	as=document.getElementById("playlist").offsetHeight; 
	parent.document.getElementById("playlist").height=as+10; 
	as=document.getElementById("playlist").offsetWidth; 
	parent.document.getElementById("playlist").width=as; 		
} 

function redimPodcasts(){ 
	as=document.getElementById("podcasts").offsetHeight; 
	parent.document.getElementById("podcasts").height=as+10; 
	as=document.getElementById("podcasts").offsetWidth; 
	parent.document.getElementById("podcasts").width=as; 		
} 

function redimPodcast(){ 
	as=document.getElementById("podcast").offsetHeight; 
	parent.document.getElementById("podcast").height=as+10; 
} 

function redimPublicPlayer(w,h){ 
	parent.document.getElementById("player").height=w; 
	parent.document.getElementById("player").width=h; 			
} 

function redimPlayer(){ 
	as=document.getElementById("player").offsetHeight; 
	parent.document.getElementById("player").height=as+10; 
	as=document.getElementById("player").offsetWidth; 
	parent.document.getElementById("player").width=as; 		
} 

function supprimerFlux() 
{ 
	document.abonnements.method = "POST";
	document.abonnements.action = "index.cfm";
	document.abonnements.submit();
}

function nextSequence(url) {
	window.open(url,'_self');
}

//v1.0
//Copyright 2006 Serge Rappaille - All rights reserved.
function flash(url,width,height,bgcolor) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab##version=7,0,0,0" width="'+width+'" height="'+height+'" id="flash" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="'+url+'" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgcolor" value="#'+bgcolor+'" />');
	document.write('<embed src="'+url+'" quality="high" bgcolor="#'+bgcolor+'" width="'+width+'" height="'+height+'" name="flash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}

function playmov(url,width,height) {
	document.write('<embed type="video/quicktime" src="+url+" width="+width+px" height="'+height+'px" controller="true" />');
}

function poprss(theURL,winName,features) { //v2.0
	var w = window.open(theURL,winName,features);
	w.document.close();
	w.focus(); 
}


function deleteSelected() {
	liste = document.getElementById('maliste');
	valeur = liste.value;
	// alert(valeur);
	window.open('podcasts.cfm?delete='+valeur, '_self');
}


function playSelected() {
	liste = document.getElementById('maliste');
	valeur = liste.value;
	// alert(valeur);
	window.open('player.cfm?sequence='+valeur, 'player');
}

function construction(frame,langue) {
	if (parent.frames.length < 1) {
		top.location.href = location.href; 
		document.location.href = 'http://www.podcast-player.com/'+langue+'/podcast-directory.cfm?frame='+frame;
	}
}

function selectionner() { 
		document.formulaire.url.select(); 
} 

function logout(page)
{
	var ht = document.getElementsByTagName("html");
	ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
	if (confirm('Êtes-vous certain de vouloir quitter cet espace ?'))
	{
		// Supprimer cette fonction en XHTML
		// return true;
		// Fonction utile que pour le menu FLASH
		go_home(page);
	}
	else
	{
		ht[0].style.filter = "";
		document.focus();
		// Supprimer cette fonction en XHTML
		// return false;
	}
}