//js navigation extension of theme by Thomas Riis

jQuery(document).ready(function($) {
  
  jQuery('.menu ul li a').mouseover( function(e){
		
		
        var mode = Cookie.read('mode'); // get the stylesheet mode - from cookie (mootools ikke jquery denne sætning)
        
		var w = jQuery('.menu ul li a').outerWidth();
        var top = jQuery('.menu ul li a').position().top;
        var left = jQuery('.menu ul li a').position().left;
		var $t = jQuery(e.target).parent();
			
			jQuery($t).children('ul').find('li').css('display', 'block');
			jQuery($t).children('ul').find('li').css('float', 'none');
			jQuery($t).children('ul').find('li').css('padding', '0');
			jQuery($t).children('ul').css('position', 'absolute');
            if(mode === 'ekstra1'){
                //special position for menu in 'Clean' template
                jQuery($t).children('ul').css('top', top+29);
                jQuery($t).children('ul').css('left', left+10);
                jQuery($t).children('ul').find('li').css('marginTop', '1px');
            }else{
                jQuery($t).children('ul').css('top', top+25);
                jQuery($t).children('ul').css('left', left+60);
                jQuery($t).children('ul').find('li').css('marginTop', '-3px');
            }
			jQuery($t).children('ul').find('li > a').css('background', '#999');
			jQuery($t).children('ul').find('li > a').css('color', '#1A1A1A');
			jQuery($t).children('ul').find('li > a').css('width', w*2);
			jQuery($t).children('ul').find('li').css('border', 0);
			
  });
  
  jQuery('.menu ul').mouseleave( function(){
		//alert('hej');
		jQuery('.menu ul li ul li').css('display', 'none');
  });
  jQuery("a[title='Studieprojekter']").click( function(e){
	e.preventDefault();
  });
  jQuery('.page-item-79 ul').click( function(e){
		
  });
  

});

  function handleSizes(){


    }