function todaysdate(d){
	var currentTime = new Date();
	var day = currentTime.getDate()+"";
	var month = currentTime.getMonth()+1+"";
	var year = currentTime.getFullYear();
	if (day.length<2){
		day = "0"+day;
	}
	if (month.length<2){
		month = "0"+month;
	}
	document.getElementById(d+'d').value=day;
	document.getElementById(d+'m').value=month;
	document.getElementById(d+'y').value=year;
	joindatefields(d);
}

function setdatena(d){
	document.getElementById(d+'d').value="--";
	document.getElementById(d+'m').value="--";
	document.getElementById(d+'y').value="----";
	document.getElementById(d).value="";
	joindatefields(d);
}

function joindatefields(d){
 document.getElementById(d).value=document.getElementById(d+'y').value+document.getElementById(d+'m').value+document.getElementById(d+'d').value;
}

function openwindow(url, w, h){
			if (w=="") {w="600";}
			if (h=="") {h="400";}
   newwindow=window.open(url, 'openwindow', 'toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,left=100,top=100,width='+((w-0)+20)+',height='+((h-0)+20)+'');
			if (window.focus) {newwindow.focus()}
			return false;
}

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

