$(function() {

	var $ = jQuery;
	
	var	c3 = {

		nav : function(){
			$('#header ul li').hover(function() {
				$(this).addClass('over');
			}, function() {
				$(this).removeClass('over');
			});		
		},

		links : function(){
		
			$("#print").click(function(){
				
				window.print();
				
				return false;
				
			});

			$("#share").click(function(){

				var url = $(this).attr("href");
				$.ajax({
					type: "POST",
					url: url,
					data: "",
					success: function(data){
						var winW = $(window).width();
						$("body").append(data);
						var w = $("#contact_overlay").width();
						$("#contact_overlay").css('left', winW/2-w/2).fadeIn("slow");
						$("#overlay").fadeIn("slow", function(){
							$.scrollTo(0, 400);
						});
					}
				});
				return false;
						
			});
		
		},

		gallery : function(){
		
			$("a[rel='gallery']").colorbox();
		
		},
	
		init : function(){

			c3.links();
			
			c3.nav();
			
			c3.gallery();

		}
	
	};
	
	c3.init();


	
	//pagination js
	$("#pagination a em").hide();
	
	$("#pagination a").hover(
		function () {
			$(this).children("em").show()
		}, 
		function () {
			$(this).children("em").hide();
		}
	);	

	$(".close").live("click",function(){
		$("#overlay").fadeOut("slow", function(){
			$(this).remove();
		});
		$("#contact_overlay").fadeOut("slow", function(){
			$(this).remove();
		});
		return false;
	});
		
	$("#overlay").live("click",function(){
		$("#overlay").fadeOut("slow", function(){
			$(this).remove();
		});
		$("#contact_overlay").fadeOut("slow", function(){
			$(this).remove();
		});
		return false;
	});

});