
function show_subf (subf, oper) {

   or = 'bl' + subf;
   id = 'sf' + subf;

   if ( oper ) {
      ttop = parseInt (document.getElementById (or).offsetTop) + 14;
      tlef =  -30;
      document.getElementById (id).style.top = ttop + 'px';
      document.getElementById (id).style.left = tlef + 'px';
      document.getElementById (id).style.display = 'block';
   } else {
      document.getElementById (id).style.display = 'none';
   }

}


function obre_info (prod) {

   document.getElementById ('info').producte.value = prod;

   if ( document.getElementById ('formInfo').style.display == 'block' ) {
      document.getElementById ('formInfo').style.display = 'none';
      document.getElementById ('vel').style.display = 'none';
   } else {
      document.getElementById ('onsom').style.display == 'none';
      document.getElementById ('contacte').style.display == 'none';
      document.getElementById ('vel').style.display = 'block';
      showRecaptcha ('recaptchaInfo');
      document.getElementById ('formInfo').style.display = 'block';
   }

}


function check_imgs (prod, imag, imgs) {

   for (i = 0; i < imgs; i++) {
      document.getElementById ('prod'+prod+'Xid'+i).className = 'BotigaProdFlotXidi';
      document.getElementById ('prod'+prod+'Mid'+i).className = 'BotigaProdFlotMidi';
      document.getElementById ('prod'+prod+'Min'+i).className = 'BotigaProdFlotMini';
   }
   document.getElementById ('prod'+prod+'Min'+imag).className = 'BotigaProdFlotMiniAct';
   document.getElementById ('prod'+prod+'Mid'+imag).className = 'BotigaProdFlotMidiAct';
   document.getElementById ('prod'+prod+'Xid'+imag).className = 'BotigaProdFlotXidiAct';
   
}


function showRecaptcha (element) {
   Recaptcha.destroy ();
   Recaptcha.create ("6LcOZMgSAAAAABRMRSJ0d98vF90PXkOsMZs0NHpL", element, {
      tabindex: 0,
      callback: Recaptcha.focus_response_field
   });
}

