function Validate_data(event) {
	var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
	
		if (true)//validar numeros
			if ((keyCode >= 48 && keyCode <= 57) || (keyCode == 8) || (keyCode == 46))
				return true;
			else
				return false;
		else
			return true;
}

function change_type(){
  
   if(document.dimentions_form.type.value=='inches'){
   
      document.dimentions_form.height_inches.style.backgroundColor='#FFFFFF';
	  document.dimentions_form.width_inches.style.backgroundColor='#FFFFFF';
	  document.dimentions_form.depth_inches.style.backgroundColor='#FFFFFF';
	  document.dimentions_form.height_inches.style.borderStyle='';
	  document.dimentions_form.width_inches.style.borderStyle='';
	  document.dimentions_form.depth_inches.style.borderStyle='';
	  document.dimentions_form.text_depth.style.backgroundColor='#EEEEEE';
	  document.dimentions_form.text_width.style.backgroundColor='#EEEEEE';
	  document.dimentions_form.text_height.style.backgroundColor='#EEEEEE';
	  document.dimentions_form.text_depth.style.borderStyle='none';
	  document.dimentions_form.text_width.style.borderStyle='none';
	  document.dimentions_form.text_height.style.borderStyle='none';
	  document.dimentions_form.text_depth.readOnly=true;
	  document.dimentions_form.text_width.readOnly=true;
	  document.dimentions_form.text_height.readOnly=true;
	  document.dimentions_form.height_inches.readOnly=false;
	  document.dimentions_form.width_inches.readOnly=false;
	  document.dimentions_form.depth_inches.readOnly=false;
	  document.dimentions_form.height_inches.focus();
   
   }
   else{
     document.dimentions_form.height_inches.style.backgroundColor='#EEEEEE';
	 document.dimentions_form.width_inches.style.backgroundColor='#EEEEEE';
	 document.dimentions_form.depth_inches.style.backgroundColor='#EEEEEE';
	 document.dimentions_form.height_inches.style.borderStyle='none';
	 document.dimentions_form.width_inches.style.borderStyle='none';
	 document.dimentions_form.depth_inches.style.borderStyle='none';
	 document.dimentions_form.text_depth.style.backgroundColor='#FFFFFF';
	 document.dimentions_form.text_width.style.backgroundColor='#FFFFFF';
	 document.dimentions_form.text_height.style.backgroundColor='#FFFFFF';
	 document.dimentions_form.text_depth.style.borderStyle='';
	 document.dimentions_form.text_width.style.borderStyle='';
	 document.dimentions_form.text_height.style.borderStyle='';
	 document.dimentions_form.text_depth.readOnly=false;
	 document.dimentions_form.text_width.readOnly=false;
	 document.dimentions_form.text_height.readOnly=false;
	 document.dimentions_form.height_inches.readOnly=true;
	 document.dimentions_form.width_inches.readOnly=true;
	 document.dimentions_form.depth_inches.readOnly=true;
	 document.dimentions_form.text_height.focus();
   }

}


function enter_handle (field, event, salto, tipo) {
	var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
	if (keyCode == 13) {
		var i;
		for (i = 0; i < field.form.elements.length; i++)
			if (field == field.form.elements[i])
				break;
		
		i = (i + salto) % field.form.elements.length;
		if (field.form.elements[i] != null) {
			field.form.elements[i].focus();
			field.form.elements[i].select();
			return false;
		}
	} else
		if (tipo == 0)//validar numeros
			if ((keyCode >= 48 && keyCode <= 57) || (keyCode == 8) || (keyCode == 46) || (keyCode == 37) || (keyCode == 39))
				return true;
			else
				return false;
		else
			return true;
}

