// JavaScript Document

$(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: "-45" //Find the span tag and move it up 45 pixels
		}, 250);
	} , function() { //On hover out...
		$(this).find("span").stop().animate({
			marginTop: "0" //Move the span back to its original state (0px)
		}, 250);
	});
	
	
});

$(document).ready(function() {
	
	$("#portfolio li").each(function() { //For each list item...
		var linkText = $(this).find("a").html(); //Find the text inside of the a tag
	});
	
	$("#portfolio li").hover(function() {	//On hover...
		$(this).find("a").stop().animate({ 
			marginTop: "-180" //Find the span tag and move it up 45 pixels
		}, 450);
	} , function() { //On hover out...
		$(this).find("a").stop().animate({
			marginTop: "0" //Move the span back to its original state (0px)
		}, 450);
	});
	
	
});

$('.mainImage').cycle({
		fx: 'fade', 
    speed:    2000, 
    timeout:  2000
});

$('.ivyImage').cycle({
		fx: 'fade', 
    speed:    1500, 
    timeout:  1500
});



$(document).ready(function() {

	$("ul#topnav li").hover(function() { //Hover over event on list item
		$(this).find(".topnav_sub").show(); //Show the subnav
	} , function() { //on hover out...
		$(this).find(".topnav_sub").hide(); //Hide the subnav
	});

});

$(document).ready(function() {

	/* This is basic - uses default settings */
	
	$("a#single_image").fancybox();
	
	/* Using custom settings */
	
	$("a#inline").fancybox({
		'hideOnContentClick': true
	});

	/* Apply fancybox to multiple items */
	
	$("a.group").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	false
	});
	
});
