$(document).ready(function () {
	var $panels;
	var $container;
	var horizontal = true;
	var $scroll;
	var offset;
	
	var scrollOptions = {
		target: $scroll, // the element that has the overflow	  
		// can be a selector which will be relative to the target
		items: $panels,	  
		navigation: '.navigation a',	  
		// selectors are NOT relative to document, i.e. make sure they're unique
		prev: 'img.left',
		next: 'img.right',	  
		// allow the scroll effect to run both directions
		axis: 'xy',

		onAfter: trigger, // our final callback	  
		offset: offset,	  
		// duration of the sliding effect
		duration: 500,	  
		// easing - can be used with the easing plugin: 
		// http://gsgd.co.uk/sandbox/jquery/easing/
		easing: 'swing'
	};	
	
		
	$panels = $('#slider0 .scrollContainer > div');
	$container = $('#slider0 .scrollContainer');

	if (horizontal) {
		$panels.css({'float' : 'left','position' : 'relative'});
		$container.css('width', $panels[0].offsetWidth * $panels.length);
	}

	$scroll = $('#slider0 .scroll').css('overflow', 'hidden');

	// apply our left + right buttons
	$scroll
	  .before('<img class="scrollButtons left" src="images/arrow_left.png" alt="Önceki" title="Önceki" />')
	  .after('<img class="scrollButtons right" src="images/arrow_right.png" alt="Sonraki" title="Sonraki" />');

	// handle nav selection
	function selectNav() {
		$(this).parents('ul:first').find('a').removeClass('selected').end().end().addClass('selected');
	}

	$('#slider0 .navigation').find('a').click(selectNav);

	// go find the navigation link that has this target and select the nav
	function trigger(data) {
	  var el = $('#slider0 .navigation').find('a[href$="' + data.id + '"]').get(0);
	  $('#group_title').html($('#'+data.id+' .group_title').html());
	  //selectNav.call(el);
	}

	if (window.location.hash) {
	  trigger({ id : window.location.hash.substr(1) });
	} else {
	  $('ul.navigation a:first').click();
	}

	// offset is used to move to *exactly* the right place, since I'm using
	// padding on my example, I need to subtract the amount of padding to
	// the offset.  Try removing this to get a good idea of the effect
	offset = parseInt((horizontal ? 
	  $container.css('paddingTop') : 
	  $container.css('paddingLeft')) 
	  || 0) * -1;



	scrollOptions.items = $panels;
	scrollOptions.target = $scroll;
	scrollOptions.offset = offset;
	scrollOptions.onAfter = trigger;
	scrollOptions.duration = 500;

	$('#slider0').serialScroll(scrollOptions);


	});
