// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults


$(function () {
 
  $('.home').click(function(){
        $.scrollTo( '#header', 800);
    });

 $('.design').click(function(){
        $.scrollTo( '#body1', 800, {offset:-150} );
    });
    
  $('.finance').click(function(){
        $.scrollTo( '#body2', 800, {offset:-150} );
    });
    
  $('.build').click(function(){
        $.scrollTo( '#body3', 800, {offset:-150} );
    }); 
    
  $('.operate').click(function(){
        $.scrollTo( '#body4', 800, {offset:-150} );
    });
    
  $('.press').click(function(){
        $.scrollTo( '#body5', 800, {offset:-150} );
    });  
  
  $('.gallery').click(function(){
        $.scrollTo( '#body6', 800, {offset:-150} );
    });
    
  $('.about').click(function(){
        $.scrollTo( '#body7', 800, {offset:-150} );
    });    
    
  $('.contactbutton').click(function(){
        $.scrollTo( '#footer', 800, {offset: 10});
    });        

    $(".scrollable").scrollable({easing: 'swing', speed: 700, circular: true}).navigator();
    
    		$("a[rel=example_group]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
    	
    	
    	$("#more_modal").fancybox({
				'titlePosition'		: 'inside',
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'autoScale'			: true
			});
			
			$(".article_modal").fancybox({
				'width'				: '75%',
				'height'			: '75%',
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
			
			
			$(".article_modal2").fancybox({
				'width'				: '40%',
				'height'			: '40%',
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
			
			
			$("#mf").validate({
 submitHandler: function(form) {
   form.submit();
 }
});

});

