	jQuery.noConflict();
	jQuery(document).ready(function(jQuery){ 
		// Disable Right Click
		jQuery(document).bind("contextmenu",function(e) {
			return false;
		});
		jQuery("input, textarea").addClass("idle");
		jQuery("input, textarea").focus(function() {
			jQuery(this).addClass("activeField").removeClass("idle");
		}).blur(function(){
			jQuery(this).removeClass("activeField").addClass("idle");
		});

		// We only want these styles applied when javascript is enabled
		jQuery('div.content').css('display', 'block');

		// Initially set opacity on thumbs and add
		// additional styling for hover effect on thumbs
		var onMouseOutOpacity = 1.0;
		jQuery('#thumbs ul.thumbs li').opacityrollover({
			mouseOutOpacity:   onMouseOutOpacity,
			mouseOverOpacity:  8.0,
			fadeSpeed:         'slow',
			exemptionSelector: '.selected'
		});

		// Initialize Advanced Galleriffic Gallery
		var gallery = jQuery('#thumbs').galleriffic({
			delay:                     2500,
			numThumbs:                 20,
			preloadAhead:              40,
			enableTopPager:            true,
			enableBottomPager:         true,
			maxPagesToShow:            10,
			imageContainerSel:         '#slideshow',
			controlsContainerSel:      '#controls',
			captionContainerSel:       '#caption',
			loadingContainerSel:       '#loading',
			renderSSControls:          true,
			renderNavControls:         true,
			playLinkText:              'Play Slideshow',
			pauseLinkText:             'Pause Slideshow',
			prevLinkText:              '&lsaquo; Previous Photo',
			nextLinkText:              'Next Photo &rsaquo;',
			nextPageLinkText:          'Next &rsaquo;',
			prevPageLinkText:          '&lsaquo; Prev',
			enableHistory:             false,
			autoStart:                 false,
			syncTransitions:           true,
			defaultTransitionDuration: 900,
			onSlideChangeOut:          function(prevIndex) {
				// 'this' refers to the gallery, which is an extension of $('#thumbs')
				this.find('ul.thumbs').children()
					.eq(prevIndex).fadeTo('fast', onMouseOutOpacity);
			},
			onSlideChangeIn:           function(nextIndex) {
				this.find('ul.thumbs').children()
					.eq(nextIndex).fadeTo('fast', 1.0);
			},
			onPageTransitionOut:       function(callback) {
				this.fadeTo('fast', 0.0, callback);
			},
			onPageTransitionIn:        function() {
				this.fadeTo('fast', 1.0);
			}
		});
		jQuery(".thumb").click(function() {
			jQuery.scrollTo( '#controls', 800 );
		});
		jQuery(".advance-link img").live('click', function() {
			jQuery.scrollTo( '#controls', 800 );
		});
	});
