function inv_check(strID) {
	if (document.getElementById(strID)) {
		var strName=document.getElementById(strID+'_name').value;
		var strValue=document.getElementById(strID+'_amount').value;   
		var strOldName=document.getElementById('paypal_name').value;   
		var strOldValue=document.getElementById('paypal_amount').value;
		if (document.getElementById(strID).checked) {
			if (strOldName=='') {
				var strNewName=strName
				var strNewValue=strValue
			}
			else {
				var strNewName=strOldName+', '+strName
				var strNewValue=eval(parseFloat(strOldValue)+parseFloat(strValue))
			}
		}
		else {
			var strNewName=strOldName.replace(', '+strName,'');
			strNewName=strNewName.replace(strName+', ','');
			strNewName=strNewName.replace(strName,'');
			var strNewValue=eval(parseFloat(strOldValue)-parseFloat(strValue))
		}
		document.getElementById('paypal_name').value=strNewName;
		document.getElementById('paypal_amount').value=parseFloat(strNewValue).toFixed(2);
		document.getElementById('paypal_submit').value='Pay £'+parseFloat(strNewValue).toFixed(2)+' with Paypal';
		if (strNewValue>0) {
			document.getElementById('paypal_submit').style.display='block';
		}
		else {
			document.getElementById('paypal_submit').style.display='none';
		}
		/* WRITE TO FIREBUG CONSOLE - FASTER THAN ALERT DEBUGGING! (Breaks IE if left on)
		console.log('Sent name:'+strName);
		console.log('Sent value:'+strValue);
		console.log('Old name:'+strOldName);
		console.log('Old value:'+strOldValue);
		console.log('New name:'+strNewName);
		console.log('New value:'+strNewValue);*/
	}   
}

