/**
 * @author Steve Miller
 */

function toggleDisplayOrderBox(textboxId) {
	var orderBox = document.getElementById(textboxId);
	orderBox.disabled = !orderBox.disabled;
	
	if (orderBox.disabled) {
		orderBox.value = '';
	}
}


function isEmail(email) {
    var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    return regex.test(email);
}

/**
 * Document popups
 */
$(document).ready(function(){
	$("a.popup").click(function(){
		var popup = window.open(this.href, "popup", "width=950, height=500, scrollbars=yes");
		popup.focus();
		return false;
	});
});

/**
 * Messages, error and otherwise
 */
$(document).ready(function(){
	$("a.message").click(function(){
		$("#response_message").hide();
	});
});