/*
 * BROWSER DETECTION
 * 
 * Style selector .opera .elements {}
 */
if (window.opera) {
	document.documentElement.className += ' opera';
}
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
if (is_chrome) {
	document.documentElement.className += ' chrome';
}
/*
 * END
 */

/*
 * DROP DOWN MENU
 */
$(document).ready(function() {
	$('#menu-list li.headlink').hover(function() {
		$('ul', this).css('display', 'block');

		/*
		 * ie FIX
		 */
		var maxWidth = 0;
		$(this).find('ul li').each(function() {
			var tWidth = $(this).find('a').text().length * 4;
			if (tWidth > maxWidth) {
				maxWidth = tWidth;
			}

		});

		$('ul', this).css('width', maxWidth + 'px');
		$('ul', this).css('min-width', $(this).width() + 'px');

		/*
		 * height fix
		 */
		$(this).find('ul li').each(function() {
			$(this).css('height', ($(this).find('a').height() + 7) + 'px');
		});

		$('a.head', this).addClass('selected');
	}, function() {
		$('ul', this).css('display', 'none');
		$('a.head', this).removeClass('selected');
	});
});
/*
 * END;
 */
