
			
			function openWin(id){
				w = window.open('pages/evenement.php?id='+id,'event'+id,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=700,height=300');
			}
 
 
		function windowOpen(window_url)
		{
		   helpWin = window.open(window_url,'','toolbar=no,status=no,scrollbars=yes,menubar=no,resizable=yes,directories=no,location=no,width=450,height=500');
		   if (document.images)
		   { 
			   if (helpWin) helpWin.focus()
		   }
		}
 
			function limite(textarea, max)
			{
			    if(textarea.value.length >= max)
			    {
			        textarea.value = textarea.value.substring(0,max);
			    }
			    var reste = max - textarea.value.length;
			    var affichage_reste =  reste +' caractères restants';
			    document.getElementById('max_desc').innerHTML = affichage_reste;
			}
 
	
 
	function openWindow(mapage,width,height) 
{
        x = (640 - width)/2, y = (480 - height)/2;
        
		if (screen) 
		{
			y = (screen.availHeight - height)/2;
			x = (screen.availWidth - width)/2;
        }
		
        if (screen.availWidth > 1800) 
		{
			x = ((screen.availWidth/2) - width)/2;
        }
		
        window.open(mapage,'','scrollbars=yes,resizable="yes",width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
}
  
      preload = function (o, img_src, w, h) {
        var img = new Image ();
        img.onload = function () {
          o.onload = null;
          if (w) o.width  = w;
          if (h) o.height = h;
          o.src = img.src
        };
        img.src = img_src;
      }
			function fixPNG() {
	if(navigator.appName == 'Microsoft Internet Explorer') {
		var png = /\.png$/i;
		var imgs = document.getElementsByTagName('img');
		for(var i = 0, l = imgs.length; i < l; i++) {
			if(png.test(imgs.item(i).src)) {
				imgs.item(i).style.width = imgs.item(i).offsetWidth;
				imgs.item(i).style.height = imgs.item(i).offsetHeight;
				imgs.item(i).style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + imgs.item(i).src + '\',sizingMethod=\'image\')';
				imgs.item(i).src = 'IMAGE/empty.gif';
			}
		}
	}
}

