jQuery(function(){
    
    var tabContainers = jQuery('div.tabs > div');
    tabContainers.hide().filter(':first').show();

    var openSecondTab = function() {
        jQuery(function(){
            tabContainers.hide();
            var obj = jQuery('div.tabs ul.tabNavigation a');
            tabContainers.filter('#second').show();
            jQuery('div.tabs ul.tabNavigation a').removeClass('active');
            jQuery('.w2 a').addClass('active');
        });
      
    }
   
    jQuery('div.tabs ul.tabNavigation a').click(function () {
        
        if (jQuery(this).attr('href') == '/add') {
            return true;
        }
        tabContainers.hide();        
        tabContainers.filter(this.hash).show();
        jQuery('div.tabs ul.tabNavigation a').removeClass('active');
        
        jQuery(this).addClass('active');
        return false;
    }).filter(':first').click();
    jQuery(".tabNavigation li:nth-child(2n)").addClass("w2");
    jQuery(".tabNavigation li:nth-child(3n)").addClass("w3");
    jQuery(".tabNavigation li a").append("<span>&nbsp;</span>");
    jQuery("#third li:odd").addClass("odd");
    jQuery("#third li:last").addClass("last");
        
    jQuery('.add-button').click(function(){
       
       /*
        if(
            document.location.href.indexOf('/news') != -1 ||
            document.location.href.indexOf('/actions') != -1 ||
            document.location.href.indexOf('/questions') != -1 ||
            document.location.href.indexOf('/pages/contacts') != -1 ) {
            jQuery('body').prepend('<form method="post" id="h-form" action="/"><input type="hidden" value="2" name="show_search_form_tab"></form>');       
            jQuery('#h-form').submit();
        } 
        */
    });
    
     jQuery('.add-button').click(function(){
         
        
        if (ut == "" && jQuery('div').is('.searchFrmContent')) { 
            tabContainers.hide();
            var obj = jQuery('div.tabs ul.tabNavigation a');
            tabContainers.filter('#second').show();
            jQuery('div.tabs ul.tabNavigation a').removeClass('active');
            jQuery('.w2 a').addClass('active');
       
            return false;
        } else if(ut == "") {
            window.location.href="/addselect";
            return false;
        } else {
            return true;
        }
    });
    
   
    
  
});
 
 
 
