jQuery(document).ready(function(){
	
	$fadeSpeed = 200;

	$("#slider").easySlider(
	{
    	auto: 		false, 
    	continuous: true,
    	speed: 		1500,
    	pause:		4000,
    	numeric: 	false,
    	prevId: 	'prevBtn',
		prevText: 	'Previous',
		nextId: 	'nextBtn',	
		nextText: 	'Next',
		controlsShow:	true

    });
    
    $('.buttons').show();
    
  /*  $("a.contact").click(function(event){
    	event.preventDefault();
    	
    	var scrollPos = $(document).height() - $(window).height();
    	$("html, body").animate({ scrollTop: scrollPos }, 800);

    });*/
    
    
    $('.requestbtn').click(function(event)
			{
				event.preventDefault();
				var scrollPos = $(document).height() - $(window).height();
    		$("html, body").animate({ scrollTop: scrollPos }, 800);

			})
    
    
    $('.solutions .item h3').click(function(){
    
    
    	if($(this).parent().find('a').attr('target') == '_blank'){
    		window.location = ($(this).parent().find('a').attr('title'));
    		return false;
    	}else{
    		window.location = $(this).parent().find('a').attr('href');
    	}
    	
    
    });
    
    $('.maincall').mouseover(function(){
    	$(this).find('.title').addClass('hover');
    })
     $('.maincall').mouseout(function(){
    	$(this).find('.title').removeClass('hover');
    })
    
    $('.maincall').click(function(){
    
    	window.open($(this).find('a').attr('href'));
    	return false;
    });
    
    /* FILTER EVENTS */
    
  /*
  $('.filter').click(function(event){
		event.preventDefault();
		$filter = $(this).attr('href').substring($(this).attr('href').lastIndexOf('/') + 1);
		$('.filter').each(function(){
			$(this).removeClass('active');
		})
		$(this).addClass('active');
		if($filter == 'events')
		{
			$('.item').each(function(){
				$(this).fadeIn('$fadeSpeed');
			})
		}else{
			$('.item').each(function(){
				if($(this).hasClass($filter))
				{
					$(this).fadeIn('$fadeSpeed');
				}else{
					$(this).fadeOut('$fadeSpeed');
				}
			})
		}
	});
*/
	
	/* SCROLL TO JOBS */
	
	$('.scroll').click(function(event){
		$('.scroll').each(function(){
			$(this).removeClass('active');
		})
		$(this).addClass('active');
		$scrollto = $(this).attr('href').substring($(this).attr('href').lastIndexOf('/') + 1);
		event.preventDefault();
		var destination = $('#'+$scrollto).offset().top;
		$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination});
	});

    
    
    $("a.media").not('.overview').fancybox({
                    'titleShow'     : false,
                    'transitionIn'  : 'elastic',
                    'transitionOut' : 'elastic',
                    'type'			: 'iframe',
                    'padding'		: 0,
                    'width'			: 640,
                    'height'		: 480
        });
    
    $("a.media.image").not('.overview').fancybox({
                'titleShow'     : false,
                'transitionIn'  : 'elastic',
                'transitionOut' : 'elastic',
                'type'			: 'image',
                'padding'		: 0
    });

	$("#external").fancybox({
		'scrolling'		: 'no',
		'titleShow'		: false,
		'onClosed'		: function() {
		    $("#login_error").hide();
		}
	});    
    
});
