var verdictlib =
{
	main :
	{
		init : function()
		{
			$('div.b-main-page h1 a span').FontEffect({
				outline :false,
				mirror :false,
				gradient:true, // Apply the gradient effect
				gradientColor :"#c00", // The color of the gradient
				gradientPosition:20, // The start position of the gradient (perc.)*
				gradientLength :50, // The length of the gradient (perc.)*
				gradientSteps :20, // the steps of the gradient
				hideText :false // Hide the source text
			}) 
			
		}
	},
	about :
	{
		init : function()
		{
			//viewer team
			var teamviewer = $('.b-team-viewer')
			var windowwidth = $(window).width()
			$(window).bind('resize', function(event) {
				windowwidth = $(window).width();
			});
			var randopen = Math.floor(Math.random()*$('div.i',teamviewer).length)

			var $lastac = $('div.i a.img',teamviewer).eq(randopen).css({width:'124px',height:'330px'});
			$('img.img-t',$lastac).css('display','none');
			$('img.img-b',$lastac).css('position','relative');
			expandteam($lastac)

			$('div.i',teamviewer).mouseenter(function(){
				var $t = $('a.img',$(this));
				if (!$(this).hasClass('active')) {

					if (typeof $lastac!="undefined") {
						$lastac.parent().removeClass('active')
						$lastac.stop().animate({width:'62px',height:'165px'}, 500, function(){
							$('img.img-t',$(this)).css('display','');
							$('img.img-b',$(this)).css('position','absolute');
						})
					};
					$('img.img-t',$t).css('display','none');
					$('img.img-b',$t).css('position','relative');
					$t.stop().animate({width:'124px',height:'330px'}, 500, function(){
						expandteam($t)
					});
					$lastac = $t
				}
			})
			/* .mouseleave(function(){
				var $t = $('a.img',$(this));
				$(this).removeClass('active')
				$t.stop().animate({width:'62px',height:'165px'}, 500, function(){
						$('img.img-t',$(this)).css('display','');
						$('img.img-b',$(this)).css('position','absolute');
					}
				);
			}); */
			function expandteam(people) {
				var $people = people
				var offset = $people.offset();
				var offsetleft = offset.left;
				var gettip = $people.prev();
				gettip.css('width',gettip.width()+'px')
				if((windowwidth-offsetleft) < (gettip.width()+195)) {
					gettip.addClass('right-tip').css('marginLeft','-'+(gettip.width()-19)+'px')
				}
				else {
					gettip.removeClass('right-tip').css('marginLeft','')
				}
				$people.parent().addClass('active')
			}
		}
	},
	filtersli :
	{
		init : function()
		{
			var elemfaq = document.location.hash;
			//console.info(elemfaq)
			var linkfilters = $('ul.m-filter-nav');
			var ulfilters = $('div.b-filters-ul ul');
			if (elemfaq.length > 1 && elemfaq !='#all') {
				elemfaq = elemfaq.split('#');
				$('li',linkfilters).removeClass('hr');
				$('a[href="#'+elemfaq[1]+'"]',linkfilters).parent().parent().addClass('hr')
				$('li',ulfilters).not('.'+elemfaq[1]).hide();
				$('li.'+elemfaq[1],ulfilters).show();
			};
			$('a',linkfilters).click(function() {
				liparent = $(this).parent().parent();
				if(!liparent.hasClass('hr')) {
					$('li',linkfilters).removeClass('hr');
					liparent.addClass('hr');
					relhref = $(this).attr('href');
					splitrel = relhref.split('#');
					if(splitrel[1]!='all') {
						$('li',ulfilters).not('.'+splitrel[1]).hide();
						$('li.'+splitrel[1],ulfilters).show();
						document.location.hash = splitrel[1];
					}
					else {
						$('li',ulfilters).show();
						document.location.hash = 'all';
					};
				}
				return false;
			});
		}
	},
	news :
	{
		init : function()
		{
			var elemnews = document.location.hash;
			var linkfilters = $('ul#tabs-rubrics');
			var ulfilters = $('div.l-grid-news .pane').hide();
			if (elemnews.length > 1) {
				//elemfaq = elemfaq.split('#');
				$('li',linkfilters).removeClass('hr');
				$('a[href="'+elemnews+'"]',linkfilters).parent().parent().addClass('hr')
				$(elemnews).show();
			}
			else {
				$('div.l-grid-news .pane:first').show()
			}
			$('a',linkfilters).click(function() {
				liparent = $(this).parent().parent();
				if(!liparent.hasClass('hr')) {
					$('li',linkfilters).removeClass('hr');
					liparent.addClass('hr');
					relhref = $(this).attr('href');
					$(ulfilters).hide();
					$(relhref).show();
					//location.hash = relhref;
					return false;
				}
			});
		}
	}
}


