//<![CDATA[
	HTML_ENTITY = function( decoded, encoded )
	{
		this.decoded = decoded;
		this.encoded = encoded;
	}
	HTML_ENTITIES = new Array ( new HTML_ENTITY( ' ', '&nbsp;' ), new HTML_ENTITY( '¡', '&iexcl;' ),new HTML_ENTITY( '¢', '&cent;' ),new HTML_ENTITY( '£', '&pound;' ),new HTML_ENTITY( '¤', '&curren;' ),new HTML_ENTITY( '¥', '&yen;' ),new HTML_ENTITY( '¦', '&brvbar;' ),new HTML_ENTITY( '§', '&sect;' ),new HTML_ENTITY( '¨', '&uml;' ),new HTML_ENTITY( '©', '&copy;' ),new HTML_ENTITY( 'ª', '&ordf;' ),new HTML_ENTITY( '«', '&laquo;' ),new HTML_ENTITY( '¬', '&not;' ),new HTML_ENTITY( '­', '&shy;' ),new HTML_ENTITY( '®', '&reg;' ),new HTML_ENTITY( '¯', '&macr;' ),new HTML_ENTITY( '°', '&deg;' ),new HTML_ENTITY( '±', '&plusmn;' ),new HTML_ENTITY( '²', '&sup2;' ),new HTML_ENTITY( '³', '&sup3;' ),new HTML_ENTITY( '´', '&acute;' ),new HTML_ENTITY( 'µ', '&micro;' ),new HTML_ENTITY( '¶', '&para;' ),new HTML_ENTITY( '·', '&middot;' ),new HTML_ENTITY( '¸', '&cedil;' ),new HTML_ENTITY( '¹', '&sup1;' ),new HTML_ENTITY( 'º', '&ordm;' ),new HTML_ENTITY( '»', '&raquo;' ),new HTML_ENTITY( '¼', '&frac14;' ),new HTML_ENTITY( '½', '&frac12;' ),new HTML_ENTITY( '¾', '&frac34;' ),new HTML_ENTITY( '¿', '&iquest;' ),new HTML_ENTITY( '×', '&times;' ),new HTML_ENTITY( '÷', '&divide;' ),new HTML_ENTITY( 'À', '&Agrave;' ),new HTML_ENTITY( 'Á', '&Aacute;' ),new HTML_ENTITY( 'Â', '&Acirc;' ),new HTML_ENTITY( 'Ã', '&Atilde;' ),new HTML_ENTITY( 'Ä', '&Auml;' ),new HTML_ENTITY( 'Å', '&Aring;' ),new HTML_ENTITY( 'Æ', '&AElig;' ),new HTML_ENTITY( 'Ç', '&Ccedil;' ),new HTML_ENTITY( 'È', '&Egrave;' ),new HTML_ENTITY( 'É', '&Eacute;' ),new HTML_ENTITY( 'Ê', '&Ecirc;' ),new HTML_ENTITY( 'Ë', '&Euml;' ),new HTML_ENTITY( 'Ì', '&Igrave;' ),new HTML_ENTITY( 'Í', '&Iacute;' ),new HTML_ENTITY( 'Î', '&Icirc;' ),new HTML_ENTITY( 'Ï', '&Iuml;' ),new HTML_ENTITY( 'Ð', '&ETH;' ),new HTML_ENTITY( 'Ñ', '&Ntilde;' ),new HTML_ENTITY( 'Ò', '&Ograve;' ),new HTML_ENTITY( 'Ó', '&Oacute;' ),new HTML_ENTITY( 'Ô', '&Ocirc;' ),new HTML_ENTITY( 'Õ', '&Otilde;' ),new HTML_ENTITY( 'Ö', '&Ouml;' ),new HTML_ENTITY( 'Ø', '&Oslash;' ),new HTML_ENTITY( 'Ù', '&Ugrave;' ),new HTML_ENTITY( 'Ú', '&Uacute;' ),new HTML_ENTITY( 'Û', '&Ucirc;' ),new HTML_ENTITY( 'Ü', '&Uuml;' ),new HTML_ENTITY( 'Ý', '&Yacute;' ),new HTML_ENTITY( 'Þ', '&THORN;' ),new HTML_ENTITY( 'ß', '&szlig;' ),new HTML_ENTITY( 'à', '&agrave;' ),new HTML_ENTITY( 'á', '&aacute;' ),new HTML_ENTITY( 'â', '&acirc;' ),new HTML_ENTITY( 'ã', '&atilde;' ),new HTML_ENTITY( 'ä', '&auml;' ),new HTML_ENTITY( 'å', '&aring;' ),new HTML_ENTITY( 'æ', '&aelig;' ),new HTML_ENTITY( 'ç', '&ccedil;' ),new HTML_ENTITY( 'è', '&egrave;' ),new HTML_ENTITY( 'é', '&eacute;' ),new HTML_ENTITY( 'ê', '&ecirc;' ),new HTML_ENTITY( 'ë', '&euml;' ),new HTML_ENTITY( 'ì', '&igrave;' ),new HTML_ENTITY( 'í', '&iacute;' ),new HTML_ENTITY( 'î', '&icirc;' ),new HTML_ENTITY( 'ï', '&iuml;' ),new HTML_ENTITY( 'ð', '&eth;' ),new HTML_ENTITY( 'ñ', '&ntilde;' ),new HTML_ENTITY( 'ò', '&ograve;' ),new HTML_ENTITY( 'ó', '&oacute;' ),new HTML_ENTITY( 'ô', '&ocirc;' ),new HTML_ENTITY( 'õ', '&otilde;' ),new HTML_ENTITY( 'ö', '&ouml;' ),new HTML_ENTITY( 'ø', '&oslash;' ),new HTML_ENTITY( 'ù', '&ugrave;' ),new HTML_ENTITY( 'ú', '&uacute;' ),new HTML_ENTITY( 'û', '&ucirc;' ),new HTML_ENTITY( 'ü', '&uuml;' ),new HTML_ENTITY( 'ý', '&yacute;' ),new HTML_ENTITY( 'þ', '&thorn;' ),new HTML_ENTITY( 'ÿ', '&yuml;' ) );
	if (!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];}}
	UserAgentPluginAvailable = function ( pluginame )
	{
		if( navigator.plugins )
		{
			var __pattern = plugin;
			for(var i=0;i<navigator.plugins.length;i++){
				var pluginName = navigator.plugins[i].name;
				if(preg_match(__pattern,pluginName,'gi')){return true;}
			}
			return false;
		}
		else
		{
			return false;
		}	
	}
	in_array = function ( value,array )
	{
		var found = false;
		for(var i=0;i<array.length;i++)
		{
			(value==array[i])? found=true : null;
		}
		return found;
	}
	isset = function ( varname )
	{
		var returned = true;
		( typeof( varname ) == "undefined" )? returned=false : null;
		( varname==null )? returned=false : null;
		return returned;
	}
	empty = function ( str )
	{
		var returned = false;
		(str=='')? returned=true : null;
		(str=="")? returned=true : null;
		return returned;
	}
	preg_exec = function ( pattern, str, flags )
	{
		((flags))? '' : flags = 'gi';
		var __pattern = new RegExp(pattern,flags);
		return __pattern.exec(str);
	}	
	preg_match = function (pattern,str,flags)
	{
		((flags))? '' : flags = 'gi';
		var __pattern = new RegExp(pattern,flags);
		if(__pattern.test(str)==true)
		{
			return true;
		}
		else{return false;}
	}	
	preg_replace = function (pattern,replacement,str)
	{
		return str.replace(pattern,replacement);
	}
	htmlentities_encode = function ( str )
	{
		for( var i=0; i<HTML_ENTITIES.length; i++ )
		{
			var entity = HTML_ENTITIES[ i ];
			var pattern = new RegExp( entity.decoded, 'g' );
			if( pattern.test( str ) == true )
			{ 
				str = str.replace( pattern , entity.encoded );
			}
		}
		return str;
	}
	htmlentities_decode = function ( str )
	{
		for( var i=0; i<HTML_ENTITIES.length; i++ )
		{
			var entity = HTML_ENTITIES[ i ];
			var pattern = new RegExp( entity.encoded, 'g' );
			if( pattern.test( str ) == true )
			{ 
				str = str.replace( pattern , entity.decoded );
			}
		}
		return str;
	}
	utf8_encode = function (string) 
	{
		string = string.replace(/\r\n/g,"\n");
		var utftext = "";			
		for (var n = 0; n < string.length; n++) {				
			var c = string.charCodeAt(n);				
			if (c < 128) {
				utftext += String.fromCharCode(c);
			}
			else if((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			}
			else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}				
		}			
		return utftext;
	}	
	utf8_decode = function (utftext) 
	{
		var string = "";
		var i = 0;
		var c = c1 = c2 = 0;			
		while ( i < utftext.length ) {				
			c = utftext.charCodeAt(i);				
			if (c < 128) {
				string += String.fromCharCode(c);
				i++;
			}
			else if((c > 191) && (c < 224)) {
				c2 = utftext.charCodeAt(i+1);
				string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
				i += 2;
			}
			else {
				c2 = utftext.charCodeAt(i+1);
				c3 = utftext.charCodeAt(i+2);
				string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
				i += 3;
			}				
		}			
		return string;
	}
	var $_SERVER = new Array();
	$_SERVER['HTTP_HOST'] = ((typeof(document.domain)!=='undefined')? document.domain : 'undefined');
	$_SERVER['REQUEST_URI'] = ((typeof(window.location)!=='undefined')? window.location : 'undefined');
	var $_USER_AGENT = ((typeof(navigator.userAgent)!=='undefined')? navigator.userAgent : 'undefined');
	var $_USER_AGENT_LANGUAGE = ((typeof(navigator.language)!=='undefined')? navigator.language : 'undefined');
	var $_USER_AGENT_NAME = ((typeof(navigator.appName)!=='undefined')? navigator.appName : 'undefined');
	var $_USER_AGENT_CODENAME = ((typeof(navigator.appCodeName)!=='undefined')? navigator.appCodeName : 'undefined');
	var $_USER_AGENT_VERSION = ((typeof(navigator.appVersion)!=='undefined')? navigator.appVersion : 'undefined');
	var $_USER_SYSTEM = ((typeof(navigator.platform)!=='undefined')? navigator.platform : 'undefined');
	var $_USER_COOKIES_ENABLED = ((typeof(navigator.cookieEnabled)!=='undefined')? navigator.cookieEnabled : 'undefined');
	var $_USER_AGENT_PLUGINS = ((typeof(navigator.plugins)!=='undefined')? navigator.plugins : 'undefined');
	var $_USER_JAVA_ENABLED = ((typeof(navigator.javaEnabled)!=='undefined')? $_USER_JAVA_ENABLED=navigator.javaEnabled() : 'undefined');
	var WIDTH = (typeof(window.outerWidth)!=='undefined')? window.outerWidth : screen.availWidth;
	var HEIGHT = (typeof(window.outerHeight)!=='undefined')? window.outerHeight : screen.availHeight;
	getCookie = function( name ) 
	{
		var start = document.cookie.indexOf( name + "=" );
		var len = start + name.length + 1;
		if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {
			return null;
		}
		if ( start == -1 ) return null;
		var end = document.cookie.indexOf( ';', len );
		if ( end == -1 ) end = document.cookie.length;
		return unescape( document.cookie.substring( len, end ) );
	}
	setCookie = function ( name, value, domain, expires, path, secure ) 
	{
		var today = new Date();
		today.setTime( today.getTime() );
		if ( expires ) 
		{
			expires = expires * 1000 * 60 * 60 * 24;
		}
		var expires_date = new Date( today.getTime() + (expires) );
		document.cookie = name+'='+escape( value ) +
			( ( expires ) ? ';expires='+expires_date.toGMTString() : '' ) + //expires.toGMTString()
			( ( path ) ? ';path=' + path : '' ) +
			( ( domain ) ? ';domain=' + domain : '' ) +
			( ( secure ) ? ';secure' : '' );
	}
	deleteCookie = function ( name, domain, path ){ if ( getCookie( name ) ) document.cookie = name + '=' + ( ( path ) ? ';path=' + path : '') + ( ( domain ) ? ';domain=' + domain : '' ) + ';expires=Thu, 01-Jan-1970 00:00:01 GMT'; }
	var PopUp = function ( url, title, width, height, extendedparams )
	{
		( typeof( title ) == 'undefined' )? title = 'PopUp' : null;
		( typeof( width ) == 'undefined' )? width = window.outerWidth : null;
		( typeof( height ) == 'undefined' )? height = window.outerHeight : null;
		return ( ( extendedparams ) )? window.open(url,title,"width="+width+",height="+height+","+extendedparams) : window.open(url,title);
	}
	PopTo = function ( url, width, height )
	{
		var left = ( 15 * ( (typeof(window.outerWidth)!=='undefined')? window.outerWidth : screen.availWidth ) / 100 );
		var top = ( 10 * ( (typeof(window.outerHeight)!=='undefined')? window.outerHeight : screen.availHeight ) / 100 );
		( typeof( width ) == 'undefined' )? width = ( ( (typeof(window.outerWidth)!=='undefined')? window.outerWidth : screen.availWidth ) / 1.5 ) + 'px' : null;
		( typeof( height ) == 'undefined' )? height = ( ( (typeof(window.outerHeight)!=='undefined')? window.outerHeight : screen.availHeight ) / 1.5 ) + 'px' : null;
		( !preg_match('px$', width ) )? width += 'px' : null;
		( !preg_match('px$', height ) )? height += 'px' : null;
		PopUpMenu = new PopUp( url, '', width, height, 'location=no,dependent=yes,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,left='+left+',top='+top );
	}
	var XMLHttpObject = function( )
	{
		if( window.XMLHttpRequest )
		{
			return new XMLHttpRequest();
		}
		else if( window.ActiveXObject )
		{
			var _XMLHttpObject = null;
			try 
			{
				_XMLHttpObject = new ActiveXObject( "Msxml2.XMLHTTP" );
			}
			catch (e) 
			{
				try 
				{
					_XMLHttpObject = new ActiveXObject( "Microsoft.XMLHTTP" );
				}
				catch (e1) 
				{
					_XMLHttpObject = null;
				}
			}
			return _XMLHttpObject;
		}
		else 
		{
			alert( "Votre navigateur ne supporte pas les objets XMLHTTPRequest..." );
			return null;
		}
	};
	var Ajax = new function( )
	{
		this.GetXml = function ( Url, ResultHandler )
		{
			var Object = new XMLHttpObject( );
			if( Object !== null )
			{
				if( window.XMLHttpRequest && document.createEvent )
				{
					Object.overrideMimeType( 'application/xml' );
				}
				if( Object && Object.readyState != 0 )
				{
					Object.abort();
				}
				if( Object ) 
				{
					Object.open( "GET", Url, true );
					
					Object.onreadystatechange = function ( )
					{
						if ( Object.readyState == 4 && Object.responseXML )
						{
							if( typeof( ResultHandler ) == 'function' )
							{
								ResultHandler( Object.responseXML );
							}	
							Object.abort();
						}
					}
					Object.send( null );
				}
			}
		};
		this.GetHtml = function ( Url, ResultHandler )
		{
			var Object = new XMLHttpObject( );
			if( Object !== null )
			{
				if( window.XMLHttpRequest && document.createEvent )
				{
					Object.overrideMimeType( 'text/html' );
				}
				if( Object && Object.readyState != 0 )
				{
					Object.abort();
				}
				if( Object ) 
				{
					Object.open( "GET", Url, true );
					
					Object.onreadystatechange = function ( )
					{
						if ( Object.readyState == 4 && Object.responseText )
						{
							if( typeof( ResultHandler ) == 'function' )
							{
								ResultHandler( Object.responseText );
							}
							Object.abort();
						}
					}
					Object.send( null );
				}
			}
		};
		this.Post = function ( Url, Data, ResultHandler )
		{
			var Object = new XMLHttpObject( );
			if( Object !== null )
			{
				if( Object && Object.readyState != 0 )
				{
					Object.abort();
				}
				if( Object ) 
				{
					Object.open( "POST", Url, true );
					Object.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded" );
					Object.onreadystatechange = function ( )
					{
						if ( Object.readyState == 4 && Object.responseText )
						{
							if( typeof( ResultHandler ) == 'function' )
							{
								ResultHandler( Object.responseText );
							}
							Object.abort();
						}
					}
					Object.send( Data );
				}
			}
		};
	};
	DisallowPaste = function(event)
	{
		if( ( event.ctrlKey ) && ( event.ctrlKey == true ) )
		{
			/*
			var target = ( event.target )? event.target : event.srcElement;
			//	alert( target );
			if( target.getAttribute( 'class' ) || target.getAttribute( 'className' ) )
			{
				var className = ( target.getAttribute( 'class' ) )? target.getAttribute( 'class' ) : target.getAttribute( 'className' );
				alert( className );
			}
			*/
			var key = null;
			if( document.createEvent ) // netscape
			{
				( typeof( event.which ) !== "undefined" )? key = parseInt(event.which) : null;
			}
			else if(document.createEventObject) // msie
			{
				( typeof( event.keyCode ) !== "undefined" )? key = parseInt(event.keyCode) : null;
			}
			if ( key == 86 )
			{
				return false;
			}	
			else
			{
				return true;
			}
		}
	}
	isMouseEvent = function (event)
	{
		result = false;
		MouseEvents = new Array('click','dblclick','mouseup','mousedown','mousemove','mouseover','mouseout');
		for(var i=0;i<MouseEvents.length;i++)
		{
			if(event==MouseEvents[i])
			{
				result = true;
			}
		}
		return result;
	}
	var Event = function (type)
	{
		var evt = null;
		if(document.createEvent) // mozilla family
		{
			if(isMouseEvent(type)==true)
			{
				evt = document.createEvent("MouseEvents");
				evt.initMouseEvent("click", true, true, window,0, 0, 0, 0, 0, false, false, false, false, 0, null);
			}
			else
			{
				evt = document.createEvent("UIEvents");
				evt.initUIEvent(type,true,true,window,1);
			}
		}	
		else if(document.createEventObject)	//	msie
		{
			evt = document.createEventObject();
			evt.expando = "from_inner";
			evt.target = evt.srcElement;
			evt.type = type;
		}	
		return evt;
	}
	DispatchEvent = function (elm,event)
	{
		(typeof(elm)!=='object'&&document.getElementById(elm)==null)? alert('Error DispatchEvent element id "'+elm+'" not found.') : null;
		(typeof(elm)!=='object'&&document.getElementById(elm)!==null)? elm=document.getElementById(elm) : null;
		if(elm.dispatchEvent) // mozilla
		{
			(typeof(event)!=='object')? elm.dispatchEvent(new Event(event)) : elm.dispatchEvent(event);
		}		
		else if(elm.fireEvent) // msie
		{
			if(typeof(event)!=='object')
			{
				var __pattern = new RegExp('^on.*$','gi');
				(__pattern.test(event)==false)? event = 'on'+event : null;
				elm.fireEvent(event,new Event(event));
			}
			else
			{
				var evtName = event.type;
				var __pattern = new RegExp('^on.*$','gi');
				(__pattern.test(evtName)==false)? evtName = 'on'+evtName : null;
				elm.fireEvent(evtName,event);
			}
		}
		else
		{
			alert('Votre navigateur ne supporte pas les evenements.');	
		}	
		return true;
	}
	AddEventListener = function (elm,event,handler)
	{
		(typeof(elm)!=='object'&&document.getElementById(elm)==null)? alert('Error AddEventListener element id "'+elm+'" not found.') : null;
		(typeof(elm)!=='object'&&document.getElementById(elm)!==null)? elm=document.getElementById(elm) : null;
		if(elm.addEventListener)
		{
			elm.addEventListener(event,handler,false);
		}	
		else if(elm.attachEvent)
		{
			var __pattern = new RegExp('^on.*$','gi');
			(__pattern.test(event)==false)? event = 'on'+event : null;
			elm.attachEvent(event,handler);
		}	
		return true;
	}
	RemoveEventListener = function (elm,event,listener)
	{
		(typeof(elm)!=='object'&&document.getElementById(elm)==null)? alert('Error AddEventListener element id "'+elm+'" not found.') : null;
		(typeof(elm)!=='object'&&document.getElementById(elm)!==null)? elm=document.getElementById(elm) : null;
		if(elm.addEventListener)
		{
			elm.removeEventListener(event,listener,false);
		}	
		else if(elm.attachEvent)
		{
			var __pattern = new RegExp('^on.*$','gi');
			(__pattern.test(event)==false)? event = 'on'+event : null;
			elm.detachEvent(event,listener)
		}	
		return true;
	}
	hex2dec = function ( hexadecimal ) 
	{
		return parseInt( hexadecimal,16 );
	}
	dec2hex = function ( decimal ) 
	{
		var H = new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F");
		var un = Math.floor(dec/16);
		var deux;
		var trois;
		var quatre;
		if ( un > 15 )
		{
			var z = decimal - un*16;
			deux = Math.floor(un/16);
			if ( deux > 15 ) 
			{
				var y = un - deux*16;
				trois = Math.floor(deux/16);
				if ( trois > 15 ) 
				{
					var x = deux - trois*16;
					quatre = Math.floor(trois/16);
					var w = trois - (quatre*16);
					return H[quatre] + H[w] + H[x] + H[y] + H[z];
				}
				else 
				{
					var x = deux - (trois*16);
					return H[trois] + H[x] + H[y] + [z];
				}
			}
			else 
			{
				var y = un - (deux*16);
				return H[deux] + H[y] + [z];
			}
		}
		else 
		{
			var z = dec-(un*16);
			return H[un] + H[z];
		}
	}
	number_format = function( number, decimals, dec_point, thousands_sep ) 
	{
	    var n = number, c = isNaN(decimals = Math.abs(decimals)) ? 2 : decimals;
	    var d = dec_point == undefined ? "." : dec_point;
	    var t = thousands_sep == undefined ? "," : thousands_sep, s = n < 0 ? "-" : "";
	    var i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0;    
		return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
	}
	function addslashes( str )
	{
		return (str+'').replace(/([\\"'])/g, "\\$1").replace(/\0/g, "\\0");
	}
//]]>