// JavaScript functions for Mediterranean Food Warehouse.
//
// Written by Byte-Mill Techware Ltd 2007

// Function to add current year to copyright notice period.
function ToThisYear(id) {
	var TimeDate = new Date();
	var ThisYear = TimeDate.getFullYear();
	var Year = (document.getElementById(id).innerHTML);

	if ( (Year.length) == 4 ) {
		for (var i = 0; i < 4; i++) {
			if ( (isNaN(parseInt(Year.charAt(i)))) ) {
				document.write(" &#8211; ERROR: Your \"Year\" string contains characters!");
				return;
			}
		}
		if ( parseInt(ThisYear) > parseInt(Year) ) {
			document.write(" &#8211; " + ThisYear);
			return;
		}
	} else {
		document.write(" &#8211; ERROR: Your \"Year\" string is not YYYY format!");
	}	
}			 

