function buy (name, code, price, cat, weight)
{
	window.location = 'https://vault2.secured-url.com/bmsoftware/0pages/buy.php?t=' + name + '&r=' + code + '&p=' + price + '&c=' + cat + '&w=' + weight;
}

function trolley ()
{
	window.location = 'https://vault2.secured-url.com/bmsoftware/0pages/trolley.php';
}

function textUntilR(year, month, day, text, alttext)
{
	now = new Date();
	expire = new Date (year, month-1, day, 
		now.getHours(), now.getMinutes(), now.getSeconds()+1 );
	if ( expire.getTime()  >=  now.getTime())
                return text
	else
		return alttext;
}

function textUntil (year, month, day, text, alttext)
{
	temp = textUntilR(year, month, day, text, alttext);
        document.write( temp);
}


function buyUntil(year, month, day, name, code, offerprice, regularprice, cat, weight)
{
	price = textUntilR (year, month, day, offerprice, regularprice);
	buy (name, code, price, cat, weight);
}
