var Pedigree = {
	carousel: function()
	{
		jQuery(function( $j ){
			//borrowed from jQuery easing plugin
			//http://gsgd.co.uk/sandbox/jquery.easing.php
			$j.easing.backout = function(x, t, b, c, d){
				var s=1.70158;
				return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
			};
			
			$j('#screen').scrollShow({
				view:'#view',
				content:'#images',
				easing:'backout',
				wrappers:'link,crop',
				navigators:'a[id]',
				navigationMode:'s',
				circular:true,
				start:0,
				counter: '#image_counter'
			});
		});
	},
	carouselWeek: function()
	{
		jQuery(function( $j ){
			//borrowed from jQuery easing plugin
			//http://gsgd.co.uk/sandbox/jquery.easing.php
			$j.easing.backout = function(x, t, b, c, d){
				var s=1.70158;
				return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
			};
			
			$j('#screen_week').scrollShow({
				view:'#view_week',
				content:'#images_week',
				easing:'backout',
				wrappers:'simple',
				navigators:'a[id]',
				navigationMode:'s',
				circular:true,
				start:0,
				counter: '#counter',
				itemSize:{
					width:200,
					height:156
				}
			});
		});
	},
	carouselList: function()
	{
		jQuery(function( $j ){
			//borrowed from jQuery easing plugin
			//http://gsgd.co.uk/sandbox/jquery.easing.php
			$j.easing.backout = function(x, t, b, c, d){
				var s=1.70158;
				return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
			};
			
			$j('#screen_dogs').scrollShow({
				view:'#view_dogs',
				content:'#images_dogs',
				easing:'backout',
				wrappers:'simple',
				navigators:'a[id]',
				navigationMode:'s',
				circular:true,
				start:0,
				counter: '#counter',
				itemSize:{
					width:136,
					height:94
				}
			});
		});
	},
	submitPager: function( form_name, page )
	{
		el = document.createElement('input');
		el.setAttribute("type", "hidden");
		el.setAttribute("name", "page");
		el.setAttribute("value", page);
		form = document.getElementById(form_name);
		form.appendChild(el);
		form.submit();
	},
	submitPagerAjax: function( form_name, update, url, page )
	{
		$('pager-indicator-doglist').show();

		form = document.getElementById(form_name);
		
		new Ajax.Updater(update, url,
				{
					asynchronous:true,
					evalScripts:false,
					parameters: Form.serialize(form) + '&page=' + page,
					oncomplete:
						function()
						{
							$('pager-indicator-doglist').hide()
						}
				}
		);

		return false;
	},
	mapReset: function()
	{
		if ( map )
		{
			map.checkResize();
			map.setCenter( new GLatLng(47.4984030, 19.0407590, 6) );
		}
	}
}