$(function(){
	$("#navigation ul li").hover(function() {
		
		var li_width = $(this).width();
		var dd_width = 172;
		
		if(dd_width>li_width){
			$(this).find('.dd').css('left', -(dd_width-li_width)/2);
		}
		
		if(dd_width<li_width){
			$(this).find('.dd').css({
				left: 0,
				top: '26px'
			});
		}
		
		if(!($(this).find(".dd").is(':animated')))
    	{
    		if($(this).find(".dd").length){
    			$(this).find(".dd").slideDown();
    			$(this).addClass('has-dd');	
    		}
    	}
			
		}, function(e) {
		var _this = $(this);
		$(this).find(".dd").slideUp(function(){
			_this.removeClass('has-dd');
		});
	});
	
	$('.blink').focus(function () {
		if ($(this).val() == $(this).attr('title')) {
			$(this).val('');
		}
	});
	
	$('.blink').blur(function () {
		if ($(this).val() == '') {
			$(this).val($(this).attr('title'));
		}
	});
	
	
	$('.selects select').selectbox();
})
