﻿

jQuery(document).ready(function () {

	/* Smooth Scroller
	 ------------------------------------------------------------------------*/
	

	
	
	/* PrettyPhoto
	 ------------------------------------------------------------------------*/
	
	
	/* Google Maps
	 ------------------------------------------------------------------------*/
	/*jQuery('#gmap').googleMaps({
		latitude: 52.263301,
        longitude: 21.028317,
		markers: {
        	latitude: 52.263301,
            longitude: 21.028317
		}
	});*/ 
	
	
	/* Sliders
	 ------------------------------------------------------------------------*/
	 
    /* Homepage slider */

	
    /* Menu
	 ------------------------------------------------------------------------*/
   

	/* Contact Form
	 ------------------------------------------------------------------------*/
	/* Messages */

	
	
	/* Portfolio
	 ------------------------------------------------------------------------*/
	 
	var
  		speed = 750,  // animation speed
  		portfolio_grid = jQuery('.portfolio-grid');
		
    /* Add active class to first navigation item */
	jQuery('.portfolio-nav li:first-child a').addClass('active');
	
	portfolio_grid.masonry({
		columnWidth: 246, // Column width 222px + margin right 24px
		singleMode: true,
		resizeable: false,
		/* only apply masonry layout to visible elements */
		itemSelector: '.gri-item:not(.invis)',
		animate: true,
		animationOptions: {
    		easing: 'easeOutQuad',
			duration: speed,
			queue: false
	  }
	});
	
	/* Portfolio navigation action */
	jQuery('.portfolio-nav li a').click(function(){
		/* Remove .active class from portfolio navigation */
		jQuery('.portfolio-nav li a').removeClass('active');
		var colorClass = '.' + jQuery(this).attr('class');
		
		if (colorClass=='.all') {
			/* Show all hidden boxes */
			portfolio_grid.children('.invis').toggleClass('invis').fadeIn(speed);
		} else {  
			/* Hide visible boxes */
			portfolio_grid.children().not(colorClass).not('.invis').toggleClass('invis').fadeOut(speed);
			/* Show hidden boxes */
			portfolio_grid.children(colorClass+'.invis').toggleClass('invis').fadeIn(speed);
		}
		
		/* Run masonry class */
		portfolio_grid.masonry();
		
		/* Add .active class to portfolio navigation */
		jQuery(this).addClass('active');
		return false;
	});

	/* Hover effect */
	var portfolio_hover = {
		init : function() {
				var el = jQuery('.portfolio-item');
				el.hover(function(){
					jQuery('.portfolio-hover', this).stop().fadeTo(600, 0.70);
					jQuery('.portfolio-content', this).css('left', '-222px');
					jQuery('.portfolio-content', this).stop().animate({ left : '0px'}, { queue: false, duration: 450, easing: 'easeOutQuint' })
				}, function(){
					jQuery('.portfolio-hover', this).stop().fadeTo(800, 0);
					jQuery('.portfolio-content', this).stop().animate({ left : '-422px'}, { queue: false, duration: 300, easing: 'easeOutQuint' })
					
				})
			}
	}
	portfolio_hover.init();
	
	
	/* News
	 ------------------------------------------------------------------------*/
	 
	/* Show first article */
	
	
	/* News List */
	
	/* About
	 ------------------------------------------------------------------------*/
	
	/* Slider */
	
	
	/* Accordion
	 ------------------------------------------------------------------------*/
	
	
	
	/* Toggle
	 ------------------------------------------------------------------------*/
	
	 
	
	/* Helper Functions
	 ------------------------------------------------------------------------*/
	 
	
	
	
	
	/* Cufon Fonts
	 ------------------------------------------------------------------------*/
	/*Cufon.replace('h1, h2, h3, h4, h5, h6, #menu > li > a', {fontFamily: 'PT Sans Narrow', hover: 'true', textShadow: '#222 1px 1px'});*/

	
/* End custom scripts */
}) 


;

/**
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 5/25/2009
 * @author Ariel Flesler
 * @version 1.4.2
 *
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 */


/**
 * jQuery.LocalScroll - Animated scrolling navigation, using anchors.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 3/11/2009
 * @author Ariel Flesler
 * @version 1.2.7
 **/
;(function($){var l=location.href.replace(/#.*/,'');var g=$.localScroll=function(a){$('body').localScroll(a)};g.defaults={duration:1e3,axis:'y',event:'click',stop:true,target:window,reset:true};g.hash=function(a){if(location.hash){a=$.extend({},g.defaults,a);a.hash=false;if(a.reset){var e=a.duration;delete a.duration;$(a.target).scrollTo(0,a);a.duration=e}i(0,location,a)}};$.fn.localScroll=function(b){b=$.extend({},g.defaults,b);return b.lazy?this.bind(b.event,function(a){var e=$([a.target,a.target.parentNode]).filter(d)[0];if(e)i(a,e,b)}):this.find('a,area').filter(d).bind(b.event,function(a){i(a,this,b)}).end().end();function d(){return!!this.href&&!!this.hash&&this.href.replace(this.hash,'')==l&&(!b.filter||$(this).is(b.filter))}};function i(a,e,b){var d=e.hash.slice(1),f=document.getElementById(d)||document.getElementsByName(d)[0];if(!f)return;if(a)a.preventDefault();var h=$(b.target);if(b.lock&&h.is(':animated')||b.onBefore&&b.onBefore.call(b,a,f,h)===false)return;if(b.stop)h.stop(true);if(b.hash){var j=f.id==d?'id':'name',k=$('<a> </a>').attr(j,d).css({position:'absolute',top:$(window).scrollTop(),left:$(window).scrollLeft()});f[j]='';$('body').prepend(k);location=e.hash;k.remove();f[j]=d}h.scrollTo(f,b).trigger('notify.serialScroll',[f])}})(jQuery);
