function fade_in(target, time){
	$(target).css({"opacity" : "0"});
	$(target).animate({"opacity" : "1"}, time);
}

function home_page_animation(front_image, title, menu){
	var front_image_div = $(front_image);	
	var title_div = $(title);
	var menu_div = $(menu);
	
	menu_div.css({"opacity" : "0", "display" : "none", "visibility" : "hidden"});
	title_div.css({"opacity" : "0", "visibility" : "visible", "display" : "block"});
	
	front_image_div.show("explode", 2500);
	title_div.animate({"opacity" : "1"}, 4500, 
		function(){
			$(this).animate({ "opacity" : "0"}, 2000, function(){
				$(this).css({"display" : "none", "visibility" : "hidden"});
				menu_div.css({ "display" : "block", "visibility" : "visible"});
				menu_div.animate({ "opacity" : "1"}, 2000);
			});
		}
	);
	
}

function menu_load(){
	var menu_div = $(".menu")
	menu_div.css({"visibility" : "visible"});
	menu_div.animate({"opacity" : "1"}, 2000);
	menu_rollover();
}

function menu_rollover(){
	$(".active").css({"color" : "#1D69EF"});
	
	$(".menu ul li a").hover( function(){
		var this_class = $(this).attr("class");	
		if (this_class != "active"){
			$(this).stop().animate({ "color" : "#1D69EF"}, 500);
		}
	}, function(){
		var this_class = $(this).attr("class");	
		if (this_class != "active"){
			$(this).stop().animate({"color" : "white"}, 500);
		}
	});
}

function menu_slider(menu, menu_container, rollover_text){	
	
	var menu_div = $(menu);
	var menu_container_div = $(menu_container);
	var rollover_text_div = $(rollover_text);
	
	$("#content_wrapper").css({"top" : "20px", "margin" : "0 auto"});
	menu_div.css({"margin" : "5px 0 0 0", "fontSize" : "14px", "visibility" : "visible"});
	rollover_text_div.css({"opacity" : "1", "margin" : "2px 0 0 0"});
	
	menu_container_div.hover( function(){
		$("#content_wrapper").stop().animate({"top" : "80px"}, 1000);
		$(this).stop().effect("size", { to: {height: 100} }, 1000);
		rollover_text_div.stop().animate({"opacity" : "0"},1000);	
	},function(){
		$("#content_wrapper").stop().animate({"top" : "20px"}, 1000);
		$(this).stop().effect("size", { to: {height: 30} }, 1000);
		rollover_text_div.stop().animate({"opacity" : "1"},1000);	
	});
	
	menu_rollover();
}

function group_load() {
	$(".group").show("slide", {}, 1000, function(){ 
		$(".group_img").animate( {"opacity" : "1" }, 800, function(){
			group_rollover();
		})
	
	});
	
	
}	

function group_rollover(){
	
	$(".group").hover( function(){
		$(this).find(".group_img").stop().animate({ "opacity" : ".2" }, 500);
		$(this).find(".group_title").stop().animate({ "opacity" : "1" }, 500);
	
	}, function(){
		$(this).find(".group_img").stop().animate({ "opacity" : "1" }, 1000);
		$(this).find(".group_title").stop().animate({ "opacity" : "0" }, 500);

	});
}

function thumb_load() {
	$(".thumb_li").show("slide", {}, 1000, function(){ 
		$(".thumb_img").animate( {"opacity" : "1" }, 2000);
	});
}		

function thumb_to_mid(target_items, name){ //target items are rolled over, name is class of objects being animated
	$("."+name+":first").css({"display" :"block"}).animate({"opacity" :"1"}, 2500); //fade in first thumb as place holder
	var animate_obj_class = $("."+name);
	
	$(target_items).hover( function(){
		var this_mid_div_id = $(this).attr("rel"); //grab this elements rel attribute
		if(this_mid_div_id != "" && this_mid_div_id != "undefined" ){ //check to make sure rel isn't blank, then:	
			$(this).css({	"borderTopColor" : "#8EA6CF",
							"borderRightColor" : "#8EA6CF",
							"borderBottomColor" : "#8EA6CF",
							"borderLeftColor" : "#8EA6CF"
						});
			
			var this_mid_div = $("#"+this_mid_div_id); //set var for mid image element
			animate_obj_class.stop().animate({"opacity" :"0"}, 100); //fade out class of recently displayed image
			animate_obj_class.css({"display" :"none"}); //hide class of recently displayed image
			this_mid_div.css({"display" :"block"}); //show current mid pic
			this_mid_div.stop().animate({"opacity" :"1"}, 500); //fade in current mid pic
		}
	}, function(){
			$(this).css({	"borderTopColor" : "#444444",
							"borderRightColor" : "#444444",
							"borderBottomColor" : "#444444",
							"borderLeftColor" : "#444444"
						});
	}
	
	);
	
}