jQuery(document).ready(function() {
  jQuery("input, textarea").focus(
   function()
   {
    // only select if the text has not changed
    if(this.value == this.defaultValue)
    {
     this.select();
    }
   }
  )
  jQuery("a.callpopin").popin({
    width:640,
    height:560,
    className: 'fiche-produit',
    loaderImg : '../images/fiche_produit/ajax-loader.gif',
    onComplete: function() {
      jQuery("a.bouton-print").click(function(){
        open(this.href);
        return false;
      });
    }
  });
  if (jQuery('div#fiche-print').length){
    window.print();
    window.close();
  }
});
