/** INFO BAR VARIABLES
 *
 *  To update the info bar with the latest event information edit the variables below
*/
var event_description = "Eric A. Yancy M.D. - in concert";  // sets the event description for the info bar
var event_date = "Saturday May 23, 2009 @ 6pm";  // sets the event date for the info bar
var event_location = "Mt. Pilgrim Baptist Church - 9700 Scenic Highway, Baton Rouge, Louisiana";  // sets the event location for the info bar

/** DO NOT EDIT BELOW THIS LINE -------------------------------------------------------------------------------------------*/

$.thursdayproductions = (function(current_page){
  
  $("#menu_highlight_cap").fadeIn('slow');
  $("#menu_highlight_bkg").fadeIn('slow').animate({ 
    width: $('#'+current_page).width() - 8 + "px"
  }, 500 );
  
  $("#menu_highlight").animate({ 
    left: $('#'+current_page)[0].offsetLeft + "px"
  }, 500 );  
  
  $("ul#header_menu").hover(
    function(){
    },
    function(){
      $("#menu_highlight").animate({ 
        left: $(this).children('#'+current_page)[0].offsetLeft + "px"
      }, 500 );
      
      $("#menu_highlight_bkg").animate({ 
        width: $('#'+current_page).width() - 8 + "px"
      }, 500 );
    }
  );
	
	$("ul#header_menu > li").hover(
		function(){
			if ( $(this).children("ul.submenu").length > 0 ) { $(this).children("ul.submenu").slideToggle(); }
      $("#menu_highlight").animate({ 
        left: this.offsetLeft + "px"
      }, 100 );
      
      $("#menu_highlight_bkg").animate({ 
        width: $(this).width() - 8 + "px"
      }, 100 );
		},
		function(){
			if ( $(this).children("ul.submenu").length > 0 ) { $(this).children("ul.submenu").slideToggle(); }
    }
  );
  
  $("ul.submenu > li > a").hover(
    function(){
      $(this).animate({ 
        paddingLeft: 17 + "px"
      }, 200 );
    },
    function(){
      $(this).animate({ 
        paddingLeft: 0 + "px"
      }, 200 );      
    }
  ); 
	
	$(".bd_songs > ol > li > a").hover(
    function(){
      $(this).animate({ 
        paddingLeft: 17 + "px"
      }, 200 );
    },
    function(){
      $(this).animate({ 
        paddingLeft: 0 + "px"
      }, 200 );      
    }
  );
  
  
  //----------------------------------- Join Mailing List --------------------------------------------------
  
  //trigger ajax on submit
  $('#contactForm').submit( function(){
    
    //hide the form
    $('#contactForm').hide();
    
    //show the loading bar
    $('.loader').append($('.bar')); 
    $('.bar').css({display:'block'});
    
    //send the ajax request  
    $.get('http://www.thursdayproductions.com/join_mailing_list.php',{process:$('#process').val(), join_email:$('#join_email').val()},  
      //return the data
      function(data){
        //hide the graphic
        $('.bar').css({display:'none'}); 
        if (data == 1) {
          $('.join_mailing_list_thanks').show();
          $('.join_mailing_list_error').hide();
          //$('.loader').append(data);
        } else {
          $('#contactForm').show();
          $('.join_mailing_list_error').show();
        }  
      }
    );
      
    //stay on the page          
    return false;  
  });  
    
});