$(document).ready(function() {
	
	// PARALLAX EFFECT
    $('#parallax .parallax-layer')
    .parallax({
        mouseport: $('#parallax')
    });


    //---

    
    // HOME PAGE - LATEST PROJECT FADE EFFECT	
	$('#our_work1').hover(function(){
		$(this).children('.front').fadeOut(400);
		}, function(){$(this).children('.front').stop().fadeIn(500);
	});
	
	$('#our_work2').hover(function(){
		$(this).children('.front').fadeOut(400);
		}, function(){$(this).children('.front').stop().fadeIn(500);
	});
	
	$('#our_work3').hover(function(){
		$(this).children('.front').fadeOut(400);
		}, function(){$(this).children('.front').stop().fadeIn(500);
	});
	
	$('#our_work4').hover(function(){
		$(this).children('.front').fadeOut(400);
		}, function(){$(this).children('.front').stop().fadeIn(500);
	});
	
	// HOME PAGE - LATEST PROJECT CLICK EFFECT
	$("#our_work1").click(function(event) {
    	window.location.href = "ourwork.html";
    	event.preventDefault();
	});
	
	$("#our_work2").click(function(event) {
    	window.location.href = "ourwork.html";
    	event.preventDefault();
	});
	
	$("#our_work3").click(function(event) {
    	window.location.href = "ourwork.html";
    	event.preventDefault();
	});
	
	$("#our_work4").click(function(event) {
    	window.location.href = "ourwork.html";
    	event.preventDefault();
	});
	
	
	//---


	// LATEST PROJECT FADE EFFECT	
	$('#top-center1').hover(function(){
		$(this).children('.front').fadeOut(400);
		}, function(){$(this).children('.front').stop().fadeIn(500);
	});
	
	$('#top-center2').hover(function(){
		$(this).children('.front').fadeOut(400);
		}, function(){$(this).children('.front').stop().fadeIn(500);
	});
	
	$('#top-center3').hover(function(){
		$(this).children('.front').fadeOut(400);
		}, function(){$(this).children('.front').stop().fadeIn(500);
	});
	
	$('#top-center4').hover(function(){
		$(this).children('.front').fadeOut(400);
		}, function(){$(this).children('.front').stop().fadeIn(500);
	});
		
	$('#top-center5').hover(function(){
		$(this).children('.front').fadeOut(400);
		}, function(){$(this).children('.front').stop().fadeIn(500);
	});
		
	$('#top-center6').hover(function(){
		$(this).children('.front').fadeOut(400);
		}, function(){$(this).children('.front').stop().fadeIn(500);
	});
	
	$('#top-center7').hover(function(){
		$(this).children('.front').fadeOut(400);
		}, function(){$(this).children('.front').stop().fadeIn(500);
	});
	
	$('#top-center8').hover(function(){
		$(this).children('.front').fadeOut(400);
		}, function(){$(this).children('.front').stop().fadeIn(500);
	});
	
	
	//---
	
					
	// LATEST PROJECT CLICK EFFECT
	$("#top-center1").click(function(event) {
    	window.location.href = "ourwork.html";
    	event.preventDefault();
	});
	
	$("#top-center2").click(function(event) {
    	window.location.href = "ourwork.html";
    	event.preventDefault();
	});
	
	$("#top-center3").click(function(event) {
    	window.location.href = "ourwork.html";
    	event.preventDefault();
	});
	
	$("#top-center4").click(function(event) {
    	window.location.href = "ourwork.html";
    	event.preventDefault();
	});
	
	$("#top-center5").click(function(event) {
    	window.location.href = "http://www.bishopdubourg.com";
    	event.preventDefault();
	});
	
	$("#top-center6").click(function(event) {
    	window.location.href = "http://www.floatbsr.com";
    	event.preventDefault();
	});
	
	$("#top-center7").click(function(event) {
    	window.location.href = "ourwork.html";
    	event.preventDefault();
	});
	
	$("#top-center8").click(function(event) {
    	window.location.href = "http://www.drivemultimedia.com";
    	event.preventDefault();
	});
	
	
	//---
	
	
	// JQUERY TWEET 
     jQuery(function($){
        $(".tweet").tweet({
          username: "zunskigraphics",
          avatar_size: 48,
          count: 3,
          loading_text: "loading tweets..."
        });
      });
    
    
    //---
    
    
    // FLICKR PHOTOS IN FOOTER
	$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?id=47074327@N06&lang=en-us&format=json&jsoncallback=?", function(data)
	{
		$.each(data.items, function(i,item) {
			if(i<= 8) {
			$("<img/>").attr("src", item.media.m).appendTo("#flickrwrapper")
			.wrap("<a href='" + item.link + "'></a>");
			}
		});
	});

	
	//---
	
	
	
});

