// JavaScript Document
	jQuery().ready(function(){
		
		// second simple Accordion with special markup
		jQuery('#navigation').Accordion({
			active: false,
			header: '.head',
			navigation: true,
			event: 'click',
			autoheight: true,
			animated: 'easeslide'
		});
		
		
		var wizard = $("#wizard").Accordion({
			header: '.title',
			event: false
		});
		
		$("div.title", wizard).each(function(index) {
			$(this)
			.next()
			.children(":button")
			.filter(".next, .previous")
			.click(function() {
				wizard.activate(index + ($(this).is(".next") ? 1 : -1))
			});
		});
		// bind to change event of select to control first and seconds accordion
		// similar to tab's plugin triggerTab(), without an extra method
		jQuery('#switch select').change(function() {
			jQuery('#list1, #list2, #list3, #navigation').activate( this.selectedIndex-1 );
		});
		jQuery('#close').click(function() {
			jQuery('#list1, #list2, #list3, #navigation').activate(-1);
		});
		jQuery('#switch2').change(function() {
			jQuery('#list1, #list2, #list3, #navigation').activate(this.value);
		});
		
		
		$('div#form').hide();
		$('span.hideSearch').hide();
		$('span.showSearch').click(function() {
					$('div#form').show('slow');
					$(this).hide();
					$('span.hideSearch').show();
					});
		$('span.hideSearch').click(function() {
				$('div#form').hide('slow');
				$(this).hide();
				$('span.showSearch').show();
				});

     
  function filterPath(string) {
          return string
            .replace(/^\//,'') 
            .replace(/(index|default).[a-zA-Z]{3,4}$/,'') 
            .replace(/\/$/,'');
        }
        $('a[href*=#]').each(function() {
          if ( filterPath(location.pathname) == filterPath(this.pathname)
          && location.hostname == this.hostname
          && this.hash.replace(/#/,'') ) {
            var $targetId = $(this.hash), $targetAnchor = $('[name=' + this.hash.slice(1) +']');
            var $target = $targetId.length ? $targetId : $targetAnchor.length ? $targetAnchor : false;
             if ($target) {
               var targetOffset = $target.offset().top;
               $(this).click(function() {
                 $('html, body').animate({scrollTop: targetOffset}, 800);
                 return false;
               });
            }
          }
        });

		
// Hide all synopsis divs	initially
		$('div.synopsis').hide();
// Hide all the <span="hideSynopsis"> initially
		$('span.hideSynopsis').hide();
// this is the clickable function you want to target
		$('span.showSynopsis').click(function() {
					// Show only the div.synopsis that is a sibling of this span.hideSynopsis
					$(this).siblings('div.synopsis').show('slow');
					// hide only this span.showSynopsis
					$(this).hide();
					// Show span.hideSynopsis
					$(this).siblings('span.hideSynopsis').show();

					});
		$('span.hideSynopsis').click(function() {
				// Hide only the div.synopsis that is a sibling of this span.hideSynopsis
				$(this).siblings('div.synopsis').hide('slow');																											
				// Hide only this span.hideSynopsis 
				$(this).hide();
				// Show only span.showSynopsis that is a sibling of this span.hideSynopsis
				$(this).siblings('span.showSynopsis').show();

				});
	  

	});
