/**
 * @author Oleksiy Tymoshenko
 */
function ShowDate(){
	var d, s = '';
	d = new Date();
	s += d.getDate() + "/" + (d.getMonth() ) + "/" + d.getFullYear();
	s += ' ' + d.getHours() + ':' + d.getMinutes();
	return(s);
}

function textCounter(field,counter,maxlimit,linecounter){
    var fieldWidth = parseInt(field.offsetWidth);
    var charcnt = field.value.length;

    if (charcnt > maxlimit) 
        field.value = field.value.substring(0, maxlimit);
    else {
        var percentage = parseInt(100 - (( maxlimit - charcnt) * 100)/maxlimit) ;
        document.getElementById(counter).style.width = parseInt((fieldWidth*percentage)/100)+"px";
        document.getElementById(counter).innerHTML=" "+percentage+"%"
        setcolor(document.getElementById(counter),percentage,"backgroundColor");
    }
}
function setcolor(obj,percentage,prop){
	obj.style[prop] = "rgb(100%,"+(100-percentage)+"%,"+(100-percentage)+"%)";
}
