function CheckOutOfStock()
{
	if (typeof(OutOfStock) == 'undefined')
		return;

	var dOutOfStock = new Date(OutOfStock);
	var Today = new Date();
	if (dOutOfStock > Today)
	{
		if (document.getElementById)
		{
			if (document.getElementById("add2cartbutton"))
			{
				var btn = document.getElementById("add2cartbutton");
				btn.value = "Back-Order";
				btn.style.backgroundColor = "red";
				if (document.getElementById("captionmessage"))
				{
					document.getElementById("captionmessage").innerHTML = "<b><font color=#ff0000>SORRY, THIS ITEM IS OUT OF STOCK UNTIL " + OutOfStock + "</font></b>";
				}
				document.write(" <font color=#ff0000><b>OUT OF STOCK, PLEASE USE BACK-ORDER BUTTON FOR DELIVERY AFTER " + OutOfStock + "</b></font>");
			}
		}
	}
}

function OSadd(id,osdate)
{
	if (typeof(this.ids) == 'undefined')
	{
		this.ids = new Array();
	}
	if (typeof(this.dates) == 'undefined')
	{
		this.dates = new Array();
	}
	this.ids[this.ids.length] = id;
	this.dates[this.dates.length] = osdate;
}

function OSlist()
{
	var Today = new Date();
	
	for (var i = 0; i < this.ids.length; i++)
	{
		var d = new Date(this.dates[i]);
		if (d > Today)
		{
			document.write("<a href=" + this.ids[i] + ".html>" + this.ids[i] + "</a>, " + this.dates[i] + "<br>");
		}
	}
}
function objOS()
{
	this.add = OSadd;
	this.list = OSlist;
}

var OS = new objOS;
