//////////
// common JavaScript functions used storewide 
//
// $Id: common.js,v 1.2 2007/06/05 14:20:29 ksedov Exp $
//////////

////
// Disable / enable given input 
function disable_field(field,disable) {
	if(typeof(field) != 'object') {
		return;
	}
	if(disable) {
		field.disabled = true;
		if (field.style){
			if(field.type == 'text' || field.type == 'select-one' || field.type == 'password'){
				field.style.backgroundColor = '#F0F0F0';
				field.style.borderColor = '#B7B7C6';
				field.style.color = '#555555';
			}
		}
	} else {
		field.disabled = false;
		if (field.style){
			if(field.type == 'text' || field.type == 'select-one' || field.type == 'password'){
				field.style.backgroundColor = '#FFFFFF';
				field.style.borderColor = '#B7B7C6';
				field.style.color = '#000000';
			}
		}
	}
}

