// slideToggle muutReferenssit

$(document).ready(function() {
	$('#hidden').hide();
	
	$('.showMore').click(function() {
		$('#muutReferenssit').slideToggle('slow', function() {	
		});
		if($('.showMore').html() == '<span>-- Näytä lisää referenssejä --</span>') {
			$('.showMore').html('<span>-- Näytä vähemmän referenssejä --</span>');
		} else {
			$('.showMore').html('<span>-- Näytä lisää referenssejä --</span>');
		}
	});
	
	$("#navigation").fadeIn(100).animate({top:"-=5%"},100).animate({top:"+=5%"},100).animate({top:"-=5%"},100)
.animate({top:"+=5%"},100).animate({top:"-=5%"},100).animate({top:"+=5%"},100);

	$("a#yhtLink").click(function () {
		  $('#yhteystiedotOtsikko').parent().parent().effect("highlight", { color: '#444444' }, 3000);
	});
	
	$("a#refLink").click(function () {
		  $('#referenssitOtsikko').parent().parent().effect("highlight", { color: '#444444' }, 3000);
	});

	$('a#yhtLink').smoothScroll({
      offset: 0,
	  scrollTarget: '#yhteystiedotOtsikko',
      easing: 'swing',
      speed: 400
    });
	
	$('a#refLink').smoothScroll({
      offset: 0,
	  scrollTarget: '#referenssitOtsikko',
      easing: 'swing',
      speed: 400
    });
  
  	$('#navigation a').qtip({
	   show: { delay: 0 },
	   hide: { delay: 0 },
	   style: { 
		  color: 'black',
		  textAlign: 'center',
		  color: 'white',
		  tip: 'rightMiddle',
		  name: 'dark' // Inherit the rest of the attributes from the preset dark style
	   },
	   position: {
		  corner: {
			 target: 'leftMiddle',
			 tooltip: 'rightMiddle'
		  }
	   }
	});
	
	$(".replaceAt").replaceWith("@");
   	$(".obfuscate").each(function () { $(this).attr("href", "mailto:"+$(this).text()); });
});
