// JavaScript Document
//***************************** Lightbox *****************************//


//jQuery(document).ready(function(){
//	jQuery("a[rel^='prettyPhoto']").prettyPhoto({
//		theme: "facebook"
//	});
//});

	/**************************************************
		SEARCH
	**************************************************/


function searchspring(){	
	jQuery(".searchbar").hover(function(){
	  jQuery(this).animate({marginLeft:'0px'}, {queue:false,duration:500});},
	  function(){ jQuery(this).animate({marginLeft:'-150px'}, {queue:false,duration:500});
	});
}
	
jQuery(document).ready(function(){
    searchspring();
});


//***************************** Menu *****************************//


function mainmenu(){
	jQuery("#nav li a").removeAttr("title");
	jQuery("#nav a").removeAttr("title");
	jQuery("#nav ul ").css({display: "none"}); // Opera Fix
	jQuery("#nav li").hover(function(){
		jQuery(this).find('ul:first').css({visibility: "visible", display: "none"}).show(600);
		},function(){
		jQuery(this).find('ul:first').css({visibility: "collapse", display: "none"});
		});
}
 
jQuery(document).ready(function(){					
	mainmenu();
});

function menuspring(){
	jQuery('#nav li a').hover(function() {
		jQuery(this).animate({paddingLeft:'30px'}, {queue:false,duration:500}).css({background: 'rgba(255,255,255,0.5)'}).show(600);
	},
	function(){
		jQuery(this).animate({paddingLeft:'10px'}, {queue:false,duration:500}).css({background: 'rgba(255,255,255,1)'});
	});
}

jQuery(document).ready(function(){					
	menuspring();
});

//***************************** Scrollable Content *****************************//


jQuery(function() {
	jQuery("#scrollslider").smoothDivScroll({
	scrollingSpeed: 4,
	mouseDownSpeedBooster: 1,
	autoScroll: "",
	autoScrollDirection: "endlessloop",
	autoScrollSpeed: 2,
	visibleHotSpots: "always",
	startAtElementId: "startslider1"
	});
	jQuery("#scrollportfolio").smoothDivScroll({
	scrollingSpeed: 4,
	mouseDownSpeedBooster: 1,
	autoScroll: "",
	autoScrollDirection: "endlessloop",
	autoScrollSpeed: 2,
	visibleHotSpots: "always",
	startAtElementId: "startportfolio1"
	});		
});


//***************************** Image Hover Effect *****************************//


jQuery(document).ready(function(){
    jQuery('.image-thumb').css({'opacity':'0'});
	jQuery('.jFlowControl, .portfolio-thumbnails').hover(
		function() {
			jQuery(this).find('.image-thumb').stop().fadeTo(500, 0.8);
		},
		function() {
			jQuery(this).find('.image-thumb').stop().fadeTo(500, 0);
		}
	)
});	


//***************************** Thumbnail Slide Up Effect *****************************//


jQuery(document).ready(function(){

	jQuery(function() {
		jQuery("#slider-container-large, #slider-container-medium, #slider-container-small").hover(function(){			jQuery(this).find(".pop_box_lower").animate({top:"-100px"},{queue:false,duration:500});},
			function(){ jQuery(".pop_box_lower").animate({top:"0px"},{queue:false,duration:500});
		});
		
	});

	jQuery(function() {
	
		jQuery("#slider-container-large").hover(function(){
			jQuery(this).find(".pop_box_upper_large").animate({top:"-280px"},{queue:false,duration:500});},
			function(){ jQuery(".pop_box_upper_large").animate({top:"-460px"},{queue:false,duration:500});
		});
		
		jQuery("#slider-container-medium").hover(function(){
			jQuery(this).find(".pop_box_upper_medium").animate({top:"-350px"},{queue:false,duration:500});},
			function(){ jQuery(".pop_box_upper_medium").animate({top:"-475px"},{queue:false,duration:500});
		});
		
		jQuery("#slider-container-small").hover(function(){
			jQuery(this).find(".pop_box_upper_small").animate({top:"-418px"},{queue:false,duration:500});},
			function(){ jQuery(".pop_box_upper_small").animate({top:"-553px"},{queue:false,duration:500});
		});	
		
	});
		
});


/*************************** Image Preloader ***************************/


/*jQuery(function () {
	jQuery('.preload').hide();//hide all the images on the page
});

var i = 0;//initialize
var int=0;//Internet Explorer Fix
jQuery(window).bind("load", function() {//The load event will only fire if the entire page or document is fully loaded
	var int = setInterval("doThis(i)",500);//500 is the fade in speed in milliseconds
});

function doThis() {
	var images = jQuery('.preload').length;//count the number of images on the page
	if (i >= images) {// Loop the images
		clearInterval(int);//When it reaches the last image the loop ends
	}
	jQuery('.preload:hidden').eq(0).fadeIn(500);//fades in the hidden images one by one
	i++;//add 1 to the count
}
*/

