
function mootools_toggle_archives() {
	Fx.Morph = Fx.Styles.extend({
	 
		start: function(className){
	 
			var to = {};
	 
			$each(document.styleSheets, function(style){
				var rules = style.rules || style.cssRules;
				$each(rules, function(rule){
					if (!rule.selectorText.test('\.' + className + '$')) return;
					Fx.CSS.Styles.each(function(style){
						if (!rule.style || !rule.style[style]) return;
						var ruleStyle = rule.style[style];
						to[style] = (style.test(/color/i) && ruleStyle.test(/^rgb/)) ? ruleStyle.rgbToHex() : ruleStyle;
					});
				});
			});
			return this.parent(to);
		}
	 
	});
	 
	Fx.CSS.Styles = ["backgroundColor", "backgroundPosition", "color", "width", "height", "left", "top", "bottom", "right", "fontSize", "letterSpacing", "lineHeight", "textIndent", "opacity"];
	 
	Fx.CSS.Styles.extend(Element.Styles.padding);
	Fx.CSS.Styles.extend(Element.Styles.margin);
	 
	Element.Styles.border.each(function(border){
		['Width', 'Color'].each(function(property){
			Fx.CSS.Styles.push(border + property);
		});
	});
	 
	var myMorph = new Fx.Morph('morpher', {wait: false});
	 
	$('MootoolsToggleMorph').addEvent('click', function(e){
	if( document.getElementById('morpher').style.height == "" || document.getElementById('morpher').style.height == "0px" ) {
		new Event(e).stop();
		myMorph.start('morph2');
	} else {
		new Event(e).stop();
		myMorph.start('morph1'); 
	}
	});	
}



function make_addr() {
	var args=make_addr.arguments;
	var a,b,c,d,e
	a='<a href=\"&#109;&#97;&#105;'
	b=args[0]
	c='\">'
	a+='&#108;&#116;&#111;&#58;'
	b+='&#064;'
	e='</a>'
	b+=args[1]
	d=b
	return(a+b+c+d+e)
}



function hide_all_highlights(){
	for (var i=1; i<=5; i++) {		
		document.getElementById("team"+i).className='highlight2';
	}
}



function hide_all_bg(){
	for (var i=1; i<=5; i++) {		
		document.getElementById('service_'+i).style.background='url("")';
	}
}



// Preload images
function preloadImages() {
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}


// Hide all divs with the name : nom
function HideAllElementsNamed(nom){
  var NumDiv = 1;
  while (document.getElementById(nom+NumDiv)){
	  document.getElementById(nom+NumDiv).style.display = "none";
	  NumDiv++;
  }
}


// Show the specified element
function ShowThisElement(id) {
	if( document.getElementById(id).style.display == "block" ) {
	document.getElementById(id).style.display = "none";
	} else {
	document.getElementById(id).style.display = "block"; }	
}


// Display today's date
function get_date(format) {
	navvers = navigator.appVersion.substring(0,1);
	if (navvers > 3) navok = true;
	else navok = false;
	today = new Date;
	mois = today.getMonth();

	jour = today.getDay();
	numero = today.getDate();
	if (navok) annee = today.getFullYear();
	else annee = today.getYear();

	if (format=='default') {
		if (numero==1) numero = numero+"st";
		else if (numero==2) numero = numero+"nd";
		else if (numero==3) numero = numero+"rd";
		else if (numero==21) numero = numero+"st";
		else if (numero==22) numero = numero+"nd";
		else if (numero==23) numero = numero+"rd";
		else if (numero==31) numero = numero+"st";
		else numero = numero+"th";
		TabJour = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
		TabMois = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
		messageDate = TabMois[mois] + " " + numero + ", " + annee;
		document.write(messageDate)
	}
	else if (format=='db') {
		TabMois = new Array("01","02","03","04","05","06","07","08","09","10","11","12");
		if (numero<10) numero = "0"+numero;
		messageDate = annee + "-" + TabMois[mois] + "-" + numero;
		document.write(messageDate)
	}
}

// Open a customizable popup window
function popup(url) {
	properties = "top=0,left=0,resizable=yes, toolbar=no, scrollbars=yes, menubar=no, location=no, statusbar=no"
	properties += ",width=" + screen.width + ",height=" + screen.height;
	win = window.open(url,'',properties);
}

