title: Jquery datepicker inside jquery tabs
body: <p>I have a malfunctioning set of jquery datepickers that are only not working since I put them inside a jquery tabs plugin.</p>
  
  <p>Here are the codes:
  the main page(index):</p>
  
  <pre><code>   &lt;?php
  include 'all.php';
  ?&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta charset=iso-8859-1" /&gt;
          &lt;link type="text/css" href="css/smoothness/jquery-ui-1.8.21.custom.css" rel="Stylesheet" /&gt;
          &lt;link rel="stylesheet" type="text/css" href="css.css"&gt;&lt;/link&gt;
          &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt;    
          &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="maskMoney.js"&gt;&lt;/script&gt;
  
          &lt;title&gt;Financeiro&lt;/title&gt;
      &lt;/head&gt;
  
      &lt;body&gt;
          &lt;script&gt;
      $(function() {
          $( "#tabs" ).tabs({
              ajaxOptions: {
                  error: function( xhr, status, index, anchor ) {
                      $( anchor.hash ).html(
                          "Couldn't load this tab. We'll try to fix this as soon as possible. " +
                          "If this wouldn't be a demo." );
                  }
              }
          });
      });
      &lt;/script&gt;
  
  
          &lt;div&gt;
  &lt;div id="tabs"&gt;
      &lt;ul&gt;
          &lt;li&gt;&lt;a href="financeiro_ver.php"&gt;Buscar saída&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="financeiro_criar.php"&gt;Criar saída&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
              &lt;/div&gt;
          &lt;script type="text/javascript" src="view.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="create.js"&gt;&lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The javascript codes for the tabs (referring to the datepickers):
  tab 1 ( "Buscar saída" ):</p>
  
  <pre><code>$(
      function(){
          $("#data1 , #data2").datepicker({ 
              dayNames              : ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sabado"], 
              dayNamesMin           : ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"], 
              changeMonth           : true,
              changeYear            : true,
              monthNames            : ["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],
              monthNamesShort       : ["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],
              showAnim              : "fadeIn",
              dateFormat            : "yy-mm-dd"
          });
      }
      );
  </code></pre>
  
  <p>the tab 2 ( "Criar saída" ):</p>
  
  <pre><code>$(
      function(){
          $("#data").datepicker({ 
              dayNames              : ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sabado"], 
              dayNamesMin           : ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"], 
              changeMonth           : true,
              changeYear            : true,
              monthNames            : ["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],
              monthNamesShort       : ["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],
              showAnim              : "fadeIn",
              dateFormat            : "yy-mm-dd"
          });
      }
      );
  </code></pre>
  
  <p><strong>Problem</strong> : The respected javascript effects only happen the first time the tab is opened , if you chenge tabs and the change back it will crash. </p>
  
  <p>PS.: moneyMask is not working either (worked before tabs) , but I think its part of the same problem.</p>