(function( $ ){
  
  var methods = {
    init : function( options ) { 
		$('.locator-tab-content').hide();
		$('.locator-tab-content:first').show();
		//this.each(function(){
		// $(this).children('.faq-section-questions').hide();
		 //$(this).children('.faq-section-header').css('float','left');
		// $(this).children('.faq-section-header').after('<button class="faq-section-toggle"/>');
		// $(this).children('.faq-section-toggle').addClass('faq-section-toggle-open');
		// var orig = $(this).html();
		 //$(this).replaceWith('<div');
       //});
		
		$(this).find('li a').click(function() {

			var $parent = $(this).closest('ul');
			$('li', $parent).removeClass('selected');
			var $clickedIndex = $('li a', $parent).index(this);
			
			$('.locator-tab-content').hide();
			var $curpane = $('.locator-tab-content')[parseInt($clickedIndex)];
			var $curtab = $('li', $parent)[$clickedIndex];
			$($curpane).show();
			$($curtab).addClass('selected');
			
			//var el = $(this).next('.faq-section-questions');
			//el.toggle();
			//if (el.is(':visible')) {
			  //$(this).addClass('faq-section-toggle-close');
			  //$(this).removeClass('faq-section-toggle-open');
			//} else {
			  //$(this).addClass('faq-section-toggle-open');
			  //$(this).removeClass('faq-section-toggle-close');
			//}
			return false;
		 });
	}
  };

  
  $.fn.locator = function( method ) {
  
    // Do your awesome plugin stuff here
    this.each(function() {
      //$(this).slideToggle();
    });
	// Method calling logic
    if ( methods[method] ) {
      return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
    } else if ( typeof method === 'object' || ! method ) {
      return methods.init.apply( this, arguments );
    } else {
      $.error( 'Method ' +  method + ' does not exist on jQuery.locator' );
    }    

  };
})( jQuery );


