function addtocart(productID){
	// updater is the id of the div to echo to, addtocart.php is where we are sending the variables 
	new Ajax.Updater('updater', 'common/ajax/addtocart.php', {
		evalScripts: true, // this allows the ajax page to call javascript functions
	// productID in position 1 is the name (form name), productID in position 2 is the js variable (what will be in the form field value)
	  parameters: { productID: productID }
	});
}


function updatecart(){
	
}


function showCart(){
	// stretch overlay to fill page and fade in
 	lb.disableKeyboardNav();
	lb.lightbox.hide();
	
	if (!$('overlay').visible() ){
		var arrayPageSize = lb.getPageSize();
		$('overlay').setStyle({ width: arrayPageSize[0] + 'px', height: arrayPageSize[1] + 'px' });
		new Effect.Appear($('overlay'), { duration: 0.2, from: 0.0, to: 0.8 });
	}
	redrawCart();
	new Effect.Appear($('cartOverlay'), { duration: 0.2, from: 0.0, to: 1.0 });

}


function updateQTY(theform){
	var formVars = theform.serialize();
	new Ajax.Updater('updater', 'common/ajax/cartfunctions.php', {
		evalScripts: true,
		parameters: formVars 
	});
}

function removeItem(theform){
	var formVars = theform.serialize();
	new Ajax.Updater('updater', 'common/ajax/cartfunctions.php', {
		evalScripts: true,
		parameters: formVars 
	});
}

function redrawCart(){
	var arrayPageSize = lb.getPageSize();
	$('cartOverlay').setStyle({ left: ((arrayPageSize[0]/2) - 326 ) + 'px', top: ((arrayPageSize[1]/2) - 229) + 'px' });
	new Ajax.Updater('cartOverlay', 'common/ajax/cart.php', {
		evalScripts: true,
	  parameters: { }
	});
}


function closeCart(){
	$('overlay').hide();
	$('cartOverlay').hide();
	$('cartOverlay').update();
}




function checkoutValidate(laform) {
if(!laform.agree.checked){alert('Please check "I AGREE TO THE TERMS OF SERVICE"');
return false; }

return true;
}


