		$(document).ready(function(){	
			$("#slider").easySlider({
				auto: true, 
				continuous: true,
				pause:	2000,
				speed: 1000
			});
		});	
		
		$(document).ready(function(){	
			$("#slider2").easySlider({
				auto: false, 
				continuous: true,
			});
		});	
		
	var aImages = new Array();
	var aURL = new Array();
	var aArtists = new Array();
	var iPrev = -1;
	var iRnd = -1;
	
	aImages[0] = "http://www.visaandeschelde.nl/images/bg_1.jpg";
	aImages[1] = "http://www.visaandeschelde.nl/images/bg_2.jpg";
	aImages[2] = "http://www.visaandeschelde.nl/images/bg_3.jpg";
	aImages[3] = "http://www.visaandeschelde.nl/images/bg_4.jpg";
	aImages[4] = "http://www.visaandeschelde.nl/images/bg_5.jpg";
	aImages[5] = "http://www.visaandeschelde.nl/images/bg_6.jpg";
	aImages[6] = "http://www.visaandeschelde.nl/images/bg_7.jpg";
	
	aURL[0] = "";
	aURL[1] = "";
	
	$(document).ready(function() {
	
		/* Define the function that triggers to fade in the background as soon as the image has loaded */
		$("img#bg").load(function()
			{
				/* Fade in during 3 seconds */
				$("img#bg").fadeTo(100,1);
				
				/* Animate the picture description during 1 second */
				setTimeout(function() { $("#image_description").animate({right: '+=150'}, 1000) }, 1000);
			
				/* Set the timeout to fade out the image and the description after 10 seconds*/
		    	setTimeout(function() 
			    	{
			    		$("#image_description").animate({right: '-=150'}, 1000);
			    		$("img#bg").fadeOut(4000);
			    		
			    		/* Load the next image after 4 seconds */
			    		setTimeout(LoadImages,4000);
			    	}
			    	,10000);
			}			
		)
	
		/* Start the slideshow one second after the page is ready */ 
		setTimeout(LoadImages,10);
		
    });

    function LoadImage(iNr)
	{
	
		/* Assign the new image to the background */
		$("img#bg").attr("src", aImages[iNr]);
 		
 		/* Assign the artist name to the description */
 		$("#image_artist").html(aArtists[iNr]);
 		
 		/* Assign the image url to the description */
        $("a#image_url").attr("href", aURL[iNr]);
        $("a#image_url").html("");
                        	
    };
    
    function LoadImages()
    {
    	
    	/* Select a random image number and make sure this is not equal to the previous image */
    	while(iPrev == iRnd)
    	{
    		iRnd = Math.floor(Math.random()*aImages.length);
    	}
    	
    	/* Show the selected image */
    	LoadImage(iRnd);
    	
    	iPrev = iRnd;
    	
    };

	
  var screenwidth = screen.width;
    if (screenwidth > 1400) {
      document.write('<link rel="stylesheet" href="http://www.visaandeschelde.nl/stylesheet/1400.css" type="text/css" media="screen" />');
    }
    else {
      document.write('');
    }
	
	
