//This function was originally taken from http://www.999tutorials.com/tutorial-fill-an-input-field-with-the-current-date-and-time-with-javascript.html
//Stuart Eve (stuarteve@lparchaeology.com) has undertaken a number of edits to it.

function setDateNow(format,classtype)
{
	//first get the date
	var d = new Date();
	var yr = d.getFullYear();
	var mm = d.getMonth() + 1;
	var dd = d.getDate();
	var hh = d.getHours();
 	var mi = d.getMinutes();
  
	//now explode the format so that we can set the inputs

	var format_split = format.split(",");

	//now loop and fill the inputs

	for(i=0;i<format_split.length;i++){

 		theInput = document.getElementById(classtype + "_" + format_split[i]);
 		theInput.value = eval(format_split[i]);

	}

}
