function blank(objet) {
	/**
		Function utile pour faire un target='_blank' en XHTML strict
		<a href="truc.html" onclick="return blank(this);">texte</a>
	*/
	window.open(objet.href,'_blank');
	return false;
}

/* Player de video qui marche partout */
function display_video(url_video, w, h)
{
	var txt;
	if(!w) { w = 320; }
	if(!h) { h = 240; }

	var WMP7;

	txt = "";

	if ( navigator.appName != "Netscape" )
	{   
		try  {  WMP7 = new ActiveXObject('WMPlayer.OCX'); }
		catch(e) {}
	}

	/* Windows Media Player 7 Code */
	if ( WMP7 )
	{
		txt += '<OBJECT ID=MediaPlayer ';
		txt += ' CLASSID=CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6';
		txt += ' standby="Loading Microsoft Windows Media Player components..."';
		txt += ' TYPE="application/x-oleobject" width="'+ w +'" height="'+ h +'">';
		txt += '<PARAM NAME="url" VALUE="'+ url_video +'">';
		txt += '<PARAM NAME="AutoStart" VALUE="true">';
		txt += '<PARAM NAME="ShowControls" VALUE="1">';
		txt += '<PARAM NAME="uiMode" VALUE="mini">';
		txt += '</OBJECT>';
	}

	/* Windows Media Player 6.4 Code */
	else
	{
		/* IE Code */
		txt += '<OBJECT ID=MediaPlayer ';
		txt += 'CLASSID=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 ';
		txt += 'CODEBASE=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715 ';
		txt += 'standby="Loading Microsoft Windows Media Player components..." ';
		txt += 'TYPE="application/x-oleobject" width="'+ w +'" height="'+ h +'">';
		txt += '<PARAM NAME="FileName" VALUE="'+ url_video +'">';
		txt += '<PARAM NAME="AutoStart" VALUE="true">';
		txt += '<PARAM NAME="ShowControls" VALUE="1">';

		/* Netscape code */
		txt += '    <Embed type="application/x-mplayer2"';
		txt += '        pluginspage="http://www.microsoft.com/windows/windowsmedia/"';
		txt += '        filename="'+ url_video +'"';
		txt += '        src="'+ url_video +'"';
		txt += '        Name=MediaPlayer';
		txt += '        ShowControls=1';
		txt += '        ShowDisplay=0';
		txt += '        ShowStatusBar=0';
		txt += '        width='+ w;
		txt += '        height='+ h +'>';
		txt += '    </embed>';

		txt += '</OBJECT>';
	}
	document.write(txt);
}

/* Script d'ajout aux favoris qui marche sous firefox */
function Bookmark(title,url)
{
	if( window.external ) {
		window.external.AddFavorite( url, title );
	} else if( window.sidebar ) { window.sidebar.addPanel( title, url, "");  }
}

/* Popup centrée pour le micro-paiement */
function pop(url) {
	var left = (screen.width/2)-190; // On retire la moitié de 'width'
	var top = (screen.height/2)-130; // On retire la moitié de 'height'
	mp = window.open(url,'mp','statutbar=no, width=380, height=260, left='+left+', top='+top+', menubar=no, resize=no');
	if (mp && mp.focus) { 
		mp.focus();
	}
	mp.document.close();
}

/**
	Fonction javascript qui permet d'envoyer une url
	à preview.php ainsi qu'un paramètre optionnelle.
	Son usage peut être multiple.
*/
function view(url,option)
{
	var left = 10;
	var top = 10;
	preview_php=home+"/preview.php?url="+url+"&option="+option;
	preview = window.open(preview_php,"preview","statutbar=no,width=350,height=280,resizable=1,scrollbars=1,left="+left+",top="+top);
	if (preview && preview.focus) { preview.focus(); }
	preview.document.close();
}

/**
	Technique du faux zoom qui permet d'ouvrir une vignette
	en plus grand et de rediriger vers une page de paiement.
*/
function zoom(variable_1,variable_2,option,mm_debut)
{
	var left = 10;
	var top = 10;
	preview_php=home+"/preview.php?var1="+variable_1+"&var2="+variable_2+"&option="+option+"&MM_debut="+mm_debut;
	preview = window.open(preview_php,"preview","statutbar=no,width=350,height=280,resizable=1,scrollbars=1,left="+left+",top="+top);
	if (preview && preview.focus) { preview.focus(); }
	preview.document.close();
}


/**
	Fonction qui va executer la fonction 'next' dans un interface de temps
	défini par la variable 'interval'. A appeller dans le 'onload' de '<body>'
	La fonction 'next' est à définir selon les besoins dans la page concernée.
*/
duree=-1;
function timer() { 
	duree++;
	if (duree>interval) { next(); }
	window.setTimeout("timer()",1000);
}

/** 
Labranlette JS
*/

if(typeof SymRealWinOpen == "object") { window.open = SymRealWinOpen; }
if(typeof NS_ActualOpen == "object") { window.open = NS_ActualOpen; }
if(typeof orig_setTimout == "object") { window.setTimeout = orig_setTimout; }
   

function op_pounder(randl,nom_pop)
    {

var winwidth = window.screen.availWidth - 10;
var winheight = window.screen.availHeight - 30;

newwin = window.open(randl,nom_pop,"scrollbars=yes,status=yes,toolbar=yes,location=yes,directories=yes,resizable=yes,width=' + winwidth + ', height=' + winheight + '");
newwin.window.blur();
window.focus();

    }

function Depli(span_id,theone) {
  var desc='desc_'+span_id;
  var timg='img_'+span_id;
  var oneshoot = 'oneshoot_'+span_id;
  mydesc=document.getElementById(desc);
  myimg=document.getElementById(timg);
  myoneshoot=document.getElementById(oneshoot);

if (theone == 'img_') {
  mydesc.style.display = 'none';
  myoneshoot.style.display = 'none';
  if (myimg.style.display == '') {
    myimg.style.display = 'none'; 
  } else {
    myimg.style.display = ''; 
  }
}

if (theone == 'desc_') {
  myimg.style.display = 'none';
  myoneshoot.style.display = 'none';
  if (mydesc.style.display == '') {
    mydesc.style.display = 'none'; 
  } else {
    mydesc.style.display = ''; 
  }
}

if (theone == 'onseshoot_') {
  myimg.style.display = 'none';
  mydesc.style.display = 'none';
  if (myoneshoot.style.display == '') {
    myoneshoot.style.display = 'none'; 
  } else {
    myoneshoot.style.display = ''; 
  }
}
}

function show_sample(url,cat_lg,cat_type,mm_debut)
{
	var left = 10;
	var top = 10;
	preview_php=home+"/sample.php?url="+url+"&lg="+cat_lg+"&type="+cat_type+"&MM_debut="+mm_debut;
	preview = window.open(preview_php,"preview","statutbar=no,width=400,height=450,resizable=1,scrollbars=1,left="+left+",top="+top);
	if (preview && preview.focus) { preview.focus(); }
	preview.document.close();
}

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];}}

}
