$(function (){ 
//SLIDER - web slide panel
	var webpanelTotal = $('.web-panel_holder').length;
	var webslideLeft = 2;
	var webslideRight = 2;
	var webwindowWidth = 986;
	
	var webpanelContainerWidth = webpanelTotal * webwindowWidth + 'px';
	$('#web-slider_panels').width(webpanelContainerWidth);
	
	if(webpanelTotal <= 1) {
		$('#webRightArrow').hide();		
	}
	
	$('#webRightArrow').click(function() {
		if(webslideLeft == webpanelTotal) {
			$('#webRightArrow').hide();	
			
		}
		if(webslideRight != 1) {
			$('#webLeftArrow').show();	
		}
		var webleft = ((webslideLeft * webwindowWidth) - webwindowWidth) * -1;
		$('#web-slider_panels').animate({ left: webleft+'px' });
		webslideLeft++;
		webslideRight--;
	});
	
	$('#webLeftArrow').click(function() {
		
		if(webslideRight == 1) {
			$('#webLeftArrow').hide();	
		}
		if(webslideLeft != webpanelTotal) {
			$('#webRightArrow').show();	
		}
		var webright = ((webslideRight * webwindowWidth) - webwindowWidth) * 1;
		$('#web-slider_panels').animate({ left: webright+'px' });
		webslideRight++;
		webslideLeft--;
	});
	
//SLIDER - print slide panel
	var printpanelTotal = $('.print-panel').length;
	var printslideLeft = 2;
	var printslideRight = 2;
	var printwindowWidth = 585;
	
	var printpanelContainerWidth = printpanelTotal * printwindowWidth + 'px';
	$('#print-slider_panels').width(printpanelContainerWidth);
	
	if(printpanelTotal <= 1) {
		$('#printRightArrow').hide();		
	}
	
	$('#printRightArrow').click(function() {
		if(printslideLeft == printpanelTotal) {
			$('#printRightArrow').hide();		
		}
		if(printslideRight != 1) {
			$('#printLeftArrow').show();	
		}
		var printleft = ((printslideLeft * printwindowWidth) - printwindowWidth) * -1;
		$('#print-slider_panels').animate({ left: printleft+'px' });
		printslideLeft++;
		printslideRight--;
	});
	
	$('#printLeftArrow').click(function() {
		
		if(printslideRight == 1) {
			$('#printLeftArrow').hide();	
		}
		if(printslideLeft != printpanelTotal) {
			$('#printRightArrow').show();	
		}
		var printright = ((printslideRight * printwindowWidth) - printwindowWidth) * 1;
		$('#print-slider_panels').animate({ left: printright+'px' });
		printslideRight++;
		printslideLeft--;
	});	

			$('.closed').live('click', function() {
				$(this).removeClass('closed');
				$(this).addClass('opened');
				$('#header').animate({ top: '300px' }, 500, 'linear');
				$('#fadeStrip').animate({ top: '457px' }, 500, 'linear');
				$('#wrapper').animate({ top: '300px' }, 500, 'linear');
				$('#contact').animate({ top: '0px' }, 500, 'linear');
				$('#contact').css({ height: '305px' });
				return false;
			});
			
			$('.opened').live('click', function() {
				$(this).removeClass('opened');
				$(this).addClass('closed');
				$('#header').animate({ top: '0px' }, 500, 'linear');
				$('#fadeStrip').animate({ top: '157px' }, 500, 'linear');
				$('#wrapper').animate({ top: '0px' }, 500, 'linear');
				$('#contact').animate({ top: '-300px' }, 500, 'linear');
				$('#contact').css({ height: '300px' });
				return false;
			});
			
		$(window).scroll(function () {
			var offset = $(window).scrollTop();
			//alert(offset);
			if(offset >= 0 && offset <= 752) {
				$('#portfolioBTN').removeClass('select');
				$('#aboutBTN').removeClass('select');
				$('#homeBTN').addClass('select');
			}
			if(offset >=780 && offset <= 2170) {
				$('#homeBTN').removeClass('select');
				$('#aboutBTN').removeClass('select');
				$('#portfolioBTN').addClass('select');
			}
			if(offset >= 2000) {
				$('#homeBTN').removeClass('select');
				$('#portfolioBTN').removeClass('select');
				$('#aboutBTN').addClass('select');
			}
		});
		
		
});



