$(document).ready(function(){     
  
  jQuery.fn.exists = function(){return ($(this).length > 0);}
  
  $("a[rel*=external]").click(function(){
	this.target= '_blank';
  });
	  
  $("#larger").click(function(){
	var currentFontSize = $('html').css('font-size');
	var currentFontSizeNum = parseFloat(currentFontSize, 10);	
	var newFontSize = currentFontSizeNum+0.8;
	if (newFontSize > 20) { newFontSize = 20; }	
	$('html').css('font-size', newFontSize);	
	return false;
  });
  
  $("#smaller").click(function(){
	var currentFontSize = $('html').css('font-size');
	var currentFontSizeNum = parseFloat(currentFontSize, 10);
	var newFontSize = currentFontSizeNum-0.8;	
	if (newFontSize < 11) { newFontSize = 11; }	
	$('html').css('font-size', newFontSize);
	return false;
  });
  
  $(".searchinput").click(function() {
	$(".searchinput").attr("value","");
  });	  
  
  $(".tekstgrootte").show(); 
	  
  var hashcode = $('#hashcode').val();
  var aantal = $('#tweetssum').val()
  $.ajax({ type: 'GET',url: '/ajax/GetTweets.php?q='+hashcode+'&sum='+aantal,cache: false,success: function(html){
	$(".tweets").hide()				
	$(".tweets").html(html);
	$(".tweets").slideDown();
	
	$("a[rel*=external]").click(function(){
		this.target= '_blank';
	});
	
  }
  }); 	
	
});
