// JavaScript Document

		$(document).ready(function(){
			$(".lightbox").lightbox();
		});

/*-------------------------SHADOW--------------------------*/
$(document).ready(function(){
  $("h1").textShadow(),
  $("h2").textShadow();
})

/*-------------------------BOXES--------------------------*/

$('#box_grey').corner("10px");



/*-------------------------CODA SLIDER--------------------------*/

			$().ready(function() {
				$('#coda-slider-1').codaSlider({
				dynamicArrows: false,
				firstPanelToLoad:1
				});
			});

/*-------------------------CARAVAN MENU POP UP--------------------------*/

$(function () { 
	// Dock initialize
	$('#dock').Fisheye(
		{
			maxWidth: 60,
			items: 'a',
			itemsText: 'span',
			container: '.dock-container',
			itemWidth: 100,
			proximity: 100,
			alignment : 'left',
			valign: 'bottom',
			halign : 'center'
		}
	);
});

//Swap Image on Click
	$("ul.thumb li a").click(function() {
		
		var mainImage = $(this).attr("href"); //Find Image Name
		$("#main_view img").attr({ src: mainImage });
		return false;		
	});
		
/*-----------------------------MENU ROLLOVERS------------------------*/
$(document).ready(function() {

	$("#topnav li").prepend("<span></span>"); //Throws an empty span tag right before the a tag

	$("#topnav li").each(function() { //For each list item...
		var linkText = $(this).find("a").html(); //Find the text inside of the <a> tag
		$(this).find("span").show().html(linkText); //Add the text in the <span> tag
	}); 

	$("#topnav li").hover(function() {	//On hover...
		$(this).find("span").stop().animate({
			marginTop: "-40" //Find the <span> tag and move it up 40 pixels
		}, 250);
	} , function() { //On hover out...
		$(this).find("span").stop().animate({
			marginTop: "0"  //Move the <span> back to its original state (0px)
		}, 250);
	});

});

/*-------------------------------GALLERY--------------------------------------*/
function slideSwitch() {
    var $active = $('#slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 5000 );
});

$(document).ready(
				function (){
					$("#pikame").PikaChoose({
					carousel:true,
					howCaption:false
					});
				});

/*-------------------------------HOME SLIDESHOW--------------------------------------*/

 $(window).load(function() {
    	$('#slider').nivoSlider({
		effect:'fade',
		directionNav:false,
		directionNavHide:false,
		animSpeed:500, // Slide transition speed
		pauseTime:3000, // How long each slide will show
		controlNav:false
		  });
		});

