function gsAddCart(companyID,shares){
	var theForm = document.getElementById('f_process');
	theForm.action = 'getting_started_b.cfm';
	theForm.process.value = 'cartAdd';
	theForm.companyID.value = companyID;
	theForm.shares.value = shares;
	theForm.submit();
}

function gsRemoveCart(companyID){
	var theForm = document.getElementById('f_process');
	theForm.action = 'getting_started_b.cfm';
	theForm.process.value = 'cartRemove';
	theForm.companyID.value = companyID;
	theForm.submit();
}


function findCompany(company){
	var theForm = document.getElementById('f_process');
	theForm.action = 'getting_started_b.cfm';
	theForm.process.value = 'findCompany';
	theForm.company.value =company;
	theForm.submit();
}

function checkOut(){
	var theForm = document.getElementById('f_process');
	var stockForm = document.getElementById('f_stocks');
	var newInput;
	var valueToUse;
	var thsInput;
	// loop share quality elements in form 
	for (var i = 0;i < stockForm.elements.length;i++){
		if (stockForm.elements[i].className == 'i_shares'){
			thisInput = stockForm.elements[i];
			thisName = stockForm.elements[i].name;
			if (isNaN(thisInput.value))
			{
				valueToUse = 1;
			}
			else {
				if (thisInput.value > 100){
					valueToUse = 100;
				}
				else if (thisInput.value <1){
					valueToUse = 1;	
				}
				else {
					valueToUse = thisInput.value;
				}
				
			}
			newInput = document.createElement('input');
			newInput.type = 'hidden' ;
			newInput.name = stockForm.elements[i].name;
			newInput.value = valueToUse;
			if (! theForm[thisName]){
				theForm.appendChild(newInput);
			}
			else{
				theForm.replaceChild(newInput,theForm[thisName]);	
			}
		}
	}
	theForm.action = 'secureFiles/static/drip_enrollment_order_s.cfm';
	theForm.submit();
}
