$(function(){

var obj=jQuery('#top_left');

//menu stretch and not

function topMenuTall(){
var parWidth =parseFloat(jQuery(this).outerWidth());
var currPos = jQuery(this).position();
var currPosL = parseFloat(currPos.left);
var newPosL = currPosL
var parHeight =28
jQuery(this).children('ul').css({'left':newPosL+'px', 'top':parHeight})
jQuery(this).children('ul').slideDown();
jQuery('ul li',this).css({'background-image':'url(images/top_arrow_r.png)','background-repeat':'no-repeat','background-position':'8px 8px'})


}

function topMenuSmall(){
jQuery(this).children('ul').slideUp();
}



//inner stretch and not

function topMenuLiTall(){
jQuery(this).animate({height:80})
jQuery(this).css({'background-image':'url(images/arrow_top.png)','background-repeat':'no-repeat','background-position':'5px 11px'});
jQuery('.tmhead ',this).css({'color':'#fff'});
}

function topMenuLiSmall(){
jQuery('.tmhead ',this).css({'color':'#999'}); 
jQuery(this).css({'background-image':'url(images/top_arrow_r.png)','background-repeat':'no-repeat','background-position':'8px 8px'})
jQuery(this).animate({height:27});
}


jQuery('li',obj).each(function(i){
if(jQuery(this).children('ul').length>0){jQuery(this).addClass('topStretcher');
}
jQuery(this).hoverIntent({over:topMenuTall, out:topMenuSmall, timeout:400})
jQuery('.top_slide').hoverIntent({over:topMenuLiTall, out:topMenuLiSmall, timeout:400})

})


})
