function slide(type)
{
	_div = $(".slider");
	total_width = _div.width();
	wrapper_witdh = $(".slider_wrapper").width();
	total_x = _div.position().left;
	is_next = total_width - wrapper_witdh + total_x - 20;
	newprev = total_x + 160;
	newnext = total_x - 160;
	
	if (total_x - 160 < wrapper_witdh - total_width)
	{
		newnext = wrapper_witdh - total_width - 0;
	}
	
	if (newprev > 0)
	{
		newprev = 0;
	}
	
	if (!type && total_x < 0) 
	{
		_div.animate({"left": newprev}, { duration: 500, queue: false });
	}
	
	if (type && is_next > 0) 
	{ 
		_div.animate({"left": newnext}, { duration: 500, queue: false });
	}
}
$(function() {

	$("a[rel='fancy']").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	800, 
		'speedOut'		:	400, 
		'overlayShow'	:	true,
		'autoScale'		:	true,
		'overlayColor'	:	'#000000',
		'titlePosition'	:	'inside'
	});
	
	$("a[rel='fancy-inline']").fancybox({
		'titlePosition'		: 'inside',
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'overlayColor'	:	'#000000'
	});
		
	$(".linkblock > ul li a").click(function() {
		var rel = $(this).attr("rel");
		$(".linkblock .container").removeClass("active");
		$(".linkblock ."+rel).addClass("active");
		$(".linkblock ul li").removeClass("active");
		$(this).parent("li").addClass("active");
	});
	
	$("#content table tr:odd").addClass("odd");
	
	$(".tab_control a").click(function() {
		var rel = $(this).attr("rel");
		$(this).parents(".tabs").children(".container").removeClass("active");
		$(this).parents(".tabs").children(".container."+rel).addClass("active");
		$(this).parents(".tab_control").children("li").removeClass("active");
		$(this).parent("li").addClass("active");
	});
		
});
