//Define Variables
var project_single = $("#single-project");
var project_view = $("#single-project > div");
var project_load = $("#project-loading");
var project_wrap = $("#single-project-wrapper");
var project_trigger = $(".prothumb a");
var project_close = $("#project-hide");
$.ajaxSetup({cache:false});
// hide Project view on start
project_single.slideUp();
//Click Event
project_trigger.click(function(){
showLoading(); //Show Loading animation
var post_id = $(this).attr("rel")
project_single.fadeTo(500, 0); //Hide previous project
project_single.load("../project-load/",{id:post_id}, function(){
hideLoading(); //Hide Loading button and show project
showClose(); //Show close Button
pro_nivo();
$('html,body').delay(450).animate({scrollTop: 200}, 700);
});
return false;
});
// close button functions
project_close.click(function(){
project_single.fadeTo(700, 0).hide('500');
hideClose();
});
// Loading functions
//show loading bar
function showLoading(){
project_load
.css({visibility:"visible"})
.animate({opacity:"1"}, 400)
.css({display:"block"})
;
};
//fade out loading bar and show project view
function hideLoading(){
project_load.fadeTo(500, 0);
showSingle();
};
//show close link
function showClose(){
project_close
.css({visibility:"visible"})
.animate({opacity:"1"}, 400)
.css({display:"block"})
;
};
// fade out close link
function hideClose(){
project_close.fadeTo(300, 0);
};
// show Project view
function showSingle(){
project_single
.slideDown()
.css({visibility:"visible"})
.animate({opacity:"1"}, 400)
.css({display:"block"})
;
};/* end of AJAX project Loader */