 // Create an array of images that you'd like to use
    var images = [
        "img/backstretch/68792.jpg",
        "img/backstretch/68587_v2.jpg",
		"img/backstretch/68833.jpg"
    ];

    // The index variable will keep track of which image is currently showing
    var index = 0;

    // Call backstretch for the first time,
    // In this case, I'm settings speed of 500ms for a fadeIn effect between images.
    $.backstretch(images[index], {speed: 500});

    // Set an interval that increments the index and sets the new image
    // Note: The fadeIn speed set above will be inherited
    setInterval(function() {
        index = (index >= images.length - 1) ? 0 : index + 1;
        $.backstretch(images[index]);
    }, 5000);
	
	
	 $(document).ready(function() {
		
		$(".fancybox").fancybox();

		$("#liColl").mouseover(function () {
			$(this).addClass("selected");
		});

		$("#liColl ul").mouseover(function () {
			$(this).parent().addClass("selected");
		});

		$("#liColl").mouseout(function () {
			$(this).removeClass("selected");
		});

		$("#liColl ul").mouseout(function () {
			$(this).parent().removeClass("selected");
		});

		$(".close").click(function () {
			$("#collectionwin").slideUp(); 
			$("#aboutwin").slideUp(); 	
			$("#contactwin").slideUp();
			$("#liColl").removeClass("current");
			$("#liAbout").removeClass("current");
			$("#liCont").removeClass("current");
		});

		$("#liHome").click(function () {
			$("#collectionwin").slideUp(); 
			$("#aboutwin").slideUp(); 	
			$("#contactwin").slideUp();
			$("#liColl").removeClass("current");
			$("#liAbout").removeClass("current");
			$("#liCont").removeClass("current");
		});

		$("#liColl a").click(function () {
			if ($("#collectionwin").is(":hidden")) {  
				$("#aboutwin").slideUp();
				$("#contactwin").slideUp();
				$("#collectionwin").show("slow");
				tab = $(this).attr("id");
				if(tab == null || tab.Length == 0) { tab = "2009"; }
				tab = tab.replace("li", "");

				$("#liColl").addClass("current");
				$("#liAbout").removeClass("current");
				$("#liCont").removeClass("current");
				$.ajax({  
					url: tab+".php",  
					cache: false,  
					success: function(html){ 
						$("#collectionText").html(html);  
					}
				});
			} else {
				tab = $(this).attr("id");
				if(tab == null || tab.Length == 0) { tab = "2009"; }
				tab = tab.replace("li", "");
				
				$("#collectionwin").hide("fast").show("slow");
				$.ajax({  
					url: tab+".php",  
					cache: false,  
					success: function(html){    
						$("#collectionText").html(html);  
					}
				});  
			}
		});

		$("#liCont").click(function () {
			if ($("#contactwin").is(":hidden")) {  
				$("#aboutwin").slideUp();
				$("#collectionwin").slideUp();
				$("#contactwin").show("slow");
				$("#liColl").removeClass("current");
				$("#liAbout").removeClass("current");
				$("#liCont").addClass("current");
				$.ajax({  
					url: "contact.html",  
					cache: false,  
					success: function(html){    
						$("#contactText").html(html);  
					}
				});
			} else {      
				$.ajax({  
					url: "contact.html",  
					cache: false,  
					success: function(html){    
						$("#contactText").html(html);  
					}
				});
			}
		});
		
		$("#liAbout a").click(function () {
			if ($("#aboutwin").is(":hidden")) {  
				$("#collectionwin").slideUp(); 
				$("#contactwin").slideUp();
				$("#aboutwin").show("slow");
				$("#liColl").removeClass("current");
				$("#liAbout").addClass("current");
				$("#liCont").removeClass("current");
				tab = $(this).attr("id");
				if(tab == "liAbout") { tab = "liconcept" }
				tab = tab.replace("li", "");

				$.ajax({  
					url: tab+".html",  
					cache: false,  
					success: function(html){    
						$("#results").html(html);  
					}
				});
			} else {
				tab = $(this).attr("id");
				if(tab == "liAbout") { tab = "liconcept" }
				tab = tab.replace("li", "");
				$("#aboutwin").hide("fast").show("slow");
				$.ajax({  
					url: tab+".html",  
					cache: false,  
					success: function(html){    
						$("#results").html(html);  
					}
				});  
			}
		});

	});
	window.setInterval( function() {Cufon.refresh("li a");}, 100 ); 
