jQuery(document).ready(function(){
	// smooth scroll
	
	jQuery(function() {
		jQuery('#navigation a[href*="#"], .hentry a[href*="#"], a.scroll').click(function() {
			if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
				var target = jQuery(this.hash);
					target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
					if (target.length) {
						jQuery('html, body').animate({
							scrollTop: target.offset().top
						}, 1000);
					return false;
			 	}
			}
	  	});
	});

	// clickable div function
	jQuery(".link-div").click(function(){
		 window.location=jQuery(this).find("a").attr("href"); 
		 return false;
	});
	
	//wrap select box with div for styling 
	jQuery( "select" ).wrap( "<span class='select-style'></div>" );
	
	//mosaic
	jQuery('.bar').mosaic({
		animation: 'slide'
	});
	jQuery('.circle').mosaic({
		opacity: 0.8			//Opacity for overlay (0-1)
	});
				
	jQuery('.fade').mosaic({
		speed: 300
	});
				
	jQuery('.bar1').mosaic({
		animation: 'slide'		//fade or slide
	});
				
	jQuery('.bar2').mosaic({
		animation: 'slide',	//fade or slide
		anchor_y: 'top'		//Vertical anchor position
	});
	
	// change background class in header 
	jQuery(window).scroll(function() {    
		var scroll = jQuery(window).scrollTop();
	
		if (scroll >= 500) {
			jQuery(".top-nav-bar").addClass("scroll-nav-bar");
		} else {
			jQuery(".top-nav-bar").removeClass("scroll-nav-bar");
		}
	});
		
});