$(document).addEvent('domready', function () {
	var data = new Request.JSON({
		url: '/images?format=json',
		onSuccess: function (result) {
			if(!result) return;
			var left = new Slideshow('slideshow', result.items, {
				width:180,
				height: 290,
				loader: {'animate': ['/image/slideshow/loader-#.png', 12]},
				resize:'length',
				delay:5000,
				paused:false,
				controller:false,
				loop:true,
				captions:false,
				titles:false,
				linked:false,
				lightbox:false,
				onStart:function()
				{
					var img = (this.counter % 2) ? this.a : this.b;
					img.fade('out');
				}
			});
		}
	}).get();
	var element = null;
	if(element = $('content').getElements('div.images') && typeof(Lightbox) != 'undefined')
	{
		var lightbox = new Lightbox();
	}
	var showroom = null;
	if(showroom = $('showroom'))
	{
		var data = new Request.JSON({
			url: '/images/showroom?format=json',
			onSuccess: function (result) {
				if(!result) return;
				var slideshow = new Slideshow(showroom,
					result.items,
					{
						loader: {'animate': ['/image/slideshow/loader-#.png', 12]},
						delay:5000,
						paused:false,
						controller:true,
						loop:true,
						captions:true,
						titles:false,
						linked:true,
						lightbox:false,
						center:true,
						resize:'length',
						onStart:function()
						{
							var img = (this.counter % 2) ? this.a : this.b;
							img.fade('out');
						}
					}
				);
				
			}
		}).get();
	}
	var lady = null;
	if(lady = $('sensuallady'))
	{
		var data = new Request.JSON({
			url: '/images/sensuallady?format=json',
			onSuccess: function (result) {
				if(!result) return;
				var slideshow = new Slideshow(lady,
					result.items,
					{
						loader: {'animate': ['/image/slideshow/loader-#.png', 12]},
						delay:5000,
						paused:false,
						controller:true,
						loop:true,
						captions:true,
						titles:false,
						linked:true,
						lightbox:false,
						center:true,
						resize:'length',
						onStart:function()
						{
							var img = (this.counter % 2) ? this.a : this.b;
							img.fade('out');
						}
					}
				);
				
			}
		}).get();
	}
});

