function showhide(astrid) {
	if(document.getElementById(astrid).style.display == 'none') {
		document.getElementById(astrid).style.display = 'block';
	}
	else {
		document.getElementById(astrid).style.display = 'none';
	}
}

function dernierephoto(aintid) {
	for(i=1;i<=5;i++) {
		document.getElementById('derphoto' + i).style.display = 'none';
		document.getElementById('btderphoto' + i).className = 'btderphotooff';

	}
	document.getElementById('derphoto' + aintid).style.display = 'block';
	document.getElementById('btderphoto' + aintid).className = 'btderphotoon';
}

function validelogin()  {
	var strqs = document.location.search;
	var regexlog1 = new RegExp('loginerr=1','i');
	var regexlog2 = new RegExp('loginerr=2','i');
	var regexlgen = new RegExp('langue=fr','i');
	// inversion de la condition pour contrer l'affichage par defaut en français
	if(regexlgen.exec(strqs)) {
		if(regexlog1.exec(strqs)) {
			alert('Usager inexistant.');
		}
		if(regexlog2.exec(strqs)) {
			alert('Combinaison usager et mot de passe invalide.');
		}
	}
	else {
		if(regexlog1.exec(strqs)) {
			alert('The Username you specified is not found');
		}
		if(regexlog2.exec(strqs)) {
			alert('Invalide Username, Password combinaison');
		}
	}

	//switch()
}

function init() {
    // quit if this function has already been called
    if (arguments.callee.done) return;

    // flag this function so we don't do the same thing twice
    arguments.callee.done = true;

    // do stuff
	dernierephoto(1);
	validelogin();
}
   /* for Mozilla */
   if (document.addEventListener) {
       document.addEventListener("DOMContentLoaded", init, false);
   }

   /* for Internet Explorer */
   /*@cc_on @*/
   /*@if (@_win32)
       document.write("<script defer src=ie_onload.js><"+"/script>");
   /*@end @*/

   /* for other browsers */
	window.onload = init;

