$(function() {
		
		$('.bluerollover').hover(function() {
			$("#case_background", this).fadeTo(200,1);
			$("#case_over", this).animate({top:'23', opacity:1},350, 'easeInOutCirc');
			$("#case_title", this).delay(50).animate({top:'65', opacity:1},200, 'easeInOutCirc');
			$("#case_name", this).delay(100).animate({top:'50', opacity:1},200, 'easeInOutCirc');
			$(".title", this).css("color","#00E3F0");
			$(".date_display", this).css("color","#ADEFF2");
			$("#description", this).css("color","#00E3F0");
	    }, function() {
			$(".title", this).css("color","#000"); 
			$(".date_display", this).css("color","#A6A8AB"); 
			$("#description", this).css("color","#000");
			$("#case_title", this).animate({top:'115', opacity:0},100, 'easeInOutCirc');
			$("#case_name", this).animate({top:'100', opacity:0},100, 'easeInOutCirc');
			$("#case_over", this).animate({top:'-200', opacity:0},300, 'easeInOutCirc');
			$("#case_background", this).fadeTo(400,0);
	    });
		
	    $('.redrollover').hover(function() {
			$("#case_background", this).fadeTo(200,1);
			$("#case_over", this).animate({top:'23', opacity:1},350, 'easeInOutCirc');
			$("#case_title", this).delay(50).animate({top:'65', opacity:1},200, 'easeInOutCirc');
			$("#case_name", this).delay(100).animate({top:'50', opacity:1},200, 'easeInOutCirc');
			$(".title", this).css("color","#F757E3"); 
			$(".date_display", this).css("color","#ECB4EF"); 
			$("#description", this).css("color","#F757E3"); 
	    }, function() {
			$(".title", this).css("color","#000"); 
			$(".date_display", this).css("color","#A6A8AB"); 
			$("#description", this).css("color","#000");
			$("#case_title", this).animate({top:'115', opacity:0},100, 'easeInOutCirc');
			$("#case_name", this).animate({top:'100', opacity:0},100, 'easeInOutCirc');
			$("#case_over", this).animate({top:'-200', opacity:0},300, 'easeInOutCirc');
			$("#case_background", this).fadeTo(400,0);
	    });
		
	    $('.yellowrollover').hover(function() {
			$("#case_background", this).fadeTo(200,1);
			$("#case_over", this).animate({top:'23', opacity:1},350, 'easeInOutCirc');
			$("#case_title", this).delay(50).animate({top:'65', opacity:1},200, 'easeInOutCirc');
			$("#case_name", this).delay(100).animate({top:'50', opacity:1},200, 'easeInOutCirc');
			$(".title", this).css("color","#FFD400"); 
			$(".date_display", this).css("color","#FFED9F"); 
			$("#description", this).css("color","#FFD400"); 
	    }, function() {
			$(".title", this).css("color","#000"); 
			$(".date_display", this).css("color","#A6A8AB"); 
			$("#description", this).css("color","#000");
			$("#case_title", this).animate({top:'115', opacity:0},100, 'easeInOutCirc');
			$("#case_name", this).animate({top:'100', opacity:0},100, 'easeInOutCirc');
			$("#case_over", this).animate({top:'-200', opacity:0},300, 'easeInOutCirc');
			$("#case_background", this).fadeTo(400,0);
	    });
	
	    $('.casesrollover').hover(function() {
			$("#case_background", this).fadeTo(200,1);
			$("#case_over", this).animate({top:'23', opacity:1},350, 'easeInOutCirc');
			$("#case_title", this).delay(50).animate({top:'65', opacity:1},200, 'easeInOutCirc');
			$("#case_name", this).delay(100).animate({top:'50', opacity:1},200, 'easeInOutCirc');
			$(".title", this).css("color","#00E3F0");
			$(".services_rendered", this).css("color","#ADEFF2");
			$(".description", this).css("color","#00E3F0");
	    }, function() {
			$(".title", this).css("color","#000"); 
			$(".services_rendered", this).css("color","#A6A8AB"); 
			$(".description", this).css("color","#000");
			$("#case_title", this).animate({top:'115', opacity:0},100, 'easeInOutCirc');
			$("#case_name", this).animate({top:'100', opacity:0},100, 'easeInOutCirc');
			$("#case_over", this).animate({top:'-200', opacity:0},300, 'easeInOutCirc');
			$("#case_background", this).fadeTo(400,0);
		});
		
		$('.labsrollover').hover(function() {
			$("#case_background", this).fadeTo(200,1);
			$("#case_over", this).animate({top:'23', opacity:1},350, 'easeInOutCirc');
			$("#case_title", this).delay(50).animate({top:'65', opacity:1},200, 'easeInOutCirc');
			$("#case_name", this).delay(100).animate({top:'50', opacity:1},200, 'easeInOutCirc');
			$(".title", this).css("color","#F757E3"); 
			$(".tags", this).css("color","#ECB4EF"); 
			$(".description", this).css("color","#F757E3"); 
	    }, function() {
			$(".title", this).css("color","#000"); 
			$(".tags", this).css("color","#A6A8AB"); 
			$(".description", this).css("color","#000");
			$("#case_title", this).animate({top:'115', opacity:0},100, 'easeInOutCirc');
			$("#case_name", this).animate({top:'100', opacity:0},100, 'easeInOutCirc');
			$("#case_over", this).animate({top:'-200', opacity:0},300, 'easeInOutCirc');
			$("#case_background", this).fadeTo(400,0);
		});
		
		
		
		$('.btn_newsletter').click(function() {
			//$("#newsletter_container").show();
			//$("#newsletter_container").delay(100).slideDown(700, 'easeInOutCirc');
			$("#newsletter_container").slideToggle('slow','easeInOutCubic');
		});
		
		$('#totop').click(function(){
		    $('html, body').animate({scrollTop:0},{duration: 800,easing: 'easeInOutCubic'});
		    return false;
		});	
});

$(document).ready(function(){
		$("#newsletter_container").show(); 
		$("#newsletter_container").hide(); 
		$(function() {
			
			function fadeOutNewsletter()
			{
				$('.newsletter_heading,.newsletter_info,.newsletter_input').fadeOut('slow');
			    $('.newsletter_submit').fadeOut('slow', function() {
					$('.newsletter_heading').html("YOU'RE SIGNED UP!");
					$('.newsletter_info').html("Have a nice day.<br />Best regards from the Kantt team");
					$('.newsletter_heading').fadeIn('slow');
					$('.newsletter_info').css("top","90px");
					$('.newsletter_info').fadeIn('slow');
					$("#newsletter_container").delay(4000).slideUp('slow');
				});
			}
			
			function submitClick()
			{
				$('.newsletter_heading,.newsletter_info,.newsletter_input').fadeOut('slow');
			    $('.newsletter_submit').fadeOut('slow', function() {
					$('.newsletter_loader').fadeIn('slow');
				});
				return false;
			}
			
			/*
			$('.newsletter_submit').click(function(){
		    	submitClick();
		    	return false;
			});	
			*/
			
			var getUrlObj = getUrlVars();
			if(getUrlObj['signup']==1)
			{
				$("#newsletter_container", this).css("display","block");
				fadeOutNewsletter();
			}
		});	
		
		function getUrlVars() 
		{
			var map = {};
			var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) 
			{
				map[key] = value;
			});
			return map;
		}
});
