$(function() {

	//target blank replacement for html strict
	$('a[rel*=external]').click(function(){window.open(this.href);return false;});

	//image carrousel
    $('#sponsor').cycle({fx:'fade'});
    
    //header menu
    $('ul.topnav li').hoverIntent({over: makeTall,out: makeShort});
    
    
    /*function makeTall(){
    	$(this).find('a').first().addClass('hoverMenu').css('color','#ffffff');
    	$(this).find("ul.subnav").slideDown('fast').show();
    }
    
    function makeShort(){
    	$(this).find('a').removeClass('hoverMenu').css('color','#000');
    	$(this).find("ul.subnav").slideUp('fast');
    }*/
    
    function makeTall()
    {
    	$(this).addClass('hoverLine').find('ul.subnav').slideDown('fast');
    }
    
    function makeShort()
    {
    	$(this).removeClass('hoverLine').find('ul.subnav').slideUp('fast');
    }
   
	// largest height()
	var maxHeight1 = 0;
	
	
	/*$(".startTitle").each(function(){
	      if ($(this).height() > maxHeight1) {
	            maxHeight1 = $(this).height();
	      }
	});
	$(".startExtraTitle").each(function(){
	      if ($(this).height() > maxHeight2) {
	            maxHeight2 = $(this).height();
	      }
	});*/
	$(".overviewBlock").each(function(){
	      if ($(this).height() > maxHeight1) {
	            maxHeight1 = $(this).height();
	      }
	});
	
	// set height of all elements with class of project to maxHeight.
	$(".overviewBlock").height(maxHeight1);

	
	$('#blogPost').click(function() {
  $('#blogForm').slideToggle('slow', function() {
    // Animation complete.
  });
});

	// caroussel on home page
	$('#banner').cycle({
        fx:     'scrollLeft',
        /*speed:  'fast',*/
        timeout: 10000,
        pager:  '#imageNavigation',
		slideExpr: 'img'
    });


});
