$(window).load(function(){			   
//external link to new window			   
$('body a').filter(function() { 
    return this.hostname && this.hostname !== location.hostname; 
  }).addClass('external')
  .click(function() { 
    window.open(this.href); 
    return false; 
  });
 });

$(document).ready(function(){
			   
	 $('.box p.next a,.box img,.h1 a').hover(
         function(){
            $(this).parent().parent().css('background-position','-270px 0');
         },function(){
            $(this).parent().parent().css('background-position','0 0');
         }
     )
 //fce menu
 	$('div#header>ul>li').each(function(){

		// elements specifications
		var a = $(this).children('a');
		var li = $(this);
		var children = li.children("ul:first").length;

		// menu li hover
		li.hover(function(){
			// over
			if (children == 1) {
				li.children("ul:first").stop(false, true).slideDown(150);
			}
			a.addClass("hovered");
		}, function(){
			// out
			if (children == 0) {
				a.removeClass("hovered");
			} else {
				li.children("ul:first").stop(true, true).slideUp(100, function(){
					a.removeClass("hovered");
				});
			}
		});
	});		
});
