			function vc_next(){
				var el = $("article.index .slide[current='1']");
				var next_el = el.next('.slide');
				$('.prev').removeClass('no');
				if(next_el.length == 0)
				{
					$('.next').addClass('no');
					return;
				}
				$("article.index .slide").css('display','none');
			   	next_el.fadeIn('fast');
				el.attr('current', '0');
				next_el.attr('current','1');
			}
			function vc_prev(){
				var el = $("article.index .slide[current='1']");
				var prev_el = el.prev('.slide');
				$('.next').removeClass('no');
				if(prev_el.length == 0)
				{
					$('.prev').addClass('no');
					return;
				}
				$("article.index .slide").css('display','none');
			  	prev_el.fadeIn('fast');
				el.attr('current', '0');
				prev_el.attr('current','1');
			}


$(document).ready(function(){
			$('#slider').anythingSlider({
                width : 940,          // Override the default CSS width
                easing: 'easeInOutExpo',
				height: 337,
				delay: 5000
            });

    jQuery('#carusel').jcarousel({
    scroll: 1
	}
	);

	$('.printable tr:nth-child(odd)').addClass('lightgray');

			
	//Gallery
	
	//shadow
		var shadow = $('#shadow');
		var marginLeft;
		var marginTop;
		var shadowHeight = $(document).height();
		shadow.css('height',shadowHeight+'px');
	
	$('.gallery .it .i').click(function(){
		var obj = $(this).parent().children('.bigIt');
		shadow.fadeIn('fast');		
		marginLeft = ($(window).width() - obj.width())/2 + 'px';
		marginTop = (($(window).height() - obj.height())/2 + $(window).scrollTop()) + 'px';
		$('#box').css('top', marginTop);
		$('#box').css('left', marginLeft); 
		var clon = obj.clone();
		$('#box').append(clon);
		clon.css('display','block');
		$('#box').delay('300').fadeIn('fast');
		$(this).parent().attr('current','1');	
	});
	
	shadow.click(function(){
		$('#box').fadeOut('fast', function(){
			$(this).empty();
		}) ;
		shadow.delay('300').fadeOut('fast');
		$('.gallery .it').attr('current','0');
	
	});
	
	$('.close img').live('click',function(){
		$('#box').fadeOut('fast', function(){
			$(this).empty();
		}) ;
		shadow.delay('300').fadeOut('fast');
		$('.gallery .it').attr('current','0');	
		
	});
	
	$('.next_1').live('click',function(){
		var elm = $(".gallery .it[current='1']");
		var next_elm = elm.next('.it');
		var next_elmImg = elm.next('.it .bigImg img');
		if(next_elm.size() == 0)
		{
			$(this).addClass('no');	
			return;
		}
		$('#box').css('display','none') ;
		$('#box').empty();
		marginLeft = ($(window).width() - next_elm.children('.bigIt').width())/2 + 'px';
		marginTop = (($(window).height() - next_elm.children('.bigIt').height())/2 + $(window).scrollTop()) + 'px';
		$('#box').css('top', marginTop);
		$('#box').css('left', marginLeft); 
		var clon = next_elm.children('.bigIt').clone();
		$('#box').append(clon);
		clon.css('display','block');
		$('#box .bigImg').css('display','none');
	   	$('#box').css('display','block') ;
		$('#box .bigImg').fadeIn('normal')
		elm.attr('current', '0');
		next_elm.attr('current','1');
	});
	
	$('img#prev').live('click',function(){
		var elm = $(".gallery .it[current='1']");
		var prev_elm = elm.prev('.it');
		if(prev_elm.length == 0)
		{
			$(this).addClass('no');	
			return;
		}
		$('#box').css('display','none') ;
		$('#box').empty();
		marginLeft = ($(window).width() - prev_elm.children('.bigIt').width())/2 + 'px';
		marginTop = (($(window).height() - prev_elm.children('.bigIt').height())/2 + $(window).scrollTop()) + 'px';
		$('#box').css('top', marginTop);
		$('#box').css('left', marginLeft); 
		var clon = prev_elm.children('.bigIt').clone();
		$('#box').append(clon);
		clon.css('display','block');
		$('#box .bigImg').css('display','none');
	   	$('#box').css('display','block') ;
		$('#box .bigImg').fadeIn('normal')
		elm.attr('current', '0');
		prev_elm.attr('current','1');	
	});
	
	$('.gallery .l .buttons #next').addClass('no');
	$('.gallery .f .buttons #prev').addClass('no');
	
	//Side panel
	$('#sider').toggle(function(){
		$(this).addClass('sd');
		$(this).animate({width: '555px', height:'817px'},500, function(){
			$(this).children('div.f').fadeIn('500');	
		});
		
		

	},
	function(){
		$(this).removeClass('sd');
		$(this).children('div.f').fadeOut('500', function(){
			$(this).parent().animate({width: '50px', height:'230px'},500);	
		});
		

		$(this).css('cursor','pointer');	
	});


	//FAQ
	$('.faq .it').hover(function(){
		$(this).css('cursor','pointer');
		$(this).animate({opacity: 1},500);	
	},
	function(){
		$(this).animate({opacity: .6},500);
	});
	$('.faq .it').click(function(){
		$('.faq .it .admin').slideUp('normal');
		$(this).children('.admin').slideDown('normal');	

		$(this).toggleClass('pointer');	

	}
	)
});


