$(document).ready(function() {
// Cufon
	Cufon.replace('#content_main_page h1');
	Cufon.replace('.content_center h1');
	Cufon.replace('.content_wide h1');
	Cufon.replace('.content_news h1, .news_date');
	Cufon.replace('.font_trajan');
	Cufon.replace('#subnavigation a', {hover: true});

// scroll pane	
	$('#single_news_container').jScrollPane({
		
		verticalDragMinHeight: 70,
		verticalDragMaxHeight: 70
		});
// jquery slides
	$('#banner').slides({
		effect:  'fade',
		play: 5000,
		pause: 5000	
	});
	
	$('#news').slides({
		effect:  'fade',
		play: 5000,
		pause: 5000,
		generatePagination: false
	});

// hover effetct
	$('#lang a:not("a.lang_current"), a.more_btn, a.btn,').hover(
		function () {
			$(this).stop().animate({backgroundColor: "#a2131c"}, 200);
		},
		function () {
			$(this).stop().animate({backgroundColor: "#3d3c3f"}, 200);
		});
	
	
	$('#gallery img').hover(
		function () {
			$(this).stop().animate({opacity: "0.5"}, 300);
		},
		function () {
			$(this).animate({opacity: "1"}, 300)
		});	
		
	$('a.pmi_logo').hover(
		function () {
			$(this).stop().animate({opacity: "0.75"}, 300);
		},
		function () {
			$(this).animate({opacity: "1"}, 300)
		});	
	
	function setScreen () {	
// checking screen width 
	if ($(window).width()>1260) {
		$('#wrapper_grey').css({width: 1260});		
	} else if ($(window).width()<1024) {
		$('#wrapper_grey').css({width: 1024});		
	} else {
		$('#wrapper_grey').css({width: $(window).width()});	
	};
	
	if ($(window).width()>1024) {
		$('#wrapper').css({width: $(window).width()});		
	} else {
		$('#wrapper').css({width: 1024});	
	};

	}
// setScreen
	setScreen ();
	$(window).resize(function (){
		setScreen ();
	});
	
	$('#tab_navigation').tabify();
	


		
});
