


$(document).ready(function() {

if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
 var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
 //if (ieversion>=8)
 // document.write("You're using IE8 or above")
 //else if (ieversion>=7)
 // document.write("You're using IE7.x")
 //else if (ieversion>=6)
 // document.write("You're using IE6.x")
 //else if (ieversion>=5)
 // document.write("You're using IE5.x")


}else{


    $('.slideshow').cycle({
                	fx: 'fade',
                timeout:  6000
	});

}


});


$(document).ready(function(){

	$("img.a").hover(
	function() {
	$(this).stop().animate({"opacity": "0"}, 700);
	},
	function() {
	$(this).stop().animate({"opacity": "1"}, 900);
	
	});
 
});

$(document).ready(function(){

	$("img[rel=tweet].a").hover(
	function() {
	$(this).stop().animate({"opacity": "0"}, 300);
	},
	function() {
	$(this).stop().animate({"opacity": "1"}, 1500);
	
	});
 
});

$(function() {
	$('a[rel=tipsy]').tipsy({fade: true, gravity: 's'});
});

$(function() {
	$('img[alt=tweet]').tipsy({fade: true, gravity: 'w'});
});


$(document).ready(function(){
 		$("#ajax-contact-form").submit(function(){
 
 		var str = $(this).serialize();
 
		    $.ajax({
		    type: "POST",
		    url: "contact.php",
		    data: str,
		    success: function(msg){
     
 		$("#note").ajaxComplete(function(event, request, settings){

			 if(msg == 'OK') // Message Sent? Show the 'Thank You' message and hide the form
			 {
			 result = '<div class="notification_ok">Your message has been sent. Thank you!</div>';
			 $("#fields").hide();
			 }
			 else
			 {
			 result = msg;
			 }
 
 		$(this).html(result);
 
 	});
 
 		}
 
 	});
 
 		return false;
 
	});
});

$(document).ready(function(){

 	$("#openBtn").click(function(){
 	
 		if ($("#callBack").is(":hidden")){
 			$("#callBack").slideDown({
 				duration: 850, 
 				easing: 'easeOutBack'});
		}
		
 		else{
 		
 		$("#callBack").slideUp({
 			duration: 250, 
 			easing: 'swing'});
 		}
 	}); 

 }); 






  

$(document).ready(function() {
	$('#ecLink > a').mouseenter(function() {
		$('#ecLinkBG').show().stop().animate({
			width: '28em'
		}, 400, 'easeOutBounce', function() {
			$(this).css("border-top","0");
			$('#ecBG').show().stop().animate({
				height: '9.5em'
			}, 400, 'easeOutBounce', function() {
				$('#ecBox').fadeIn(100, function() {$('#ecSeeOurWork').fadeIn(1000);});
			});
		});
	});
	
	$('#ecCredit').mouseleave(function() {
		$('#ecBox, #ecSeeOurWork').stop().fadeOut(100);
		$('#ecBG').stop().animate({
			height: '0'
		}, 200, function() {
			$(this).hide();
			$('#ecLinkBG').stop().animate({
				width: '0'
			}, 200, function() {
				$(this).hide();
				$(this).css("border-top","1px solid #555759");
			});
		});
	});
	
});

jQuery.extend(
	jQuery.easing, {
		easeOutBounce: function (x, t, b, c, d) {
			if ((t/=d) < (1/2.75)) {
				return c*(7.5625*t*t) + b;
			} else if (t < (2/2.75)) {
				return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
			} else if (t < (2.5/2.75)) {
				return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
			} else {
				return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
			}
		}
	}
);

