

function disableShipping(disable)
{
	document.getElementById('shipping_name').disabled = disable;
	document.getElementById('shipping_address_1').disabled = disable;
	document.getElementById('shipping_address_2').disabled = disable;
	document.getElementById('shipping_city').disabled = disable;
	document.getElementById('shipping_state_id').disabled = disable;
	document.getElementById('shipping_zip').disabled = disable;
}


function hideOptionsLabel(frmName, map, id)
{
	var frm = document.forms[frmName];
	if(map[id] == true)
		frm['data[label]'].value = '';
	frm['data[label]'].disabled = map[id];
}


function validateDateField(fld)
{
	if(fld.value == 'mm-dd-yyyy'){
		fld.value == '';
		return false;
	}
	return true;
}


function confirmDelete(url)
{
	if( confirm('Are you sure you want to delete this record?') ){
		window.location.href = url;
		return true;
	}

	return false;
}


function goTo(url)
{
	window.location.href = url;
	return true;
}


function popupWindow(url, width, height, name)
{
	var left = (screen.width-width)/2;
	var top = (screen.height-height)/2;
	if(name == null){
		day = new Date();
  		name = 'popup_' + day.getTime();
	}
	eval(name + " = window.open(url, '" + name + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=yes,width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + "');");
}

