// Affichage de la date et de l heure
var now = new Date();

var days = new Array('Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi');
var months = new Array('janvier','Fevrier','Mars','Avril','Mai','Juin','Juillet','Ao&ucirc;t','Septembre','Octobre','Novembre','D&eacute;cembre');
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
var hour = now.getHours();
var minute = now.getMinutes();

if (minute < 10) { minute = "0" + minute }

datedujour =  days[now.getDay()] + " " + date + " " + months[now.getMonth()] + " - " + hour + ":" + minute;


// Fenetre popup

function popup(fichier,nom,w,h)
{
	lechoix=window.open(fichier,nom ,'width='+w+',height='+h+',toolbar=no,scrollbars=no,resizable=no');
}



function IE_CorrectAlpha_PNG()
{ 
	for(i=0; i<document.images.length; i++){ 
		img    = document.images[i]; 
		imgExt  = img.src.substring(img.src.length-3, img.src.length); 
		imgExt  = imgExt.toUpperCase();
		if (imgExt == "PNG")
		{
			imgID    = (img.id) ? "id='" + img.id + "' " : "";
			imgClass= (img.className) ? "class='" + img.className + "' " : "";
			imgTitle= (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
			imgStyle= "display:inline-block;" + img.style.cssText;
			
			if (img.align == "left") {
				imgStyle = "float:left;"  + imgStyle; 
			} else if (img.align == "right"){
				imgStyle = "float:right;" + imgStyle; 
			}
	
			if (img.parentElement.href) {
				imgStyle = "cursor:hand;" + imgStyle;
			}

			strNewHTML    = '<span '+imgID+imgClass+imgTitle+' style="width:'+
			img.width+'px; height:'+img.height+'px;'+imgStyle+';'+'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+img.src+'\', sizingMethod=\'scale\');"></span>'; 
		
			img.outerHTML = strNewHTML; 
			i = i-1; 
		}
	}
} 
window.attachEvent("onload", IE_CorrectAlpha_PNG); 



//
// Gestion de l'apparition disparition de morceau de page
//

function basculer(nb_fen) 
{
	id_cible = "fen" + nb_fen;
    	
    	cible = document.getElementById(id_cible);

    	if (cible.style.display == "none")
    	{
    		cible.style.display="";
    	} 
    	else 
    	{
		cible.style.display="none";
    	}

}

function switchThumb(obj, w, h, mg, z) {
	document.getElementById('t'+obj).style.width = w+'px';
	document.getElementById('t'+obj).style.height = h+'px';
	document.getElementById('t'+obj).style.margin = mg;
	document.getElementById('t'+obj).zIndex = z;
	document.getElementById('t'+obj).style.zIndex = z;
}

function loadIMGContent(imgFile, urlFile, divID) {
	document.getElementById(divID).innerHTML = '<a href="'+urlFile+'" target="_blank" title="Cliquez pour agrandir"><img src="'+imgFile+'" /></a>';
}

function loadSWFContent(swfFile, w , h, bgcolor, fvar, noSwf) {
	if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {
		var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
		if(hasRightVersion) {  // if we've detected an acceptable version
			AC_FL_RunContent(
				'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,24,0',
				'width', w,
				'height', h,
				'align', 'TL',
				'src', swfFile,
				'quality', 'high',
				'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
				'scale', 'noScale',
				'wmode', bgcolor,
				'menu', 'false',
				'allowScriptAccess','Always',
				'movie', swfFile,
				'flashvars', fvar
				); //end AC code
		} else {  // flash is too old or we can't detect the plugin
			  document.write(noSwf);
		}
		
		objects = document.getElementsByTagName("object");
		for (var i = 0; i < objects.length; i++)
		{
			objects[i].focus();
		}

	}
}