$(document).ready(function(){	
			$("#slider").sudoSlider();
			
			$("#slider2").sudoSlider({
				numeric:true,
				prevNext:false,
				startSlide: 2
			}); 
			
			$("#slider3").sudoSlider({ 
				numeric: true,
				fade: true,
				prevNext: true,
				startSlide: 3,
				updateBefore: true,
				numericText:['slide1', 'slide2', 'third slide', 'number 4', 'last slide']
			});
			
			$("#slider4").sudoSlider({ 
				continuous: true,
				prevNext:true,
				numeric: true,
				fadespeed: '1200',
				insertAfter: false
			}); 
			$("#slider5").sudoSlider({ 
				vertical:true,
				numeric: true,
				autoheight: false,
				prevNext: true
			}); 
			$("#slider6").sudoSlider({ 
				history:true,
				numeric: true,
				prevNext: false,
				numericText:['slide 1', 'slide 2', 'third slide', 'number 4', 'last slide'],
				fade: true,
				updateBefore: true
			});	
			$("#slider7").sudoSlider({ 
				prevNext: false,
				customLink:'a.customLink',
				updateBefore:true
			});
			$("#slider8").sudoSlider({ 
				prevNext: false,
				ajax: ['ajax.html', 'images/02.jpg', 'images/07.jpg'],
				numeric:true,
				updateBefore:true
			});
			$("#slider9").sudoSlider({ 
				customLink:'a.customLink2',
				ajax: ['images/01.jpg', 'images/06.jpg', 'images/03.jpg'],
				continuous: true,
				clickableAni: true,
				imgAjaxFunction: function(t){
					var target = $(this).children();
					if (target.attr('oldheight') > target.width())
					{
						target.css('cursor' , 'pointer').click(function() {
							var maxheight = $(window).height() - 80;
							var maxwidth = $(window).width() - 40;
							var width = target.attr('oldwidth');
							var height = target.attr('oldheight');
							var imageUrl = target.attr("src");
							if (height > maxheight)
							{
								var ratio = width/height;
								var height = maxheight;
								var width = height * ratio;
							}
							if (width > maxwidth)
							{
								var ratio = height/width;
								var width = maxwidth;
								var height = width * ratio;
							}
							var modalhtml = "<p style='line-height:10px;'>This is slide number " + t + "</p><div style='width:" + width + "px;height:" + height + "px;'><img src='" + imageUrl + "'  style='width:" + width + "px;height:" + height + "px;' /></div>";
							jQuery.modal(modalhtml);
						}); 
					}
				}
			});
			
			$("#slider10").sudoSlider({ 
				prevNext: false,
				numeric:true,
				fade: true,
				crossFade: false,
				updateBefore:true
			});
			$("#slider11").sudoSlider({ 
				prevNext: false,
				fade: true,
				auto:true
			});
			$("#slider12").sudoSlider({ 
				prevNext: false,
				customLink:'a.eventclass'
			});
			$("#slider13").sudoSlider({ 
				prevNext: false,
				ajax: ['form.html', 'succes.html'],
				customLink:'a.eventlink'
			});
			$("#slider14").sudoSlider({ 
				prevNext: false,
				numeric: true,
				beforeAniFunc: function(t){ 
					$('div.descrip-text #anistate').text('Animating to slide ' + t).show(600);
					
				},
				afterAniFunc: function(t){ 
					$('div.descrip-text #anistate').hide(400);
					$('div.descrip-text #slidenumber').text(t);
					var text = $(this).children().attr('src');
					$('div.descrip-text #slidehtml').text(text);
				}
			});
			$("#slider15").sudoSlider();
			$("#slider16").sudoSlider({ 
				prevNext: true,
				updateBefore: true,
				numeric: true,
				currentFunc: function(){ 
					$(this).children().stop().fadeTo(500, 1).text('Current slide');
				},
				uncurrentFunc: function(t){ 
					$(this).children().stop().fadeTo(500, 0.4).text(t);
				}
			});
			var ajaximages = [
				'images/01.jpg', 
				'images/04.jpg', 
				'images/02.jpg', 
				'images/03.jpg', 
				'images/05.jpg'
			];
			var imagestext = [
				'Just another beautiful sunset', 
				'Behind another beautiful sunset',
				'Mountains in the Alps', 
				'Road and mountains in the Alps',
				'A goat in norway',
			];
			$("#slider17").sudoSlider({ 
				fade:true,
				continuous:true,
				ajax: ajaximages,
				imgAjaxFunction: function(t){
					$(this).css("position","relative").append('<div class="caption">' + imagestext[t-1] + '</div>');
				},
				beforeAniFunc: function(t){ 
					$(this).children('.caption').hide();
					
				},
				afterAniFunc: function(t){ 
					$(this).children('.caption').slideDown(400);
				}
			});
			
			// Little fix. 
			$('a').each(function() { if (!$(this).attr('href')) $(this).css('text-decoration', 'none'); });
		});	
		
