/* variables et fonctions SdS2010 */

var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
var today=new Date()
var todayy=today.getYear()
var todaym=today.getMonth()
var todayd=today.getDate()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy
var futurestring=montharray[m-1]+" "+d+", "+yr

function countdown1(yr,m,d){
if (todayy < 1000)
todayy+=1900
var todaystring=montharray[todaym]+" "+todayd+", "+todayy
var futurestring=montharray[m-1]+" "+d+", "+yr
var difference=(Math.round((Date.parse(futurestring)-Date.parse(todaystring))/(24*60*60*1000))*1)
var d1 = new Date();
var curr_date = d1.getDate();
var curr_month = todaym+1;
var curr_year = d1.getFullYear();
document.write("Aujourd'hui "+curr_date + "-" + curr_month + "-" + curr_year+"<br />");
}

function countdown2(yr,m,d){
var before="l'&eacute;cole SdS 2010"
var current="Les sessions sont ouvertes !"
if (todayy < 1000)
todayy+=1900
var todaystring=montharray[todaym]+" "+todayd+", "+todayy
var futurestring=montharray[m-1]+" "+d+", "+yr
var difference=(Math.round((Date.parse(futurestring)-Date.parse(todaystring))/(24*60*60*1000))*1)
var d1 = new Date();
var curr_date = d1.getDate();
var curr_month = todaym+1;
var curr_year = d1.getFullYear();
if (difference==0)
document.write(current)
else if (difference==-1)
document.write(current)
else if (difference>0)
document.write("J - "+difference+" de l'ouverture de "+before)
else if (difference<-1)
document.write("A l'ann&eacute;e prochaine")
}
/* Fin variables et fonctions SdS2010 */

/* variables et fonctions ERTS2012 */
function countdown4(yr,m,d){
if (todayy < 1000)
todayy+=1900
var todaystring=montharray[todaym]+" "+todayd+", "+todayy
var futurestring=montharray[m-1]+" "+d+", "+yr
var difference=(Math.round((Date.parse(futurestring)-Date.parse(todaystring))/(24*60*60*1000))*1)
var d1 = new Date();
var curr_date = d1.getDate();
var curr_month = todaym+1;
var curr_year = d1.getFullYear();
document.write("Today "+curr_year + "-" + curr_month + "-" + curr_date+"<br />");
}

function countdown3(yr,m,d){
var before=" ERTS2"
var current="Sessions are open !"
if (todayy < 1000)
todayy+=1900
var todaystring=montharray[todaym]+" "+todayd+", "+todayy
var futurestring=montharray[m-1]+" "+d+", "+yr
var difference=(Math.round((Date.parse(futurestring)-Date.parse(todaystring))/(24*60*60*1000))*1)
var d1 = new Date();
var curr_date = d1.getDate();
var curr_month = todaym+1;
var curr_year = d1.getFullYear();
if (difference==0)
document.write(current)
else if (difference==-1)
document.write(current)
else if (difference>0)
document.write("D - "+difference+" from "+before+" opening session")
else if (difference<-1)
document.write("See you in 2014")
}
/* Fin variables et fonctions ERTS2012 */
