function popup_img(page,img, W, H){
	var left = (screen.width - W) / 2;
	var top = (screen.height - H) / 3;
	var opciones="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width="+W+",height="+H+",top="+top+",left="+left+"";
	window.open(page+'?img='+img,"",opciones);
}

function showHide (item) {
	wichItem = document.getElementById(item);
	if (wichItem.className=="itemShown") {
		wichItem.className="itemHidden";
	}else{
		wichItem.className="itemShown";
	}
}

var counter=0;
function send(){
	if (counter == 0){
		if(confirm ("Are you sure you want to make the transaction?")){
			alert ("Please be patient while order is processed.\n\nProcessing can take up to several minutes depending on network traffic.\n\nDO NOT CANCEL OR REFRESH THIS PAGE, \n it can result in a duplicate billing.\n\nClick OK to continue");
			counter++;
			return true;
		}else{
			return false;
		}
	}else{
		alert("Form is being sent, please wait a momment.");
		return false;
	}
}

function unlockCouponCode (){
	document.forms.checkout.couponCode.disabled = false;
}

function lockCouponCode (){
	document.forms.checkout.couponCode.disabled = true;
}

function lockZip (){
	document.forms.form1.zip_code.disabled = true;
	document.forms.form1.radius.disabled = true;
	document.forms.form1.zip_code.className = 'text disabled';
	document.forms.form1.radius.className = 'text disabled';
	document.forms.form1.zip_code.title = 'Click here to enable this item';
	document.forms.form1.radius.title = 'Click here to enable this item';

	document.forms.form1.id_state.disabled = false;
	document.forms.form1.city.disabled = false;
	document.forms.form1.id_state.className = 'text';
	document.forms.form1.city.className = 'text';
	document.forms.form1.id_state.title = 'Select a State from the list';
	document.forms.form1.city.title = 'Insert City name';
}
function lockStatesCities (){
	document.forms.form1.zip_code.disabled = false;
	document.forms.form1.radius.disabled = false;
	document.forms.form1.zip_code.className = 'text';
	document.forms.form1.radius.className = 'text';
	document.forms.form1.zip_code.title = 'Insert Zip Code';
	document.forms.form1.radius.title = 'Choose Radius';

	document.forms.form1.id_state.disabled = true;
	document.forms.form1.city.disabled = true;
	document.forms.form1.id_state.className = 'text disabled';
	document.forms.form1.city.className = 'text disabled';
	document.forms.form1.id_state.title = 'Click here to enable this item';
	document.forms.form1.city.title = 'Click here to enable this item';
}
