/* SWF Create */
if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){if(!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){_16.push(key+"="+_18[key]);}
return _16;},getSWFHTML:function(){var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";
}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}
return _19;
},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();return true;
}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
return false;}};
deconcept.SWFObjectUtil.getPlayerVersion=function(){
var _23=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}
catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}
catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}
catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}
return _23;};
deconcept.PlayerVersion=function(_27){
this.major=_27[0]!=null?parseInt(_27[0]):0;
this.minor=_27[1]!=null?parseInt(_27[1]):0;
this.rev=_27[2]!=null?parseInt(_27[2]):0;
};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){
return false;
}return true;};
deconcept.util={getRequestParameter:function(_29){
var q=document.location.search||document.location.hash;
if(q){var _2b=q.substring(1).split("&");
for(var i=0;i<_2b.length;i++){
if(_2b[i].substring(0,_2b[i].indexOf("="))==_29){
return _2b[i].substring((_2b[i].indexOf("=")+1));}}}
return "";}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){if(window.opera||!document.all){return;}
var _2d=document.getElementsByTagName("OBJECT");
for(var i=0;i<_2d.length;i++){_2d[i].style.display="none";for(var x in _2d[i]){
if(typeof _2d[i][x]=="function"){_2d[i][x]=function(){};}}}};
deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};
__flash_savedUnloadHandler=function(){};
if(typeof window.onunload=="function"){
var _30=window.onunload;
window.onunload=function(){
deconcept.SWFObjectUtil.cleanupSWFs();_30();};
}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}};
if(typeof window.onbeforeunload=="function"){
var oldBeforeUnload=window.onbeforeunload;
window.onbeforeunload=function(){
deconcept.SWFObjectUtil.prepUnload();
oldBeforeUnload();};
}else{window.onbeforeunload=deconcept.SWFObjectUtil.prepUnload;}
if(Array.prototype.push==null){
Array.prototype.push=function(_31){
this[this.length]=_31;
return this.length;};}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject;
var SWFObject=deconcept.SWFObject;

/* Coloration input */
function toggleColor(objElement)
		{
		  if (objElement.className=='normal')
			objElement.className='focus';
		  else
			objElement.className='normal';
		}
function popup(url,largeur,hauteur) {
	window.open(url,'','width='+largeur+' height='+hauteur+' scrollbars=yes');	
}


//
// $()
//	Permet de récupérer un ou plusieurs éléments à partir de leur id.
//
function $(element)
{
	if (arguments.length > 1)
	{
		var elements = [];
		
		for (var i = 0; i < arguments.length; i++)
			elements.push($(arguments[i]));
		
		return elements;
	}
	
	if (typeof element == 'string')
		element = document.getElementById(element);
	
	return Element.extend(element);
}

//
// $F()
//	Permet de lire un élément de formulaire.
//
function $F(element)
{
	return $(element).value;
}

//
// $A()
//	Permet de transformer un élément en tableau.
//
function $A(iterable)
{
	if (!iterable)
		return [];
	
	var results = [];
	
	for (var i = 0, length = iterable.length; i < length; i++)
		results.push(iterable[i]);
	
	return results;
}

//
// functionObj.bind()
//	Bind un objet dans une fonction.
//
Function.prototype.bind = function()
{
	var __method = this, args = $A(arguments), object = args.shift();
	
	return function()
	{
		return __method.apply(object, args.concat($A(arguments)));
	}
}

//
// Object.extend()
//	Permet d'étendre un objet par un autre.
//
Object.extend = function(destination, source)
{
	for (var property in source)
		destination[property] = source[property];

	return destination;
}

//
//
// Object
//	Etend l'objet Object afin d'y intégrer de nouvelles fonctionnalités.
//
//	Note: Ne pas étendre Object.prototype afin d'éviter les conflits avec
//	      toQueryString()
//
//
Object.extend(Object,
{
	//
	// clone()
	//	Dupplique un objet.
	//
	clone: function(object)
	{
		return Object.extend({}, object);
	},
	
	//
	// toQueryString()
	//	Permet d'étendre un objet par un autre.
	//
	toQueryString: function(object)
	{
		var parts = [];
		
		for (var property in object)
		{
			if (object[property])
			{
				var key = property;
				var val = object[property];
				
				if (val)
					parts.push(encodeURIComponent(key) + '=' + encodeURIComponent(val));
			}
		}
	
		return parts.join('&');
	}
});

//
//
// String.prototype
//	Etend l'objet String afin d'y intégrer de nouvelles fonctionnalités.
//
//
Object.extend(String.prototype,
{
	//
	// trim()
	//	Supprime les espaces superflux en début et fin de chaine.
	//
	trim: function()
	{
		return this.replace(/^\s+/, '').replace(/\s+$/, '');
	},
	
	//
	// include()
	//	Détermine si un caractère est présent dans une chaîne.
	//
	include: function(pattern)
	{
		return this.indexOf(pattern) > -1;
	},

	//
	// startsWith()
	//	Détermine si la chaîne commence par pattern.
	//
	startsWith: function(pattern)
	{
		return this.indexOf(pattern) == 0;
	},

	//
	// endsWith()
	//	Détermine si la chaîne se termine par pattern.
	//
	endsWith: function(pattern)
	{
		return this.lastIndexOf(pattern) == (this.length - pattern.length);
	},

	//
	// empty()
	//	Détermine si la chaîne est vide.
	//
	empty: function()
	{
		return this == '';
	},
	
	//
	// blank()
	//	Détermine si la chaîne est vide ou ne contient que des espaces.
	//
	blank: function()
	{
		return /^\s*$/.test(this);
	},
	
	toArray: function()
	{
		return this.split('');
	},

	toInt: function()
	{
		return parseInt(this);
	}
});

//
//
// Event
//	Etend l'objet Event
//
//	Note: Si Event n'est pas défini, on le redéfinit.
//
//
if (! window.Event)
{
	var Event = new Object();
}

Object.extend(Event,
{
	//
	// observers
	//	Observeurs d'événements.
	//
	observers: false,
	
	//
	// observe
	//	Ajoute un observeur d'événement à l'élément donné.
	//
	observe: function(element, name, observer, useCapture)
	{
		element = $(element);
		useCapture = useCapture || false;
		
		if (! this.observers)
			this.observers = [];
		
		if (element.addEventListener)
		{
			this.observers.push([element, name, observer, useCapture]);
			element.addEventListener(name, observer, useCapture);
		}
		else if (element.attachEvent)
		{
			this.observers.push([element, name, observer, useCapture]);
			element.attachEvent('on' + name, observer);
		}
	}
});

//
//
// Element
//	Etend l'objet Element
//
//	Note: Si Element n'est pas défini, on le redéfinit.
//	      Element est l'objet DOM du W3C.
//
//
if (! window.Element)
{
	var Element = {};
}

//
// extend()
//	Etend un objet Element par Element.Methods
//
Element.extend = function(element)
{
	if (! element || element._extended || element == window)
		return element;
	
	var methods = {};
	Object.extend(methods, Element.Methods);
	
	for (var property in methods)
	{
		var value = methods[property];
		
		if (typeof value == 'function' && !(property in element))
			element[property] = Element.extend.cache.add(value);
	}	
	element._extended = true;
	return element;
}

//
// extend.cache
//	Traitement interne de l'élément.
//
Element.extend.cache =
{
	//
	// add()
	//	Processus d'extension.
	//
	add: function(value)
	{
		return this[value] = this[value] || function()
		{
			return value.apply(null, [this].concat($A(arguments)));
		}
	}
}

Element.Methods =
{
	//
	// visible()
	//	Détermine si un élément est visible.
	//
	visible: function(element)
	{
		return $(element).style.display != 'none';
	},
	
	//
	// hide()
	//	Masque un élément donné.
	//
	hide: function(element)
	{
		$(element).style.display = 'none';
		return element;
	},
	
	//
	// show()
	//	Affiche un élément donné.
	//
	show: function(element)
	{
		$(element).style.display = '';
		return element;
	},
	
	//
	// toggle()
	//	Maque un élément donné s'il est visible.
	//	Dans le cas contraire, l'élément est affiché.
	//
	toggle: function(element)
	{
		element = $(element);
		Element[Element.visible(element) ? 'hide' : 'show'](element);
		return element;
	},
	
	//
	// setClassName()
	//	Change la classe d'un élément
	//
	setClassName: function(element, className)
	{
		$(element).className = className;
		return element;
	},
	
	//
	// update()
	//	Met à jour le contenu d'un élément.
	//
	update: function(element, html)
	{
		// Récupération du contenu
		html = typeof html == 'undefined' ? '' : html.toString();
		
		$(element).innerHTML = html;
		return element;
	},
	
	//
	// update()
	//	Ajoute un observeur d'événement.
	//
	observe: function()
	{
		Event.observe.apply(Event, arguments);
		return $A(arguments).first();
	}
}

Object.extend(Element, Element.Methods);

//
//
// Framework
//
//
var SunderFramework =
{
	//
	// version
	//	Version actuelle du framework.
	//
	version: '1.0',
	
	//
	// emptyFunction()
	//	Permet de retourner une fonction vide.
	//
	emptyFunction: function() {}
}

//
//
// Class
//	Initialiseur de classe
//
//
var Class =
{
	//
	// create()
	//	Permet d'ajouter de définir des classes.
	//	La méthode initialize() est appelée lors de l'instanciation.
	//
	create: function()
	{
		return function() { this.initialize.apply(this, arguments); }
	}
}

//
//
// Try
//
//
var Try =
{
	//
	// these()
	//	Permet de tester un ensemble de commandes.
	//
	these: function()
	{
		var returnValue;
		
		for (var i = 0, length = arguments.length; i < length; i++)
		{
			var lambda = arguments[i];
			
			try
			{
				returnValue = lambda();
				break;
			}
			catch (e) {}
		}
		
		return returnValue;
	}
}

//
//
// Ajax
//
//
var Ajax =
{
	//
	// getTransport()
	//	Retourne un object XHR.
	//
	getTransport: function()
	{
		return false || Try.these
		(
		 	function() { return new XMLHttpRequest() },
			function() { return new ActiveXObject('Msxml2.XMLHTTP') },
			function() { return new ActiveXObject('Microsoft.XMLHTTP') }
		);
	}
}

Ajax.Request = Class.create();
Ajax.Request.Events = ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];

Ajax.Request.prototype =
{
	//
	// _transport
	//	Objet XHR.
	//
	_transport: {},
	
	//
	// _options
	//	Options de configuration de l'objet XHR.
	//
	_options: {},
	
	//
	// _url
	//	Adresse cible.
	//
	_url: '',
	
	//
	// _method
	//	Méthode de la requète.
	//
	_method: '',
	
	//
	// _body
	//	Données envoyées.
	//
	_body: '',
	
	//
	// initialize()
	//	Constructeur.
	//
	initialize: function(url, options)
	{
		this._transport = Ajax.getTransport();
		
		this.setOptions(options);
		this.request(url);
	},
	
	//
	// setOptions()
	//	Configure l'objet XHR.
	//
	setOptions: function(options)
	{
		this._options =
		{
			method:			'post',
			contentType:	'application/x-www-form-urlencoded',
			encoding:		'UTF-8',
			parameters:		''
		}
		
		// Etend this._options par options
		Object.extend(this._options, options || {});
		
		// Uniformise la casse de l'option method
		this._options.method = this._options.method.toLowerCase();
	},
	
	//
	// request()
	//	Envoie une requète à l'adresse donnée.
	//
	request: function(url)
	{
		this._url = url;
		this._method = this._options.method.toUpperCase();
		
		var params = Object.clone(this._options.parameters);
		
		if (params = Object.toQueryString(params))
		{
			if (this._method == 'GET')
				this._url += (this._url.include('?') ? '&' : '?') + params;
			
			else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent))
				params += '&_=';
		}
		
		try
		{
			// Contenu de la requète
			this._body = this._method == 'post' ? (this._options.postBody || params) : null;

			this._transport.onreadystatechange = this._onStateChange.bind(this);
			this._transport.open(this._method, this._url);
			
			// Headers
			this._setRequestHeaders();
			
			// Envoi de la requète
			this._transport.send(this._body);
		}
		catch (e)
		{
			this.dispatchException(e);
		}
	},
	
	//
	// dispatchException()
	//	Affiche une exception.
	//
	dispatchException: function(e)
	{
		alert(e);
	},
	
	//
	// PRIVATE
	//
	// _onStateChange()
	//	Détermine le statut de la connexion XHR.
	//
	_onStateChange: function()
	{
		var transport = this._transport;
		var readyState = this._transport.readyState;

		var state = Ajax.Request.Events[readyState];
		//var status = this._transport.status;
		
		if (state == 'Complete')
			this._respondToReadyState();
	},
	
	//
	// PRIVATE
	//
	// _success()
	//	Détermine le statut de la connexion XHR.
	//
	_success: function()
	{
		return (! this._transport.status) || (this._transport.status >= 200 && this._transport.status < 300);
	},
	
	//
	// PRIVATE
	//
	// _respondToReadyState()
	//	Lance les événements selon le statut de la connexion.
	//
	_respondToReadyState: function()
	{
		var transport = this._transport;
		
		try
		{
			// Nom de la fonction événementielle
			var eventHandler = this._options['on' + this._transport.status]
				|| this._options['on' + (this._success() ? 'Success' : 'Failure')]
				|| SunderFramework.emptyFunction;
			
			// Appel de la fonction
			(eventHandler)(transport);
		}
		catch (e)
		{
			this.dispatchException(e);
		}
		
		// Fix: IE memory
		this._transport.onreadystatechange = SunderFramework.emptyFunction;
	},
	
	//
	// PRIVATE
	//
	// _setRequestHeaders()
	//	Prépare les headers pour la connexion XHR.
	//
	_setRequestHeaders: function()
	{
		var headers =
		{
			'X-Requested-With': 'XMLHttpRequest',
			'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
		};
		
		// Headers supplémentaires pour la méthode POST
		if (this._method == 'post')
		{
			// Encodage (content-type + charset)
			var encoding = this._options.encoding ? '; charset=' + this._options.encoding : '';
			headers['Content-type'] = this._options.contentType + encoding;
			
			// Fix: Anciennes versions de Mozilla
			var userAgentYear = (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1];
			if (this._transport.overrideMimeType && userAgentYear < 2005)
				headers['Connection'] = 'close';
		}
		
		// Envoi des headers
		for (var name in headers)
			this._transport.setRequestHeader(name, headers[name]);
	}
}

//
//
// Validator
//
//
var Validator =
{
	//
	// isValidEmail()
	//	Teste la validité d'une adresse email.
	//
	isValidEmail: function(expression)
	{
		var pattern = '^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]{2,}[.][a-zA-Z]{2,3}$';
		return this.check(pattern, expression);
	},
	
	//
	// testEqual()
	//	Détermine si 2 éléments sont identiques.
	//
	testEqual: function(one, two)
	{
		return one == two;
	},
	
	//
	// check()
	//	Valide une chaine via une expression régulière donnée.
	//
	check: function(pattern, expression)
	{
		var objExpr = new RegExp(pattern);
		return objExpr.exec(expression) != null;
	}
}
/* AJAX */

function ajax_reload(url,id)
{
	var xhr_object = null;
	var position = id;
	   if(window.XMLHttpRequest)  xhr_object = new XMLHttpRequest();
	  else
	    if (window.ActiveXObject)  xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
	// On ouvre la requete vers la page désirée
	xhr_object.open("GET", url, true);

	xhr_object.onreadystatechange = function(){
	if ( xhr_object.readyState == 4 )
	{
		// j'affiche dans la DIV spécifiées le contenu retourné par le fichier
		document.getElementById(position).innerHTML = xhr_object.responseText;
	}
	}
	// dans le cas du get
	xhr_object.send(null);
}

function ajax_reload_post(url,id)
{
	var xhr_object = null;
	var position = id;
	   if(window.XMLHttpRequest)  xhr_object = new XMLHttpRequest();
	  else
	    if (window.ActiveXObject)  xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
	// On ouvre la requete vers la page désirée
	xhr_object.open("POST", url, true);
	

	xhr_object.onreadystatechange = function(){
		if ( xhr_object.readyState == 4 )
		{
			// j'affiche dans la DIV spécifiées le contenu retourné par le fichier
			document.getElementById(position).innerHTML = xhr_object.responseText;
		}
	}
	xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); 
	// dans le cas du get
	xhr_object.send("commentaire="+document.getElementById('commentaire').value);
}

/* Début des fonctions */

	/* Formulaires */

		/* Rechercher */
		function recherche_tags(chaine,baseurl) {
			document.location.href= baseurl+'tags/'+chaine;	
		}
		
		function confirm_action(url,texte) {
			if(confirm(texte)) {
				document.location.href=url;	
			}
		}
		
		/*Afficher les étoiles pour le vote */
		function etoile(nombre,dossier,url1,url2) {
			for(i=1;i<=5;i++) {
				var x = document.getElementById("etoile"+i);
				if(nombre>=i) {
					x.setAttribute("src", dossier+"/"+url1);
				} else {
					x.setAttribute("src", dossier+"/"+url2);	
				}
			}
		}
		
		function etoile_chaine(nombre,dossier,url1,url2) {
			for(i=1;i<=5;i++) {
				var x = document.getElementById("etoile_chaine"+i);
				if(nombre>=i) {
					x.setAttribute("src", dossier+"/"+url1);
				} else {
					x.setAttribute("src", dossier+"/"+url2);	
				}
			}
		}

		/*Montre / Cache des éléments ID*/
		function montrer(id) {
			document.getElementById(id).style.display='block';	
		}
		
		function cacher(id) {
			document.getElementById(id).style.display='none';
		}
		function montre(obj) {
			var div1=document.getElementById(obj);
			div1.style.visibility='visible';
		}
		function cache(obj) {
			var div1=document.getElementById(obj);
			div1.style.visibility='hidden';
		}