jQuery(document).ready(function() {
    
    var pathname = window.location.href;
      
    jQuery('.categories a').click(function() {
      var current = jQuery(this).attr("class");
      var remove = jQuery('.list-events .active').attr("id");
      
      var currentWithoutAction = jQuery.trim(current.replace('action', ''));
      
      if( currentWithoutAction != remove ) {
      
        jQuery('.currenth2').removeClass();
        jQuery('#' + remove).hide();
        jQuery('#' + remove).removeClass('active');      
        jQuery('#' + current.replace('action', '')).show();
        jQuery('#' + current.replace('action', '')).addClass('active');
        jQuery(this).parent('h2').addClass('currenth2');
        
        var actionClass = jQuery('.action').attr('class');
        var oldClass = actionClass.replace('action', '');
        if(actionClass != jQuery(this).attr('class')) jQuery('.action').attr('class', oldClass);
        
        if(jQuery(this).attr('class') == current) { 
          
          jQuery('.action').attr('class', oldClass);
          jQuery(this).attr('class', current + ' action');
          
        }
        
      }     

    });
    
    jQuery('#input_1_1').attr("readonly", true);
    jQuery('#input_2_1').attr("readonly", true);
    
    jQuery('#order-button').click(function() {
      jQuery('.inner .gform_wrapper').addClass('show');
      jQuery('#order-button').hide();
    });
    
    jQuery('.pass-input').focus(function() {
			value=jQuery(this).val();
			jQuery(this).attr("value","");
		});
		jQuery('.pass-input').blur(function() {
			if(jQuery(this).val()=="") {
				jQuery(this).val(value);
			}
		});
		
		jQuery('#post-comment-link').click(function() {
      jQuery('.comments').show();
    });
    
    jQuery(function () { 
      if( pathname.indexOf('#respond') > 0 ) jQuery('.comments').show();
    });
    
});
