var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-12131668-4']);
_gaq.push(['_trackPageview']);

$(function() {
	switch(Math.floor(Math.random()*2))
	{
		case 0: $("#header_image").attr("class", "lk"); break;
		case 1: $("#header_image").attr("class", "il"); break;
	}
	
	$(".topnav li").each(function() {
		var subnav = $(this).find("ul.subnav");
		var subnav_wth = 0;
		
		if (subnav.length > 0) {
			if (subnav.children().length > 0) {
				// set sub
				subnav.find("li > *").each(function() {
					if ($(this).width() > subnav_wth)
						subnav_wth = $(this).width();
				});
	
				subnav.find("li > *").each(function() {
					$(this).width(subnav_wth);
				});
				
				// add events
				$(this).bind("mouseenter", 
					function(){
						subnav.stop(true, true);
						subnav.slideDown(500);

				});
				$(this).bind("mouseleave", 
					function(){ 
						subnav.slideUp(200);
				});
			}
			
			// hide subnav
			subnav.hide();
		}
	});
	
	var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);

});