// Since IE and firefox handle timers differently, we need to know type of browser
isIE = document.all;
// Handle of timer, for the time we have to stop it.
var cdtIdf96338d2952a1ee280d7beeb34ee9f789;
// Adding a timer to timer list
if (isIE) {
	cdtIdf96338d2952a1ee280d7beeb34ee9f789 = window.setInterval("cdtDisplayf96338d2952a1ee280d7beeb34ee9f789()", 500);
}
else {
	cdtIdf96338d2952a1ee280d7beeb34ee9f789 = window.setInterval(cdtDisplayf96338d2952a1ee280d7beeb34ee9f789, 500);
}

// Get the current time as seconds and set it as the start of counting when the page loads.
if (isIE) {
	date = new Date;
	cdtOffsetf96338d2952a1ee280d7beeb34ee9f789 = Math.floor(date.getTime() / 1000);
} 
else {
	cdtOffsetf96338d2952a1ee280d7beeb34ee9f789 = Math.floor(Date.now() / 1000);
}

// Setting the cookie for current time if it's not set.
var cookief96338d2952a1ee280d7beeb34ee9f789 = getCookief96338d2952a1ee280d7beeb34ee9f789("offsetf96338d2952a1ee280d7beeb34ee9f789");
if(cookief96338d2952a1ee280d7beeb34ee9f789)
{
	cdtOffsetf96338d2952a1ee280d7beeb34ee9f789 = parseInt(cookief96338d2952a1ee280d7beeb34ee9f789);
}
else
{
	setCookief96338d2952a1ee280d7beeb34ee9f789("offsetf96338d2952a1ee280d7beeb34ee9f789",cdtOffsetf96338d2952a1ee280d7beeb34ee9f789,3000);
}


// The number of seconds which will be counted and then the page redirects.
cdtReachf96338d2952a1ee280d7beeb34ee9f789 = cdtOffsetf96338d2952a1ee280d7beeb34ee9f789 + 255600;


// A function for setting cookie on visitor's browser
function setCookief96338d2952a1ee280d7beeb34ee9f789(c_name,value,expiredays)
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

// A function for getting cookie values by their names
function getCookief96338d2952a1ee280d7beeb34ee9f789(cookie_name)
{
  var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );

  if (results)
    return (unescape(results[2]));
  else
    return null;
}


// Callback function that will be called frequently.
function cdtDisplayf96338d2952a1ee280d7beeb34ee9f789() {
	// Current time, in seconds since 1970
	if (isIE) {
		date = new Date;
		now = Math.floor(date.getTime() / 1000);
	} 
	else {
		now = Math.floor(Date.now() / 1000);
	}
	// Difference in seconds
	diff = cdtReachf96338d2952a1ee280d7beeb34ee9f789 - now;
	// If deadline is passed, redirect
	if (diff < 0) {
		clearInterval(cdtIdf96338d2952a1ee280d7beeb34ee9f789);
		window.location.href = "http://www.mincirpourdebon.com/maigrir.html";
	}
	// Otherwise, show the remaining time
	else {
		document.getElementById('cdtcountdowntimerf96338d2952a1ee280d7beeb34ee9f789').innerHTML = cdtFormatf96338d2952a1ee280d7beeb34ee9f789(cdtConvertf96338d2952a1ee280d7beeb34ee9f789(diff));
	}
}

// This function gets seconds and returns an array containing hours, minutes and seconds in it
function cdtConvertf96338d2952a1ee280d7beeb34ee9f789(secs) {
	days = Math.floor(secs / 86400);
	secs = secs - days * 86400;
	
	hours = Math.floor(secs / 3600);
	secs = secs - hours * 3600;
	
	mins = Math.floor(secs / 60);
	secs = secs - mins * 60;
	
	return [days, hours, mins, secs];
}

// This function converts the seconds to formatted remaining time
function cdtFormatf96338d2952a1ee280d7beeb34ee9f789(t) {
	return cdtStyleDigitf96338d2952a1ee280d7beeb34ee9f789(t[0]) + cdtStyleLetterf96338d2952a1ee280d7beeb34ee9f789(' jours ') + cdtStyleDigitf96338d2952a1ee280d7beeb34ee9f789(t[1]) + cdtStyleLetterf96338d2952a1ee280d7beeb34ee9f789(' hrs ') + cdtStyleDigitf96338d2952a1ee280d7beeb34ee9f789(t[2]) + cdtStyleLetterf96338d2952a1ee280d7beeb34ee9f789(' mins ') + cdtStyleDigitf96338d2952a1ee280d7beeb34ee9f789(t[3]) + cdtStyleLetterf96338d2952a1ee280d7beeb34ee9f789(' secs');
}

// This function adds leading zero to the one digit numbers
function cdt2Digf96338d2952a1ee280d7beeb34ee9f789(n) {
	if (n < 10 && n>= 0) return '0' + String(n); else return String(n);
}

function cdtStyleDigitf96338d2952a1ee280d7beeb34ee9f789(str) {
	return '<span style="color: #000000; font-family: Georgia; font-size: 29px; font-weight: bold; font-style: none">'+ str +'</span>';
}

function cdtStyleLetterf96338d2952a1ee280d7beeb34ee9f789(str) {
	return '<span style="color: #000000; font-family: Georgia; font-size: 29px; font-weight: bold; font-style: none">'+ str +'</span>';
}

