/**
	Originall bvba - (c) 2010 - JavaScript/jQuery
	info@originall.be
**/

$(document).ready(
	function()
	{
		$(".block-block-4 h2").toggle(function(){openBlog();},function(){closeBlog();});
		
		makeItemsDynamic();
		
		
		$("#views-exposed-form-labsfront-page-1 #edit-submit-labsfront").hide();
		$("#views-exposed-form-portfolio-page-1 #edit-submit-portfolio").hide();
		
		$("#views-exposed-form-labsfront-page-1 input").click(function() {
			$("#views-exposed-form-labsfront-page-1 .views-exposed-form").submit();
		});
		$("#views-exposed-form-portfolio-page-1 input").click(function() {
			$("#views-exposed-form-portfolio-page-1 .views-exposed-form").submit();
		});
		$("#views-exposed-form-portfolio-page-1").ajaxComplete(function(){
			makeItemsDynamic();
		});
	}
);

function makeItemsDynamic(){
	$(".portfolio-inner").each(function(){
		$(this).mouseenter(function(){
			var tagHeight = $(this).find('div.portfolio-text').height();
			var movableHeight = 200 - tagHeight;
			$(this).find('div:first').stop().animate({"height":movableHeight+"px"},{duration:400});
		}).mouseleave(function(){
			$(this).find('div:first').stop().animate({"height":"200px"},{duration:400});
		});
	});
};

function openBlog(){
	$(".blog-full-block").slideDown('slow');
};

function closeBlog(){
	$(".blog-full-block").slideUp('slow');
};
