var $timer;
$(document).ready(function(){


$window_width = $(window).width()
if ($window_width < 1095)
{
	$('body').addClass('small_window')
}

Cufon.replace('#menu li a', { fontFamily: 'tomis_font', hover: true, textShadow: '#666 1px 1px' });
Cufon.replace('.title', { fontFamily: 'tomis_font2', textShadow: '#999 1px 1px' });
Cufon.replace('div.promo .title', { fontFamily: 'tomis_font2', textShadow: '#111 1px 1px' });
Cufon.replace('h2.sibling_title', { fontFamily: 'tomis_font2', textShadow: '#111 1px 1px' });
Cufon.replace('#submenu li', { fontFamily: 'tomis_font2', hover: true, textShadow: '#999 1px 1px' });
Cufon.replace('body.home div.body p, div.head', { fontFamily: 'tomis_font2', textShadow: '#e3e1da 1px 1px' });
//Cufon.replace('.nav li a', { fontFamily: 'Futura Hv BT', hover: true });
//Cufon.replace('.nav li.current_page_item a, .nav li.current_page_parent a', { fontFamily: 'Futura Hv BT', hover: false, textShadow: "1px 1px #7000a4" });
//Cufon.replace('.category', { fontFamily: 'Futura Hv BT', textShadow: "1px 1px #665e52"});
//Cufon.replace('.subnav', { fontFamily: 'Futura Hv BT', textShadow: "1px 1px #7000a4"});
//Cufon.replace('.pageTitle', { fontFamily: 'Futura Hv BT'});
//Cufon.replace('.subnav .head', { fontFamily: 'Futura Hv BT'});
//Cufon.replace('.body h2', { fontFamily: 'Futura Hv BT'});

//Cufon.replace('#secondary .extra h2', { fontFamily: 'Futura Hv BT', textShadow: "1px 1px #665e52"});
//Cufon.replace('#secondary .quickContact', { fontFamily: 'Futura Hv BT'});

//Cufon.replace('body.home #presentation div.doctor p.quote', { fontFamily: 'Futura Hv BT', textShadow: "1px 1px #e5ded3"});

//Cufon.replace('body.home #featured p.title', { fontFamily: 'Futura Hv BT'});
//Cufon.replace('body.home #featured h2', { fontFamily: 'Futura Hv BT', hover: true, textShadow: "1px 1px #36004f"});


	if ($('body').hasClass('page-id-108'))
	{
		$('div.body p').click(function(){
			$(this).addClass('selected');
			$('div.body ul.curent_list').animate({'height': 'toggle', 'opacity': 'toggle'}).removeClass('curent_list');
			$(this).next('ul').addClass('curent_list').animate({ 'height': 'toggle', 'opacity': 'toggle'}, function() {});
		});
	}

	$('#gallery li a').lightBox();

	$("#gallery_container").scrollable({ 
		items: '#gallery',
		size: 4,
		next: '#gallery_area .right', 
		prev: '#gallery_area .left' ,
		interval: 3000,
		loop: true,
		keyboard: false
	});


	if ($('body').hasClass('home'))
	{


	/* GALLERY */
	$("#promos").scrollable({ 
		items: '#promos_cnt',
		interval: 3000,
		next: '#promos .navi_right', 
		prev: '#promos .navi_left' 
	});



//		homepage_banners(1);
		$('#boxes div.box').each(function(){
			$(this).addClass('pos_'+$('div.box').index(this));
		});
/*
		$('div.navi_right').click(function(){
			clearTimeout($timer);
			$('#promos div.promo').each(function(){
				if ($(this).hasClass('selected'))
				{
					$curent_item = $('#promos div.promo').index(this);
				}
			});
			$curent_item++
			$('#promos div.pos'+$curent_item).fadeOut(2500, function(){homepage_banners($curent_item+1);});
			return false;
		});

		$('div.navi_left').click(function(){
			clearTimeout($timer);
			$('#promos div.promo').each(function(){
				if ($(this).hasClass('selected'))
				{
					$curent_item = $('#promos div.promo').index(this);
				}
			});
			$curent_item++
			if ($curent_item != 1)
			{
				$('#promos div.pos'+$curent_item).fadeOut(2500, function(){homepage_banners($curent_item-1);});
			}
			if ($curent_item == 1)
			{
				$('#promos div.pos'+$curent_item).fadeOut(1500, function(){homepage_banners($('#promos div.promo').length);});
			}
			return false;
		});
*/
	}


	$('#menu li').hover(
		function(){$(this).addClass('selected');},
		function(){$(this).removeClass('selected');}
	);


//	$('div.entry h2').each(function(){
//	    var $current_html =$(this).html();
//		$(this).html('<span class="subtitle_cnt">'+$current_html+'</span>');
//	});

	$('#promos div.promo').hover(
		function(){ $(this).addClass('selected');},
		function(){ $(this).removeClass('selected');}
	);
	$('#brands li').hover(
		function(){ $(this).addClass('selected');},
		function(){ $(this).removeClass('selected');}
	);



});
