function addbasket(me){

	var itemid = me.itemid.value;
	var quantity = me.quantity.value;
	var price = me.price.value;
	var color = me.color.value;

	if(color==''){alert(me.alertcolor.value); return false;}
	if(itemid==''){alert(me.alertsize.value); return false; }
	
	var ajaxurl =  '/basket/add.asp'
	    ajaxurl += '?productid='+itemid
	    ajaxurl += '&quantity='+quantity
	    ajaxurl += '&price='+price

	var blockid = 'productsinbasket';
	
	makeRequest(ajaxurl,blockid);
	
	addbasketalert();
	
}

function updatequantity(arrayindex,me){

	var quantity = me.value

	if(isNaN(quantity)){
		alert("Quantity is not a number"); me.value = 1;
	} else {
		document.location='/basket/update.asp?index='+arrayindex+'&quantity='+quantity;
	}

}

function adddeliverycost(value){

	var productid = value.split("¤")[0];
	var quantity = 1;
	var price = value.split("¤")[1];
	
	var ajaxurl =  '/basket/add.asp'
	    ajaxurl += '?productid='+productid
	    ajaxurl += '&quantity='+quantity
	    ajaxurl += '&price='+price
	
	makeRequest(ajaxurl,'');	

}

