$(document).ready(function(){
	$('#mainMenu a.active').parent().next('li').find('a').addClass('hoverNext');
	$('#mainMenu a').hover(function(){
		$('#mainMenu a').removeAttr('style');
		$(this).css({
			'background-image':'url(/sites/vuj/static/images/topmenu_first.png)',
			'background-position':'-15px center',
			'background-repeat':'no-repeat',
			'background-color':'#777ca0',
			'color':'#fff'
		}).addClass('lastHovered');
		$('.hoverNext').removeClass('hoverNext');
		if (!$(this).hasClass('active')) {
			$('#mainMenu a.active').css({
				'background-color':'#fff',
				'color':'#777ca0'
			});
			//Cufon.set('fontFamily', 'Myriad Pro').replace('#mainMenu a.active');
		}
		$(this).parent().next('li').find('a').addClass('hoverNext');
	}/*, function(){
		$(this).parent().next('li').find('a').removeClass('hoverNext');
		if (!$(this).hasClass('active')) {
			$('#mainMenu a.active').css({
				'background-color':'#777ca0',
				'color':'#fff'
			});
			//Cufon.set('fontFamily', 'Myriad Pro').replace('#mainMenu a.active');
		}
		$('#mainMenu a.active').parent().next('li').find('a').addClass('hoverNext');
	}*/);
	
	$("#viewline1").viewline({
		arrow_content:		false,
		vertical_align:		false,
		smart_width: 		true,
		viewline_width:		868, /* 0 = window width (default) / Any int value */
		auto_play:			true,
		interval:			4000,
		pauseonover:		true,
		arrow_wrapper:		'.carousel', /* null (default) / Any ID (#id) or Class (.class) */
		animation:			'dropdown', /* dropdown (default) / popup / fade */
		animation_in:		400,
		animation_out:		200,
		animation_delay:	0
	});
/*	
	Cufon.set('fontFamily', 'Myriad Pro').replace('#text h1', {
		textShadow: '3px 3px rgba(255,255,255,0.6)'
	})('#text h2', {
		textShadow: '2px 2px rgba(255,255,255,0.6)'
	})('.myr', {
		hover:true
	});
	Cufon.set('fontFamily', 'Myriad Pro Condensed').replace('#ribbon')('#footer h4')('a.bigLink')('.item span');
	*/
	
	Cufon.set('fontFamily', 'Myriad Pro').replace('#text h1', {
		textShadow: '3px 3px rgba(255,255,255,0.6)'
	})('#text h2', {
		textShadow: '2px 2px rgba(255,255,255,0.6)'
	});
	Cufon.set('fontFamily', 'Myriad Pro Condensed').replace('#footer h4')('a.bigLink');
	
	$('#cycle').after('<div id="cyclePager">').cycle({ pager: '#cyclePager' });

	$('#ribbon h1').css({
		'left': 450
	});
	ribbon();
});

function ribbon() {
	$('#ribbon h1').animate({
		'left': /* -1*$(this).width() */ -840
	}, 10000, "linear", function(){
		$('#ribbon h1').css({
			'left': 450
		}, 10000);
		/* var t = setTimeout('ribbon()', 10); */
		ribbon();
	});
}
