jQuery(document).ready(function($) {	
		
	// INITIAL CHECK FOR IE (GENERAL)
	var is_it_IE = false;
	jQuery.each(jQuery.browser, function(e, val) {if(e=="msie" && jQuery.browser.version.substr(0,3)=="6.0")is_it_IE = true});
	jQuery.each(jQuery.browser, function(e, val) {if(e=="msie" && jQuery.browser.version.substr(0,3)=="7.0")is_it_IE = true});
	jQuery.each(jQuery.browser, function(e, val) {if(e=="msie" && jQuery.browser.version.substr(0,3)=="8.0")is_it_IE = true});
	// if firefox
	jQuery.each(jQuery.browser, function(e, val) {if(e=="mozilla"){
			is_it_IE = true;
			$('div#vimeo_holder').css('top','400px');
			$('div#vimeo_holder').fadeOut();
			$('div#vimeo_holder').css('top','0px');
		}
	});
	
	
	var everything_is_visible = false;
	$('p#everything_hidden').addClass('on');
		
	$('p#everything_hidden').click(function () { 
		$(this).addClass('on');
		$('p#everything_visible').removeClass('on');
		$('div.box div.box_info img.cover, div.box_w_links div.box_cover').animate({top:'0px'},{queue:false,duration:500});
		everything_is_visible = false;
		if(is_it_IE == true){
			$('div#vimeo_holder').fadeOut();
		}
	});
	$('p#everything_visible').click(function () { 
		$(this).addClass('on');
		$('p#everything_hidden').removeClass('on');
		$('div.box div.box_info img.cover, div.box_w_links div.box_cover').animate({top:'-200px'},{queue:false,duration:500});
		everything_is_visible = true;
		if(is_it_IE == true){
			$('div#vimeo_holder').fadeIn();
		}
	});
		
	$('div.box div.box_info a.lifter').hover(
		function () {
			if(everything_is_visible == false){
	 			$(this).find('img.cover').animate({top:'-200px'},{queue:false,duration:500});
			}	
			$(this).parent().find('div.box_text').animate({top:'170px'},{queue:false,duration:300});
	 	}, function(){
			if(everything_is_visible == false){
	 			$(this).find('img.cover').animate({top:'0px'},{queue:false,duration:500});
			}
			$(this).parent().find('div.box_text').animate({top:'200px'},{queue:false,duration:300});
	 	}
	);
	
	$('div.box_w_links').hover(
		function () {
			if(everything_is_visible == false){
	 			$(this).find('.box_cover').animate({top:'-200px'},{queue:false,duration:500});
				if(is_it_IE == true){
					if ($(this).parent().attr('id') == "vimeo"){
						$('div#vimeo_holder').fadeIn();
					}
				}
			}	
			$(this).parent().find('div.box_text').animate({top:'170px'},{queue:false,duration:300});
	 	}, function(){
			if(everything_is_visible == false){
	 			$(this).find('.box_cover').animate({top:'0px'},{queue:false,duration:500});
				if(is_it_IE == true){
					if ($(this).parent().attr('id') == "vimeo"){
						$('div#vimeo_holder').fadeOut();	
					}
				}
			}
			$(this).parent().find('div.box_text').animate({top:'200px'},{queue:false,duration:300});
	 	}
	);
	
	
	
	//JQUERY MAILTO 
	jQuery.fn.mailto = function() {
		return this.each(function(){
			var email = $(this).html().replace(/\s*\(.+\)\s*/, "@");
			$(this).before('<a href="mailto:' + email + '" rel="nofollow" title="Email ' + email + '">' + email + '</a>').remove();
		});
	};
	
	$(".email").mailto();
	
	//Null add
	$('#ad').find('a').click(function(){
		return false;
	})
	
	
});