jQuery.noConflict();

jQuery(document).ready(function () {
  jQuery('#sitemap').css('display', 'none');
	jQuery('.toggleSitemap').toggle(
    function(){ // you can add as much here as you'd lik
      jQuery('#sitemap').height('190px');
         jQuery('#sitemap').slideDown('slow');
         //jQuery('#imgArrows').attr('src','fileadmin/templates/images/sitemap-up.gif');
    }, function() { // same here
         jQuery('#sitemap').slideUp('slow');
         //jQuery('#imgArrows').attr('src','fileadmin/templates/images/sitemap-down.gif');
    }
  );
  
  // We only want these styles applied when javascript is enabled
	jQuery('div.navigation').css({'width' : '196px', 'float' : 'right', 'height' : '342px', 'overflow' : 'auto' });
	jQuery('div.content').css('display', 'block');

	// Initially set opacity on thumbs and add
	// additional styling for hover effect on thumbs
	var onMouseOutOpacity = 0.67;
	jQuery('#thumbs ul.thumbs li').opacityrollover({
		mouseOutOpacity:   onMouseOutOpacity,
		mouseOverOpacity:  1.0,
		fadeSpeed:         'fast',
		exemptionSelector: '.selected'
	});
	
	// Initialize Advanced Galleriffic Gallery
	var gallery = jQuery('#thumbs').galleriffic({
		delay:                     2500,
		numThumbs:                 15,
		preloadAhead:              10,
		enableTopPager:            false,
		enableBottomPager:         false,
		maxPagesToShow:            7,
		imageContainerSel:         '#slideshow',
		controlsContainerSel:      '#controls',
		loadingContainerSel:       '#loading',
		renderSSControls:          false,
		renderNavControls:         false,
		prevLinkText:              '&lsaquo; Previous Photo',
		nextLinkText:              'Next Photo &rsaquo;',
		nextPageLinkText:          'Next &rsaquo;',
		prevPageLinkText:          '&lsaquo; Prev',
		enableHistory:             false,
		autoStart:                 false,
		syncTransitions:           true,
		defaultTransitionDuration: 900,
		onSlideChange:             function(prevIndex, nextIndex) {
			// 'this' refers to the gallery, which is an extension of $('#thumbs')
			this.find('ul.thumbs').children()
				.eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
				.eq(nextIndex).fadeTo('fast', 1.0);
		},
		onPageTransitionOut:       function(callback) {
			this.fadeTo('fast', 0.0, callback);
		},
		onPageTransitionIn:        function() {
			this.fadeTo('fast', 1.0);
		}
	});
	// this initialises the demo scollpanes on the page.
  jQuery('#thumbs').jScrollPane();
  
});
