<!--
var imgs = new Array(
	"expire15th.gif",
	"expiretoday.gif",
	"expirelast.gif");

var path = "images/specials/";		// images path
var d = new Date(),												// date objects
	day = d.getDate(),
	mth = d.getMonth(),
	year = d.getYear();

function selectImg()
{
	var img = document.images["var"];							// image

	if(img != null)
	{
		if(day <= 14)
		// ends on 15th
			{ img.src = path + imgs[0]; }
		else if(day == 15 || day == getLastDay())
		// ends today, the 15th
			{ img.src = path + imgs[1]; }
		else if(day <= getLastDay() - 1)
		// ends on last day of month
			{ img.src = path + imgs[2]; }
	}
}

// leap year or not
function isLeap()
	{ return (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)); }
	
// get the last day of the month
function getLastDay()
	{ return (new Array(31, ((isLeap())? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)[mth]); }

window.onload = selectImg;
-->