$(document).ready(function() {
	if(!$('#mainLinks li').hasClass('active')) {
		active = $('#mainLinks li').eq(0);
		
		active.addClass('active');
		
		active.children('ul').show();
		active.children('ul').parent('li').addClass('active');
		
		subLinksOpen = true;
		subLinkOpenID = 1;
		subLinkLastHoverID = 1;
		topMenu.height(68);
	}
	
	setExternalLinks();
});

function startPrecTimer() {
	$('.precImage1').everyTime(7000, "precTimer", function () {
		//alert($('.page1 img:visible').attr('class'));
		imgShown = $('.page1 img:visible').attr('class');
		
		if ((imgShown.substr(9, 1)) < 3) {
			$('.page1 img:visible').fadeOut('slow', function () {
				if ($(this).next().length == 0)
					$(this).parent().next().fadeIn('slow');
				else 
					$(this).next().fadeIn('slow');
			});
		} else {
			$('.page1 img:visible').fadeOut('slow', function () {
				$('.page1 img:first').fadeIn('slow');
			});
		}
	});
}