/* ***** BEGIN LICENSE BLOCK *****
 * This file is part of DotClear.
 * Copyright (c) 2004 Olivier Meunier and contributors. All rights
 * reserved.
 *
 * DotClear is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * DotClear is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with DotClear; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * ***** END LICENSE BLOCK ***** */

function open_ext_link()
{
	var liens = document.getElementsByTagName('a');
	// On récupère tous les liens (<a>) du document dans une variable (un array), ici liens.
	// Une boucle qui parcourt le tableau (array) liens du début à la fin.
	for (var i = 0 ; i < liens.length ; ++i)  {
		// Si les liens ont un nom de class égal à lien_ext, alors on agit.
		if (liens[i].className == 'lien_ext')  {
			liens[i].title = 'S\'ouvre dans une nouvelle fenêtre';
			// Au clique de la souris.
			liens[i].onclick = function()  {
				window.open(this.href);
				return false; // On ouvre une nouvelle page ayant pour URL le href du lien cliqué et on inhibe le lien réel.
			};
		}
	}
}
window.onload = open_ext_link;
// Au chargement de la page, on appelle la fonction.
function openwindow(){
if(document.all){
	agent ="ie5";
	horizoffset = 0;
	vertoffset = 0;
} else if(document.getElementById){
	agent="mozilla";
	horizoffset = 2;
	vertoffset = 1;
}
	var bw = (screen.availWidth/2)-460;
	var bh = (screen.availHeight/2)-360;
	window.open("/dotclear/audios/index.php?autoplay=1","my_new_window","toolbar=no,location=no,margin=0,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=222,height=300,border=0,screenX="+bw+",left="+bw+",screenY="+bh+",top="+bh+"");
}
