function axUpdate(url) {
	new Ajax.Updater('content',url,{asynchronous:true, evalScripts:true});
	return false;
}

function populateShipping(checkbox) {
	bis = checkbox.checked;
	bFs = document.getElementsByClassName('billingField');
	sFs = document.getElementsByClassName('shippingField');
	
	switch(bis) {
		case true:
			sFs[0].value='';
			for(x = 0; thisBF = bFs[x]; x++) {
				thisSF = sFs[x+1];				

				//select-one?
				switch(thisBF.type) {
					case "select-one":
						thisSF.selectedIndex = thisBF.selectedIndex;
					default:
						thisSF.value = thisBF.value;
				}
				thisSF.disabled = true;
				
				// alert(thisBF.name + thisSF.name);
			}
			
			break;
			
		case false:
			
			for(x = 0; thisSF = sFs[x]; x++) {
				thisSF = sFs[x];
				
				//select-one?
				switch(thisSF.type) {
					case "select-one":
						thisSF.selectedIndex= 0;
					default:
						thisSF.value = '';
				}
				thisSF.disabled = false;
				
				// alert(thisBF.name + thisSF.name);
			}
			break;
	}


}

function checkcc(obj) {
	if(obj.disabled==true) return false;

	if(document.paymentForm.cc.value.length==0) {
		alert("Enter a Valid Credit Card number");
		return false;
	}

	if(document.paymentForm.sec_code.value.length==0) {
		alert("Enter a valid Credit Card Security Code");
		return false;
	}

	obj.innerHTML ='Processing, Please Wait...';
	obj.disabled=true;
	document.paymentForm.submit();

}