function init(){
	var stretchers = document.getElementsByClassName('box');
	var toggles = document.getElementsByClassName('tab');
	var myAccordion = new fx.Accordion(
		toggles, stretchers, {opacity: false, height: true, duration: 600}
	);
	//hash functions
	var found = false;
	toggles.each(function(h3, i){
		var div = Element.find(h3, 'nextSibling');
			if (window.location.href.indexOf(h3.title) > 0) {
				myAccordion.showThisHideOpen(div);
				found = true;
			}
		});
		if (!found) myAccordion.showThisHideOpen(stretchers[0]);
}

function backToList(){
	window.location = "http://www.buchanan-cushions.com/products.php";
}
function backToContact(){
	window.location = "http://www.buchanan-cushions.com/";
}

function backToLogin(error){
	window.location = "http://www.buchanan-cushions.com/admin/login.php?error="+ error +"";
}

function redirect(to){
	window.location = to;
}

var theTime = 11;
function countDown(){
	if(theTime > 0){
		setTimeout('countDown()',1000);
		theTime -= 1;
	}
	document.getElementById("secHolder").innerHTML = theTime;
	return theTime;
}

function dopostage(formid,ship)
{
	rawship = (ship * document.getElementById(''+formid+'').quantity.value);
	newship = Math.round(rawship*Math.pow(10,2))/Math.pow(10,2);
	document.getElementById(''+formid+'').shipping.setAttribute("value",""+newship+"");
}
function sizevalue(formid){
	str = document.getElementById(''+formid+'').size.options[document.getElementById(''+formid+'').size.selectedIndex].innerHTML;
	where = str.indexOf('h');
	slice = str.slice(5,where+1);
	document.getElementById(''+formid+'').sizer.setAttribute("value",""+slice+"");
}