$(document).ready(function(){
	
	//-------------------						
	//----- PNG FIX -----
	//-------------------
	$(document).pngFix(); 
	

	
	   
    
	/* --------------------------- */
	/* ------ SLIDING BOXES ------ */
	/* --------------------------- */	
		
		//Caption Sliding (Partially Hidden to Visible)
		$('.boxgrid').hover(function(){
			$(".boxcaption", this).stop().animate({top:'100px'},{queue:false,duration:160});
			
			$(".BwImg", this).stop().animate({opacity:'0'},{queue:false,duration:500});
			
			}, 
			function() {
			$(".boxcaption", this).stop().animate({top:'200px'},{queue:false,duration:160});
			$(".BwImg", this).stop().animate({opacity:'1'},{queue:false,duration:200});
												
		});
		
	/* ---------------------------- */
	/* ------- Client Thumbs ------ */
	/* ---------------------------- */	 		
	
	var thumbOpacity = .6;
	var effectSpeed = 300;
 		
 		
 		$('.ThumbnailBox img').css({opacity:thumbOpacity});
			$('.ThumbnailBox').hover(function(){
				$("img", this).stop().animate({opacity:'1'},{queue:false,duration:effectSpeed});
			},function() {
				$("img", this).stop().animate({opacity:thumbOpacity},{queue:false,duration:effectSpeed});
		});

	/* --------------------------- */
	/* ------- COLOUR BOXES ------ */
	/* --------------------------- */	
		

		//$("#boxes").hide();
	
	
	
	
	
	/*-------------------*/
	/*------ AJAX -------*/
	/*-------------------*/
	
	
	$("a.pop").click(function(){
		
		$('#boxes').fadeOut(200);
		$('#boxes').html("");
		
		var targetUrl = $(this).attr("href");
	
		$.get(targetUrl, function(data){
			//append ajax data
	    	$('#boxes').append($('#boxesDetail',data));
	    	//add close button
	    	
	    	$('#container').fadeOut(500);
	    	// fadeIn content
	    	$('#boxes').fadeIn(500);
	    });
				
		return false
	});
	


	$('#boxes').click(function(){
		$('#boxes').fadeOut(200);
		$('#container').fadeIn(500);
	});

	
	$('#boxes .back').click(function(){
		$('#boxes').fadeOut(200);
		$('#container').fadeIn(500);
	});
	
	
	$('.back').click(function(){
		return false
	});

	
		





	//$(selector).colorbox({inline:true, href:"#myForm"});
	
	/* $("a#inline").colorbox({inline:true}); */
	/*

		$("a.Button").colorbox({inline:true});
		$("a.pop").colorbox({inline:true});
		
    */				
				
});


