// PRLALABLE AU SWAP IMAGE LORSQUE NECESSAIRE
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}



// PREALABLE AU SWAP IMAGE LORSQUE NECESSAIRE
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}



// PREALABLE AU SWAP IMAGE LORSQUE NECESSAIRE
function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}


// PREALABLE AU SWAP IMAGE LORSQUE NECESSAIRE
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



// PREALABLE AUX FONCTIONS DE COMPTEUR DE CARACTERE POUR LES FORMULAIRES
function getObject(obj) {
  var theObj;
  if(document.all) {
    if(typeof obj=="string") {
      return document.all(obj);
    } else {
      return obj.style;
    }
  }
  if(document.getElementById) {
    if(typeof obj=="string") {
      return document.getElementById(obj);
    } else {
      return obj.style;
    }
  }
  return null;
}



// PREALABLE AUX FONCTIONS DE COMPTEUR DE CARACTERE POUR LES FORMULAIRES
function Contar(entrada,salida,texto,caracteres) {
  var entradaObj=getObject(entrada);
  var salidaObj=getObject(salida);
  var longitud=caracteres - entradaObj.value.length;
  if(longitud <= 0) {
    longitud=0;
    texto='<span class="disable"> '+texto+' </span>';
    entradaObj.value=entradaObj.value.substr(0,caracteres);
  }
  salidaObj.innerHTML = texto.replace("{CHAR}",longitud);
}


// FONCTIONS POUR AVOIR LA DATE COURANTE, OU EN CHOISIR UNE NOUVELLE
var monthList = ['January','February','March','April','May','June','July','August','September','October','November','December'];
var curDate = new Date(); curDate.setDate(1); curDate.getTheYear = curDate.getFullYear ? curDate.getFullYear : curDate.getYear;
//the form buttons don't work in NS4 because of bugs
var MWJNS4 = document.layers && !document.all && navigator.mimeTypes['*'];
//Opera 7, Opera 6 Mac/Linux, Konqueror and Safari's security means that you cannot write to about:blank as it is counted as a different domain
//Escape does not recognise about:blank (it uses its own, but it occasionally makes the popup go blank) but it does understand ''
var opOrEscape = window.opera || ( document.layers && !navigator.mimeTypes['*'] ) || navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled ) || ( window.ScriptEngine && ScriptEngine() == 'JScript' && navigator.platform == 'Win32' && window.ActiveXObject && !navigator.__ice_version );
function openCalendar(e) {
	var sX = 0, sY = 0; if( !e ) { e = window.event; }
	if( e && ( e.screenX || e.screenY ) && screen.availWidth ) { sX = e.screenX; sY = e.screenY; }
	if( sX > screen.availWidth - 271 ) { sX = screen.availWidth - 271; }
	if( sY > screen.availHeight - 308 ) { sY = screen.availHeight - 308; }
	doReDraw(sX,sY);
}
function MWJ_dropYear() { curDate.setYear( curDate.getTheYear() - 1 ); doReDraw(); }
function MWJ_raiseYear() { curDate.setYear( curDate.getTheYear() + 1 ); doReDraw(); }
function MWJ_dropMonth() { if( curDate.getMonth() ) { curDate.setMonth( curDate.getMonth() - 1 ); } else { curDate.setMonth(11); curDate.setYear( curDate.getTheYear() - 1 ); } doReDraw(); }
function MWJ_raiseMonth() { if( curDate.getMonth() < 11 ) { curDate.setMonth( curDate.getMonth() + 1 ); } else { curDate.setMonth(0); curDate.setYear( curDate.getTheYear() + 1 ); } doReDraw(); }
function resetDate() { curDate.setTime((new Date()).getTime()); }
function doReDraw(sX,sY) {
	var theContent = 
		'<html><head><title>Date picker</title><style type="text/css"><!--\n'+
		'a { text-decoration: none; }\n'+
		'td, th { font-family: \'Times New Roman\', Times, Serif; }\n'+
		'a.MWJCAL { display: block; width: 100%; font-weight: bold; }\n'+
		'a.MWJCAL:hover { background-color: #99ff99; }\n--></style></head>'+
		'<body bgcolor="#bfbfbf" text="#ffffff" link="#00007f" alink="#00007f" vlink="#00007f">'+
		'<form onsubmit="return false;"><table border="1" cellpadding="2" cellspacing="1" width="233">'+
		'<tr><td bgcolor="#ffffff" colspan="7"><table border="0" cellpadding="2" cellspacing="1" width="100%">'+
		'<tr><td bgcolor="#323c76">'+(MWJNS4?'<a href="javascript:if( window.opener && window.opener.MWJ_dropYear ) { window.opener.MWJ_dropYear(); } else { window.alert( \'Error:\\nCould not communicate with opening window.\' ); }"><font color="#ffffff">&lt;&lt;</font></a>':'<input type="button" value="<<" onclick="if( window.opener && window.opener.MWJ_dropYear ) { window.opener.MWJ_dropYear(); } else { window.alert( \'Error:\\nCould not communicate with opening window.\' ); }">')+'</td><td bgcolor="#323c76" align="center"><b>'+curDate.getTheYear()+'</b></td><td bgcolor="#323c76" align="right">'+(MWJNS4?'<a href="javascript:if( window.opener && window.opener.MWJ_raiseYear ) { window.opener.MWJ_raiseYear(); } else { window.alert( \'Error:\\nCould not communicate with opening window.\' ); }"><font color="#ffffff">&gt;&gt;</font></a>':'<input type="button" value=">>" onclick="if( window.opener && window.opener.MWJ_raiseYear ) { window.opener.MWJ_raiseYear(); } else { window.alert( \'Error:\\nCould not communicate with opening window.\' ); }">')+'</td></tr>'+
		'<tr><td bgcolor="#323c76">'+(MWJNS4?'<a href="javascript:if( window.opener && window.opener.MWJ_dropMonth ) { window.opener.MWJ_dropMonth(); } else { window.alert( \'Error:\\nCould not communicate with opening window.\' ); }"><font color="#ffffff">&lt;&lt;</font></a>':'<input type="button" value="<<" onclick="if( window.opener && window.opener.MWJ_dropMonth ) { window.opener.MWJ_dropMonth(); } else { window.alert( \'Error:\\nCould not communicate with opening window.\' ); }">')+'</td><td bgcolor="#323c76" align="center"><b>'+monthList[curDate.getMonth()]+'</b> <font size="-2">[<a href="javascript:if( window.opener && window.opener.resetDate ) { window.opener.resetDate(); window.opener.doReDraw(); } else { window.alert( \'Error:\\nCould not communicate with opening window.\' ); }"><font color="#bbbbff">Go to now</font></a>]</font></td><td bgcolor="#323c76" align="right">'+(MWJNS4?'<a href="javascript:if( window.opener && window.opener.MWJ_raiseMonth ) { window.opener.MWJ_raiseMonth(); } else { window.alert( \'Error:\\nCould not communicate with opening window.\' ); }"><font color="#ffffff">&gt;&gt;</font></a>':'<input type="button" value=">>" onclick="if( window.opener && window.opener.MWJ_raiseMonth ) { window.opener.MWJ_raiseMonth(); } else { window.alert( \'Error:\\nCould not communicate with opening window.\' ); }">')+'</td></tr>'+
		'</table></td></tr>'+
		'<tr><th bgcolor="#6ab49f">Sun</th><th bgcolor="#6ab49f">Mon</th><th bgcolor="#6ab49f">Tue</th><th bgcolor="#6ab49f">Wed</th><th bgcolor="#6ab49f">Thu</th><th bgcolor="#6ab49f">Fri</th><th bgcolor="#6ab49f">Sat</th></tr>';
	for( var x = 1; x <= [31,((!( curDate.getTheYear() % 4 ) && ( ( curDate.getTheYear() % 100 ) || !( curDate.getTheYear() % 400 ) ))?29:28),31,30,31,30,31,31,30,31,30,31][curDate.getMonth()]; x++ ) {
		curDate.setDate(x);
		if( x == 1 && curDate.getDay() ) { theContent += '<tr><td colspan="'+curDate.getDay()+'"></td>'; }
		theContent += ( ( !curDate.getDay() ) ? '<tr>' : '' ) + '<td align="center" bgcolor="#'+((curDate.getMonth()==(new Date()).getMonth()&&curDate.getYear()==(new Date()).getYear()&&x==(new Date()).getDate())?'ffbbdd':((!curDate.getDay()||curDate.getDay()==6)?'ffffbb':'ffffff'))+'"><a class="MWJCAL" href="javascript:if( window.opener && window.opener.datePickerReturn ) { void(window.opener.setTimeout(\'datePickerReturn('+x+','+(curDate.getMonth()+1)+','+curDate.getTheYear()+');\',1)); window.close(); } else { window.alert( \'Error:\\nCould not communicate with opening window.\' ); }">'+x+'</a></td>';
	} curDate.setDate(1);
	theContent += '</table></form></body></html>';
	var oDoc = window.open( ( opOrEscape ? '' : 'about:blank' ), 'MWJ_TOFR', 'width=259,height=277'+(sY?(',top='+sY):'')+(sX?(',left='+sX):'')+',resizable=1,location=0,menubar=0,scrollbars=0,status=0,toolbar=0' );
	oDoc.document.open(); oDoc.document.write(theContent); oDoc.document.close(); window.MWJwinStore = oDoc;
	//these must be done after open-write-close or the window cannot be written to in IE4 Mac
	if( oDoc.focus ) { oDoc.focus(); } if( ( sX || sY ) && oDoc.moveTo ) { oDoc.moveTo(sX,sY); }
}
if( !window.onunload ) { window.onunload = function () { if( window.MWJwinStore && !window.MWJwinStore.closed ) { window.MWJwinStore.close(); } }; }


var win=null;
function popup(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}
// EOF
