$(document).ready(function(){
	  
	  /* Reset Font Size */
	  var originalFontSize = $('body').css('font-size');
	      $(".resetFont").click(function(){
	      $('body').css('font-size', originalFontSize);
	  });
	      
	  // Increase Font Size
	  $(".increaseFont").click(function(){
	      var currentFontSize = $('body').css('font-size');
	      var currentFontSizeNum = parseFloat(currentFontSize, 10);
	      var newFontSize = currentFontSizeNum*1.2;
	      $('body').css('font-size', newFontSize);
	      return false;
	  });
	  
	  // Decrease Font Size
	  $(".decreaseFont").click(function(){
	      var currentFontSize = $('body').css('font-size');
	      var currentFontSizeNum = parseFloat(currentFontSize, 10);
	      var newFontSize = currentFontSizeNum*0.8;
	      $('body').css('font-size', newFontSize);
	      return false;
	  });
		
	
	  /*
	  // Set equal column heights //
	  var biggestHeight = 0;  
	      //check each of them  
	  $('.equalHeight').each(function(){  
		  //if the height of the current element is bigger then the current biggestHeight value  
		  if($(this).height() > biggestHeight){  
		      //update the biggestHeight with the height of the current elements  
		      biggestHeight = $(this).height();  
		  }  
	  });  
	  
	  // when checking for biggestHeight is done set that height to all the elements  
	  $('.equalHeight').height(biggestHeight); 
	  */
	
	  /* Print window */
	  $("#printLink").click(function() {
	      window.print();
	  });
	  
	  
	  /* Fading news in homepage */
	  $('#fadingNews').innerfade({
					animationtype: 'slide',
					speed: 1000,
					timeout: 7500,
					type: 'sequence',
					containerheight: 'auto'
	  });
	    
	  
	  /* Lightbox for images*/
	  $("a.lightbox").fancybox({ 
			'overlayShow'		: true,
			'easingIn'		: 'easeOutBack',
			'easingOut'		: 'easeInBack',
			'centerOnScroll' : true,
			'hideOnContentClick'	: true,
			'overlayOpacity' : 0.9,
			'overlayColor' : '#333333',
			'titlePosition' : 'inside'
			
			
	  });  
		    

  	/* Solve z-index ie bug */
    
    var zmax = 1;
      $('*').each(function() {
		var cur = parseInt($(this).css('zIndex'));
		zmax = cur > zmax ? $(this).css('zIndex') : zmax; 
    });
    
    
    $('#fancy_wrap').each(function() {
		zmax = zmax + 1000;
		$(this).css("z-index", zmax);
	 
		// Get the overlay children in each iteration of the outer fancy_wrap, bump it's z-index up.
		$(this).children("div#fancy_overlay").each(function() {
		  zmax = zmax + 1000 ;
		  $(this).css("z-index", zmax);
		});
	 
		// And again for another major child div
		zmax = zmax + 1000;
		$(this).children("div#fancy_outer").each(function() {
		  zmax = zmax + 1000 ;
		  $(this).css("z-index", zmax);
		});
    });
    
       
    
	//Dropdown menu
	$('ul.sf-menu').superfish({ 
		  delay:       800,                            
		  animation:   {opacity:'show',height:'show'},  
		  speed:       'fast',                          
		  autoArrows:  false,                           
		  dropShadows: true
	});

		   
});
