﻿$(document).ready(function() {
    var onMouseOutOpacity = 1;
    $('#thumbs ul.thumbs li').css('opacity', onMouseOutOpacity)
				.hover(
					function() {
					    $(this).not('.selected').fadeTo('fast', 1.0);
					},
					function() {
					    $(this).not('.selected').fadeTo('fast', onMouseOutOpacity);
					}
				);

		var gallery = $('#gallery').galleriffic('#thumbs', {
        delay: 3000,
        numThumbs: 16,
        preloadAhead: 10,
        enableTopPager: false,
        enableBottomPager: false,
        imageContainerSel: '#slideshow',
        controlsContainerSel: '#controls',
        captionContainerSel: '#caption',
        loadingContainerSel: '#loading',
        renderSSControls: true,
        playLinkText: '',
        pauseLinkText: '',
        prevLinkText: ' ',
        nextLinkText: ' ',
        nextPageLinkText: 'Next &rsaquo;',
        prevPageLinkText: '&lsaquo; Prev',
        enableHistory: true,
        autoStart: false,
        onChange: function(prevIndex, nextIndex) {
            $('#thumbs ul.thumbs').children()
						.eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
						.eq(nextIndex).fadeTo('fast', 1.0);
        },
        onTransitionOut: function(callback) {
            $('#slideshow, #caption').show('10', callback);
        },
        onTransitionIn: function() {
            $('#slideshow, #caption').show('10');
        },
        onPageTransitionOut: function(callback) {
            $('#thumbs ul.thumbs').fadeOut('fast', callback);
        },
        onPageTransitionIn: function() {
            $('#thumbs ul.thumbs').fadeIn('fast');
        }
    });
    
    $('#thumbs ul.thumbs li').css('opacity', onMouseOutOpacity)
				.hover(
					function() {
					    $(this).not('.selected').fadeTo('fast', 1.0);
					},
					function() {
					    $(this).not('.selected').fadeTo('fast', onMouseOutOpacity);
					}
				);

		var gallerylogo = $('#gallerylogo').galleriffic('#thumbslogo', {
        delay: 3000,
        numThumbs: 16,
        preloadAhead: 10,
        enableTopPager: false,
        enableBottomPager: false,
        imageContainerSel: '#slideshowlogo',
        controlsContainerSel: '#controlslogo',
        captionContainerSel: '#captionlogo',
        loadingContainerSel: '#loadinglogo',
        renderSSControls: true,
        playLinkText: '',
        pauseLinkText: '',
        prevLinkText: ' ',
        nextLinkText: ' ',
        nextPageLinkText: 'Next &rsaquo;',
        prevPageLinkText: '&lsaquo; Prev',
        enableHistory: true,
        autoStart: false,
        onChange: function(prevIndex, nextIndex) {
            $('#thumbslogo ul.thumbs').children()
						.eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
						.eq(nextIndex).fadeTo('fast', 1.0);
        },
        onTransitionOut: function(callback) {
            $('#slideshowlogo, #captionlogo').show('10', callback);
        },
        onTransitionIn: function() {
            $('#slideshowlogo, #captionlogo').show('10');
        },
        onPageTransitionOut: function(callback) {
            $('#thumbslogo ul.thumbs').fadeOut('fast', callback);
        },
        onPageTransitionIn: function() {
            $('#thumbslogo ul.thumbs').fadeIn('fast');
        }
    });
    
    
    //filiz galeri
    $('#thumbs ul.thumbs li').css('opacity', onMouseOutOpacity)
				.hover(
					function() {
					    $(this).not('.selected').fadeTo('fast', 1.0);
					},
					function() {
					    $(this).not('.selected').fadeTo('fast', onMouseOutOpacity);
					}
				);

		var gallerylogo = $('#galleryfiliz').galleriffic('#thumbsfiliz', {
        delay: 3000,
        numThumbs: 16,
        preloadAhead: 10,
        enableTopPager: false,
        enableBottomPager: false,
        imageContainerSel: '#slideshowfiliz',
        controlsContainerSel: '#controlsfiliz',
        captionContainerSel: '#captionfiliz',
        loadingContainerSel: '#loadingfiliz',
        renderSSControls: true,
        playLinkText: '',
        pauseLinkText: '',
        prevLinkText: ' ',
        nextLinkText: ' ',
        nextPageLinkText: 'Next &rsaquo;',
        prevPageLinkText: '&lsaquo; Prev',
        enableHistory: true,
        autoStart: false,
        onChange: function(prevIndex, nextIndex) {
            $('#thumbsfiliz ul.thumbs').children()
						.eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
						.eq(nextIndex).fadeTo('fast', 1.0);
        },
        onTransitionOut: function(callback) {
            $('#slideshowfiliz, #captionfiliz').show('10', callback);
        },
        onTransitionIn: function() {
            $('#slideshowfiliz, #captionfiliz').show('10');
        },
        onPageTransitionOut: function(callback) {
            $('#thumbsfiliz ul.thumbs').fadeOut('fast', callback);
        },
        onPageTransitionIn: function() {
            $('#thumbsfiliz ul.thumbs').fadeIn('fast');
        }
    });
});