/* Author: 

*/




$(document).ready(function() {
	
	
	
	$('.slideshow').hover(
function() { $('#controls').fadeIn(); },
function() { $('#controls').fadeOut(); }
); 

	$('.slideshow2').hover(
function() { $('#controls2').fadeIn(); },
function() { $('#controls2').fadeOut(); }
); 
	
	
	
$('.slideshow').hover(
function() { $('.slideshow').cycle('pause');},
function() { $('.slideshow').cycle('resume');}
);

$('.slideshow2').hover(
function() { $('.slideshow').cycle('pause');},
function() { $('.slideshow').cycle('resume');}
);

	
	
$('.slideshow').cycle({ 
    fx:     'fade', 
    speed:  'slow', 
    timeout: 4500,  
	next:   '.slideshow, #next', 
    prev:   '#prev' ,
	before: onBefore
});



$('.slideshow2').cycle({ 
    fx:     'fade', 
    speed:  'slow', 
    timeout: 7000, 
    next:   '.slideshow2', 
    prev:   '#prev2',
	before: onBefore2

});
	

$('.slideshow3').cycle({ 
    fx:     'fade', 
    speed:  'slow', 
    timeout: 5400, 
   next:   '.slideshow3'
});

$('.slideshow4').cycle({ 
    fx:     'fade', 
    speed:  'slow', 
    timeout: 5300, 
   next:   '.slideshow4'
});

$('.slideshow5').cycle({ 
    fx:     'fade', 
    speed:  'slow', 
    timeout: 5200, 
   next:   '.slideshow5'
});

$('.slideshow6').cycle({ 
    fx:     'fade', 
    speed:  'slow', 
    timeout: 5100, 
   next:   '.slideshow6'
});

$('.slideshow7').cycle({ 
    fx:     'fade', 
    speed:  'slow', 
    timeout: 5000, 
   next:   '.slideshow7'
});



function onBefore() { 
    $('#output').html('<h6>' + this.alt + '</h6>') 
     ; 
}

function onBefore2() { 
    $('#output2').html('<h6>' + this.alt + '</h6>') 
     ; 
}






$('.scrollPage').click(function() {
   var elementClicked = $(this).attr("href");
   var destination = $(elementClicked).offset().top;
   $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination-20}, 500 );
  scrolled(elementClicked);
   return false;
});

function scrolled(elementClicked){
	
	
}

    $("#nav ul li a ").hover(function() {
    $(this).animate({ backgroundColor: "#bde5f9" }, 500);
},function() {
    $(this).animate({ backgroundColor: "transparent" }, 500);
});




$("#myElement").topZIndex();


// Creates canvas 320 × 200 at 10, 50
var paper = Raphael(320, 200, 320, 200);

// Creates circle at x = 50, y = 40, with radius 10
var circle = paper.circle(50, 40, 10);
// Sets the fill attribute of the circle to red (#f00)
circle.attr("fill", "#f00");

// Sets the stroke attribute of the circle to white
circle.attr("stroke", "#fff");




});

















