//jquery effects scripts

$(document).ready(function(){


// accordion for blog - note line 12 (hides comments if left open)

$("#column3 div.blogdiv:not(:first)").hide();
$("#column3 h4").click(function(){
$(this).next("div.blogdiv").slideToggle("slow")
.siblings("div:visible").slideUp("slow");
$(".comments").slideUp("fast");
});

// opacify on hover for recent work images


$(".opacify").fadeTo(0.5, 1);
$(".opacify").hover(
function () {
$(this).fadeTo("fast", 0.5);
},
function () {
$(this).fadeTo("normal", 1);
}
);

// slidedown div

$(".slidedown").click(function(){
$(".comments").slideToggle("slow");

});


// validate quick contact form
// blog form validation is embedded in document as forms have dynamic names

$("#commentForm").validate();



// footer rollovers and magic tooltips

$("#footer-left li").hover(
		function(){
			var iconName = $(this).find("img.footerimage").attr("src");
			var origen = iconName.split(".")[0];
			$(this).find("img.footerimage").attr({src: "" + origen + "2.jpg"});
			$(this).find("span").attr({
				"style": 'display:inline'
			});
			$(this).find("span").animate({opacity: 1, top: "-115"}, {queue:false, duration:400});
		}, 
		function(){
			var iconName = $(this).find("img.footerimage").attr("src");
			var origen = iconName.split("2.")[0];
			$(this).find("img.footerimage").attr({src: "" + origen + ".jpg"});
			$(this).find("span").animate({opacity: 0, top: "-105"}, {queue:false, duration:400}, "linear",
				function(){
					$(this).find("span").attr({"style": 'display:none'});			
				}
			);

});

// close all functions

});

// slider - uses load rather than document load

jQuery(window).bind("load", function() {
	jQuery("div#slider1").codaSlider()
});

