$(document).ready(function(){
	
		(function(){
		var ua = $.browser;
		if (ua.mozilla && ua.version=='5.0') {
			$('html').addClass('firefox5');
		} else if (ua.mozilla && ua.version == '1.9.2.18') {
			$('html').addClass('firefox36');
		} else if (ua.mozilla && ua.version == '2.0.1') {
			$('html').addClass('firefox4');			
		}

	})();
	
	(function(){
		var totalW = 0;
		$('#footerNav li').each(function(){
			totalW += $(this).outerWidth(true)+5;
		});		
		$('#footerNav').css('width',totalW);
	})();	

	$('a[rel*="sz_popup"]').click(function(){
		var t = $(this),
				tHref = t.attr('href') || '';
		
		$('html').css('overflow','hidden');
		
		$('<div id="sz_overlayer"> </div>')
		.css({
			'top' : $(document).scrollTop(),
			'backgroundColor' : '#000000',
			'position' : 'absolute',
			'width' : '100%',
			'height' : '100%',
			'opacity' : 0
		})
		.animate({'opacity' : .5})
		.appendTo('body');
		
		
		$('<div id="sz_popup"></div>')
		.css({
			'backgroundColor' : '#ffffff',
			'padding' : '15px',
			'position' : 'absolute',
			'border' : '1px solid #000',
			'left' : ($('body').width() - $(tHref).width())/2,
			'top' : $(document).scrollTop() + 60
		})
		.appendTo('body');
		
		$('<a href="#" class="closeBtn">Close</a>').css({
			'display' : 'block',
			'top' : '-21px',
			'right' : '0',
			'position' : 'absolute',
			'backgroundColor' : '#000',
			'padding' : '3px',
			'color' : '#fff'
		}).appendTo($('#sz_popup'));
		
		$('#sz_popup').append($(tHref).html());
		
		$('.closeBtn, #sz_overlayer').click(function(){
			$('#sz_popup, #sz_overlayer').fadeOut(function(){
				$(this).remove();
				$('html').css('overflow','auto');
			})
		});
		
		return false;
		
	});
	
	var d=$("div.slider .unique .item").size();
	var c=$("div.slider .unique .item:first").outerWidth();
	
	var f=(d*c);
	$("div.slider .unique").width(f);
	$("div.slider").width(804);
	
	var b=$("div.slider .itemHolder").outerWidth();
	currentPos=0;
	
	$("div.slider .unique").clone().prependTo($("div.slider .itemHolder"));
	$("div.slider .items:first-child").addClass("clone").removeClass("unique");
	$("div.slider .clone").css("margin-left",(d*c)*-1);
	
	
	function a(){
		if(hs.timers.homeSlideTimer!=undefined){clearTimeout(hs.timers.homeSlideTimer);
			delete hs.timers.homeSlideTimer
		}
		hs.timers.homeSlideTimer=setTimeout(function(){
		$("a.slideRight").click()},6000)}a();
		$("a.slideLeft").click(function(g){
		if($("div.slider .unique:animated").length<=0){
			targetPos=currentPos+c;
			currentPos=targetPos;
			$("div.slider .unique").animate({marginLeft:targetPos},700);
			$("div.slider .clone").animate({marginLeft:(targetPos-f)},700,e)}a();
			g.preventDefault()
		});
		
		$("a.slideRight").click(function(g){
			if($("div.slider .unique:animated").length<=0){
				targetPos=currentPos-c;
				currentPos=targetPos;
				$("div.slider .unique").animate({marginLeft:targetPos},700);
				$("div.slider .clone").animate({marginLeft:(targetPos-f)},700,e)}a();
				g.preventDefault()
			});
		function e(){var h=(currentPos-f+c);
		var g=currentPos+(c*((Math.round($("div.slider").outerWidth()/c))-1));
		if(h==0){
			$("div.slider .unique").css("margin-left",(currentPos-f));
			$("div.slider .clone").css("margin-left",((currentPos-f)-f));
			currentPos=(currentPos-f)
		}
		if(g==0){
			$("div.slider .unique").css("margin-left",(currentPos+f));
			$("div.slider .clone").css("margin-left",((currentPos+f)-f));
			currentPos=(currentPos+f)
		}
	}
	
	
	
	
	$(".slider .items .item").mouseenter(function(){$(this).addClass("active")}).mouseleave(function(){$(this).removeClass("active")});

																																																																																																																																																																																																																																																																																																																																																																																																																																																						});

