<script type="text/javascript">
<!--
function getDaysLeft(oDeadLineDate, oToday){
return oDeadLineDate > oToday ? Math.ceil((oDeadLineDate - oToday) / (1000 * 60 * 60 * 24)) : null;
}
function MkDaysLeft(sDeadLineDate, sDeadLineText){
var oToday = new Date();
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;
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 = "день";
}
}
var sLeftText = sDaysText == "день" ? "остался" : "осталось";
document.write(nDaysLeft);
}else{
document.write("!");
}
}
MkDaysLeft("August 20, 2013", "");
//-->
</script>
<!-- End Days left script -->
</p>
</div>
<!-- start hint -->
<div align="left" class="hint">
<div class="hinttopcorner"></div>
<div class="hinttop"></div>
<div class="hintcontent">
<p> </p>
<p>
<!-- Begin Days left script -->
<script type="text/javascript">
<!--
function getDaysLeft(oDeadLineDate, oToday){
return oDeadLineDate > oToday ? Math.ceil((oDeadLineDate - oToday) / (1000 * 60 * 60 * 24)) : null;
}
function MkDaysLeft(sDeadLineDate, sDeadLineText){
var oToday = new Date();
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;
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 = "день";
}
}
var sLeftText = sDaysText == "день" ? "остался" : "осталось";
document.write(sDeadLineText + " " + sLeftText + " " + nDaysLeft + " " + sDaysText + ".");
}else{
document.write("Конвенция о труде в морском судоходстве вступила в силу с 20 августа 2013 года.");
}
}
MkDaysLeft("August 20, 2013", "До вступления в силу Конвенции 2006 года о труде в морском судоходстве");
//-->
</script>
<!-- End Days left script -->