/*$().ready(function() {
        $('#coda-slider-1').codaSlider({
           firstPanelToLoad: 1,
           autoHeightEaseDuration: 200,
           autoHeightEaseFunction: "easeInBounce",
           slideEaseDuration: 200,
           slideEaseFunction: "easeInBounce",
           dynamicArrows: false,
           dynamicTabs: false
       });
});     */

function bookmarksite(title, url){
    if (document.all)
    window.external.AddFavorite(url, title);
    else if (window.sidebar)
    window.sidebar.addPanel(title, url, "")
}

/* olivier raveau tubbydev aout 2011 */
         function LoadSubOption(gad) {
         jQuery('#expertise_loading').show();
         selInd = gad.selectedIndex;
         idOption = gad.options[selInd].value;

         var data = new Object()
         data["code"]        = idOption;
         if( !jQuery('#majselect') ){
         data["spot"]            = "register";
         } else {
           if( jQuery('#majselect').val() == 1 ){
           data["spot"]            = "maj";
           } else{    
           data["spot"]            = "register";
           }
         }
                        
          jQuery.ajax({
            type: "POST",
            url: "<?php echo get_bloginfo('template_directory'); ?>/ajax-recup-tree-infos.php",
            data: data,
            success: function(msg){           
              //alert( "Data Saved: " + msg );
              if(msg==0){
              //alert("Merci de le modifier");
              }else{
              jQuery('#metiers_selected').html(msg);
              }   
              jQuery('#expertise_loading').hide();   
            }  
          });

         }
             
         function VerifCheck(){
           tabchecks=document.getElementsByName("expertise2[]")
           var compteur=0
           var i=-1;
           while (tabchecks[++i]){tabchecks[i].checked && compteur++}
            if(compteur>3){
             alert('Vous pouvez choisir jusqu\'à 3 fonctions');
             return false;
            }
           return true;
         }             
         function VerifCheckLive(){
           tabchecks=document.getElementsByName("expertise2[]")
           var compteur=0
           var i=-1;
           while (tabchecks[++i]){tabchecks[i].checked && compteur++}
            if(compteur>3){
             alert('Vous pouvez choisir jusqu\'à 3 fonctions');
             return false;
            }
           return true;
         }               
         function VerifCheckLive2(){
           tabchecks=document.getElementsByName("secteur_activite[]")
           var compteur=0
           var i=-1;
           while (tabchecks[++i]){tabchecks[i].checked && compteur++}
            if(compteur>3){
             alert('Vous pouvez choisir jusqu\'à 3 secteurs d\'activité');
             return false;
            }
           return true;
         }  
         function VerifCheckLiveSecteur(iz,str,parent1,parent2){
           if(parent1!=0){
             jQuery("#chek_"+parent1).attr('checked', false);
           }        
           if(parent2!=0){
             jQuery("#chek_"+parent2).attr('checked', false);
           }        

           //alert(str);
           if(iz.checked){
           jQuery('#listcheckbox_'+str).show();
           }else{    
           jQuery('#listcheckbox_'+str).hide();
           }

           return true;
         }
         function VerifCheckLiveMetier(iz,str,parent1,parent2){
           if(parent1!=0){
             //jQuery("#chek_"+parent1).attr('checked', false);
           }        
           if(parent2!=0){
             //jQuery("#chek_"+parent2).attr('checked', false);
           }        

           //alert(str);
           if(iz.checked){
           jQuery('#listcheckbox_'+str).show();
           }else{    
           jQuery('#listcheckbox_'+str).hide();
           }

           return true;
         }

//-->

function showMe (it, box) {
  var vis = (box.checked) ? "block" : "none";
  document.getElementById(it).style.display = vis;
}

jQuery(document).ready(function(){                      
    jQuery('ul#listeoptions1').collapsibleCheckboxTree();
    jQuery('ul#listeoptions2').collapsibleCheckboxTree();
});
