jQuery.noConflict();
	(function($) {
	$(document).ready(function() {
		$('a.panel').click(function () {
	
			$('a.panel').removeClass('selected');
			$(this).addClass('selected');			
			
			curval=$(this).attr('rel');
			
			current = $(this);
			$('#wrapper1').scrollTo($(this).attr('href'), 800);		
			
			
			
			
			if(curval > 1)
			{
				prev=eval(curval)-1;
				if(prev==1)
					preval="home";
				if(prev==2)
					preval="about";
				if(prev==3)
					preval="services";
				if(prev==4)
					preval="portfolio";
				if(prev==5)
					preval="clients";
				if(prev==6)
					preval="contact";			
				
				$('#previd').attr('href', '#'+preval);
				$('#previd').attr('rel',prev);
			}
			if(curval < 6)
			{
				next=eval(curval)+1;
				if(next==1)
					nextval="home";
				if(next==2)
					nextval="about";
				if(next==3)
					nextval="services";
				if(next==4)
					nextval="portfolio";
				if(next==5)
					nextval="clients";
				if(next==6)
					nextval="contact";	
				
				$('#nextid').attr('href', '#'+nextval);
				$('#nextid').attr('rel',next);
			}		
			
			return false;
		});
		
		$(window).resize(function () {
			resizePanel();
		});
		
	});
	
	
	/*function resizePanel() {
	
		width = $(window).width();
		height = $(window).height();
	
		mask_width = width * $('.item').length;
			
		$('#debug').html(width  + ' ' + height + ' ' + mask_width);
			
		$('#wrapper1, .item').css({width: width, height: height});
		$('#mask').css({width: mask_width, height: height});
		$('#wrapper1').scrollTo($('a.selected').attr('href'), 0);
			
	}*/
	})(jQuery);
