$(document).ready(function(){
	
	$('#testTabs').tabs({ fx: [{opacity:'toggle', duration:500},   // hide option
         {opacity:'toggle', duration:250}] }); // show option
	
	$('input:text, textarea').addClass('roundBorders');
	
	$('li.email a').attr('href', 'mailto:mattrossidesigns@gmail.com');
	
	$('form small').css('opacity', '0');
	$('form p input').focus(function() {
    $(this).parent('p').find('small').stop().animate({ opacity: 1}, 500 )
  }).blur( function() {
    $(this).parent('p').find('small').stop().animate({ opacity: 0}, 250 )
  });
	
	$('#submit, input.submit, #searchsubmit').css('cursor', 'pointer').hover(function() {
		$(this).addClass('hover');
	}, function() {
		$(this).removeClass('hover');
	});
	

	
		
	$('.connect').after('<p class="via"> </p>');
	$('p.via').css('opacity', '0');
	$('.connect li a').hover(function() {
		var e = $(this).attr('title');
		$('p.via').append(e);
		$('p.via').stop().animate({ 
        opacity: 1
      }, 500 );
      }, function() {
		$('p.via').stop().animate({ 
        opacity: 0
      }, 250 );
      $('p.via').empty();
   	});

	$('.service').css('cursor', 'pointer').click(function() {
		window.location.href = $(this).find('a.serviceLink').attr('href');
		return false;
	});

	
	$('#services .service').hover(function() {
		$(this).find('img').stop().animate({ 
        opacity: .1
      }, 250 );
      	$(this).find('a.serviceLink').css('display', 'block');
      	
      }, function() {
		$(this).find('img').stop().animate({ 
        opacity: 1
      }, 250 );
      $(this).find('a.serviceLink').css('display', 'none');
   	});
	 $('.breadcrumbs span').css('opacity', '0');
	 $('.breadcrumbs span').css('width', $('.breadcrumbs span').width()+5);
	 $('.breadcrumbs span').css('left', -$('.breadcrumbs span').width());
	 $('.breadcrumbs, #masthead-wrapper').hover(function() {
		$('.breadcrumbs span').stop().animate({opacity: 1}, 500);
		}, function() {
		$('.breadcrumbs span').stop().animate({opacity: 0}, 250);
      }, 250 );
      
      
	 $('.breadcrumbs p').append(' <span class="test">&larr; you are here</span>');
	 $('.breadcrumbs p span.test').css('opacity', '0');
	 $('.breadcrumbs, #masthead-wrapper').hover(function() {
		$('.breadcrumbs span.test').stop().animate({opacity: 1}, 500);
		}, function() {
		$('.breadcrumbs span.test').stop().animate({opacity: 0}, 250);
      }, 250 );
      
      
      
      
  $('a[href*=#]').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
    && location.hostname == this.hostname) {
      var $target = $(this.hash);
      $target = $target.length && $target
      || $('[name=' + this.hash.slice(1) +']');
      if ($target.length) {
        var targetOffset = $target.offset().top;
        $('html,body')
        .animate({scrollTop: targetOffset}, 1000);
       return false;
      }
    }
  });

		
 });
