window.addEvent('domready', function() {
	var Tips1 = new Tips($$('.Tips1'));
});
function calculo_comensales(url,org) {

  window.location.href = 'http://www.cocinarecetas.net/'+url+'&comensales='+$('comensales').getValue();
}
function votar (id,puntos) {
  
  ajax('recetas','votar','votar',id,'&puntos='+puntos,'votar');

}
function c_float() {
	this.value = this.value.replace(',','.');
  if (this.value.toFloat()) {
		  this.value = this.value.toFloat();
		} else {
			this.value = "";
		}
}
function me_gusta() {
var validado = 0;
$$('input.validate-one-required').each(function (el) {
  if (el.checked) {
    validado++;
  }
});
if (validado > 2) {
  $('megustaform').send();$('megusta').remove(); $('votar').innerHTML = '<img src="thm/img/actions_small/gtk-ok.png" /> Gracias por valorar la receta.';
} else {
  alert('Debes completar el formulario');
}
//
}
function num(v) {
  c_float.delay(500,v);
}
function suma() {
  var suma = $('tiempo_coccion').getValue().toFloat() + $('tiempo_preparacion').getValue().toFloat();
  $('tiempo_total').setProperty('value',suma);
}
function elejir_tipo(t,tipo) {
  // ocultamos el tipo de plato
  show_fade('tipo_plato','fade');
  
  // mostramos el formulario de recetas
  show_fade('formulario_receta','show');
  
  $('tipo_plato').setProperty('value',tipo);
  var span = new Element('span');
  span.appendText(t.getProperty('title'));
  span.injectAfter('titulo_receta');

}
