<script type="text/javascript" src="http://yandex.st/jquery/1.7.2/jquery.min.js"></script>
<script>
$(document).ready(function(){
$(".data-tst").each(function () {
var dat=$(this).text().split('.');
var tstDat = new Date(dat[2], +dat[1]-1, dat[0] )
var tstDay=((+tstDat - new Date())/(24*60*60*1000))
if(tstDay<1.5)$(this).css({"background-color":"red"});
if(tstDay<0)$(this).css({"background-color":"#AFAFAF"})
});
});
</script>
<div id="test" class="data-tst">28.06.2013</div>
<div id="test" class="data-tst">3.07.2013</div>
<div id="test" class="data-tst">1.07.2013</div>
<div id="test" class="data-tst">2.07.2013</div>