// JavaScript Document
var oToday = new Date();
var curDay = "";
  var curDaySl = "";
  var curDayRem = "Осталось";
var curDayEng = "";
  var curDaySlEng = "";
  var curDayRemEng = "LEFT";
var date_start = "February 24, 2012";

function getDaysLeft(oDeadLineDate, oToday){
  return oDeadLineDate > oToday ? Math.ceil((oDeadLineDate - oToday) / (1000 * 60 * 60 * 24)) : null;
}

function MkDaysLeft(sDeadLineDate, sDeadLineText){
  var sTime = sDeadLineDate + " " + oToday.getHours() + ":" + oToday.getMinutes() + ":" + oToday.getSeconds();
  var oDeadLineDate = new Date(sTime);
  var nDaysLeft = getDaysLeft(oDeadLineDate, oToday);
  
  if (nDaysLeft){
    var sDaysLeft = String(nDaysLeft);
    var sDaysText = "дней";
    var nDaysLeftLength = sDaysLeft.length;
	curDaySlEng = "DAYS";
	if (sDaysLeft.charAt(nDaysLeftLength - 2) != "1"){
      if (sDaysLeft.charAt(nDaysLeftLength - 1) == "2" || sDaysLeft.charAt(nDaysLeftLength - 1) == "3" || sDaysLeft.charAt(nDaysLeftLength - 1) == "4") sDaysText = "дня";
      else if (sDaysLeft.charAt(nDaysLeftLength - 1) == "1") {sDaysText = "день"; curDayRem = "Остался"; curDaySlEng = "DAY";}
    }
    var sLeftText = sDaysText == "день" ? "" : "";
    //document.write(sDeadLineText + " " + sLeftText + " " + nDaysLeft + " " + sDaysText);
	curDay = sDeadLineText + " " + sLeftText + " " + nDaysLeft;
	curDaySl = sDaysText;
  }else {
	  curDay = "0";
	  curDaySl = "дней";
	  curDayRem = "Осталось";
	  curDayEng = "0";
	  curDaySlEng = "day";
	  curDayRemEng = "Remain";
	  }
}

MkDaysLeft(date_start, "");

