function $(t){return document.getElementById(t);}function res(){de=$("bf"); iO=de.offsetTop+de.offsetHeight+45;b=$("body");gg=$("bot");if(iO<b.offsetHeight){de.style['paddingBottom']=((b.offsetHeight-(iO))+20)+'px';gg.style['top']=((b.offsetHeight-(iO))+20+45)+'px';}}function hA(tx){with(tx){hD(tx,1);}}function hB(tx){if(tx!=undefined){hD(tx,0.6);}}function hD(tx,eV){	with(tx){	style['filter']="alpha(opacity="+(eV*100)+");";	style['-moz-opacity']=eV;	style['opacity']=eV;	style['-khtml-opacity']=eV;	}}function hC(tx){	with(tx){		var eX = 1;		if(style['filter']!=undefined){			eX = parseInt(style['filter'].substr(14,3))/100;		}		else if(style['-moz-opacity']!=undefined){			eX = parseInt(style['-moz-opacity']);		}		else if(style['opacity']!=undefined){			eX = parseInt(style['opacity']);		}		else if(style['-khtml-opacity']!=undefined){			eX = parseInt(style['-khtml-opacity']);		}		return isNaN(eX)?1:eX;	}}function iiC(tF,eI,eX,eV,eA){ if(!eX(eA)){	tF(eA);	window.setTimeout(function(){iiC(tF,eI,eX,eV,eA);},eI); }}var eOpList = ['require','email'];function vL(t,eA){	var eOp = null;	if(t==undefined){ return false; }		for(eI in eA){		switch(eA[eI]){			case "require":				if(t.value=="" || t.value=="undefined"){					eOp=eA[eI];				}				break;			case "email":				if(!/^[_a-zA-Z0-9-]+(.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+[.]{1}([a-zA-Z0-9-]{2,6})$/.test(t.value)){					eOp=eA[eI];				}				break;		}	}		if(eOp!=null){		r = $(t.id+'_'+eOp);		fOK($(t.id+'_ok'),0,r);		fFalseb(t);		return false;	}	else {		for(eO in eOpList){			r = $(t.id+'_'+eOpList[eO]);			fFalse(r,0,t);		}		fOKb(t);	}	return true;}function fOK(nm,op,tx){	if(op==1 && nm!=undefined){		nm.style['display']="inline";		hD(nm,0.1);		iiC(function(rc){hD(rc[0],hC(rc[0])*2);},100,function(rc){if(hC(rc[0])==0){hD(rc[0],1);return true;}return hC(rc[0])<1?false:true;},undefined,[nm]);	}	else if(nm!=undefined) {		iiC(function(rc){hD(rc[0],hC(rc[0])*0.2);},100,function(rc){if(hC(rc[0])>0.1){return false}else{rc[0].style['display']="none";fFalse(r,1);return true;}},undefined,[nm]);	}}function fFalse(nm,op,t){	if(op==1 && nm!=undefined){		r.style['display']="inline";		hD(r,0.1);		iiC(function(rc){hD(rc[0],hC(rc[0])*2);},100,function(rc){return hC(rc[0])<1?false:true;},undefined,[nm]);	}	else if(nm!=undefined) {		iiC(function(rc){hD(rc[0],hC(rc[0])*0.2);},100,function(rc){if(hC(rc[0])>0.1){return false}else{rc[0].style['display']="none";fOK($(t.id+'_ok'),1);return true;}},undefined,[nm]);	}}function fFalseb(t){	t.style['border']='1px solid #ff0000';}function fOKb(t){	t.style['border']='1px solid #00cc00';}function sendForm(t){ eT = [t.getElementsByTagName('input'),t.getElementsByTagName('select'),t.getElementsByTagName('textarea')]; sArg={}; for(eH in eT){	for(eX in eT[eH]){		if(eT[eH][eX].name!=undefined){			if(eT[eH][eX].onchange!=undefined){				if(!eT[eH][eX].onchange()){ return false; }			}			sArg+=escape(eT[eH][eX].name)+"="+escape(eT[eH][eX].value)+"&";		}	} } $('fLoad').style['display']= $('fLoade').style['display']='block'; $('fLoad').style['top']=t.offsetTop+'px'; $('fLoad').style['left']=t.offsetLeft+'px'; $('fLoade').style['top']=t.offsetTop+(t.offsetHeight/2)+'px'; $('fLoade').style['left']=t.offsetLeft+(t.offsetWidth/2)+'px'; 		/*var myAjax = new Ajax.Request(			'/fr/bulletin.php', 			{				method: 'post', 				parameters: sArg, 				onComplete: showResponse			});*/			 return true;}function showResponse(s){	$('fLoad').style['display']= $('fLoade').style['display']='none';	eS = s.responseXML.getElementsByTagName('error')	if(eS.item(0)!=undefined){		if(eS.item(0).firstChild.data=="0: [0]"){			$('errorLIST').innerHTML = ''; 			for(i=1;eS.item(i)!=undefined;i++){				$('errorLIST').innerHTML+='<h4>'+eS.item(i).firstChild.data+"</h4><br/>";			}		}		else if(eS.item(0).firstChild.data=="0: [1]"){			$('errorLIST').innerHTML = '<h4>Successful. We will reply as soon as possible.</h4>';		}	}}// *************************function showDateDescr(d) {                 // shows description of the given date on the timeline within notre-parrain.php page (Laurent Bourgnon achievements)                                            // d - date in XXXX format, all descriptions must have id in 'dateXXXX' format  var i, look4dates = document.getElementsByTagName('span');   // get all <span> elements  for(i=0;i<look4dates.length;i++)    if (look4dates[i].className=='date_description') {         // find those of 'date_description' class      look4dates[i].style.display='none';                      // hide all of these    }  date2show = document.getElementById('date'+d);               // and show the description of the date clicked  date2show.style.display='inline';  return false;}function hide(id) {                        // hides element of the given id;  document.getElementById(id).style.display = 'none';}function show(id, displayStyle) {          // shows element of the given id as 'block' or 'inline', as required  document.getElementById(id).style.display = displayStyle;}function switchDisplay(id, displayStyle) {  // switches display - hides visible element or displays hidden one   var element2switch = document.getElementById(id);  if (element2switch.style.display == 'none') {    element2switch.style.display = displayStyle;  } else {    element2switch.style.display = 'none';  }}function getXPos(obj) { var curLeft = 0; if (obj.offsetParent) {  do {    curLeft += obj.offsetLeft;  } while (obj = obj.offsetParent); } return curLeft;}function getYPos(obj) { var curTop = 0; if (obj.offsetParent) {  do {    curTop += obj.offsetTop;  } while (obj = obj.offsetParent); } return curTop;}function showMissions() {    // shows 'Nos missions' submenu  var missionsMenu = document.getElementById('menuitems');  var parent = document.getElementById('missions');  missionsMenu.style.left = (getXPos(parent)+5)+'px';  missionsMenu.style.top = (getYPos(parent)+parent.offsetHeight-3)+'px';  show('menuitems','block');//  alert ('parent x, y: ' + parent.offsetLeft + ',' + parent.offsetTop + 'menu left, top:' + missionsMenu.style.left +','+ missionsMenu.style.top);}function showPrevPhoto(photosQty) {  // shows previous photo from the set of pics var i, photos = new Array(photosQty); for (i=0;i<photosQty;i++) {         // gets all photos - they must have ids in 'photo0', 'photo1'... format   photos[i] = document.getElementById('photo'+i); } for (i=0;i<photosQty;i++) {         // looks for the one that is currently displayed   if (photos[i].style.display == 'inline') {     photos[i].style.display = 'none';   // hides it     photos[(i+photosQty-1)%photosQty].style.display = 'inline';  // and displays the one that is previous; last photo is the previous of the first one (cyclic list)     break;   } }}function showNextPhoto(photosQty) {  // shows next photo from the set of pics var i, photos = new Array(photosQty); for (i=photosQty-1;i>=0;i--) {       // gets all photos - they must have ids in 'photo0', 'photo1'... format   photos[i] = document.getElementById('photo'+i); } for (i=photosQty-1;i>=0;i--) {      // looks for the one that is currently displayed   if (photos[i].style.display == 'inline') {     photos[i].style.display = 'none';   // hides it     photos[(i+1)%photosQty].style.display = 'inline';   // and displays the one that is next; next to the last photo is the first one (cyclic list)     break;   } }}