$(document).ready(function () {

var docWidth = $(document).width();

$('div#pagepaintings').css({marginLeft:docWidth});
$('div#pagepaper').css({marginLeft:docWidth*2});
$('div#pagecolorbox').css({marginLeft:docWidth*3});
$('div#pagebiography').css({marginLeft:docWidth*4});
$('div#pageexhibitions').css({marginLeft:docWidth*5});
$('div#pagepresspage').css({marginLeft:docWidth*6});
$('div#pagecontact').css({marginLeft:docWidth*7});
$('img#indicpaintings').css({'opacity':0});
$('img#indicpaper').css({'opacity':0});
$('img#indiccolorbox').css({'opacity':0});
$('img#indicbiography').css({'opacity':0});
$('img#indicexhibitions').css({'opacity':0});
$('img#indicpresspage').css({'opacity':0});
$('img#indiccontact').css({'opacity':0});

var superCheck = $('div#prroller').height();

if (superCheck<415) {
	$('div#scontrols').hide();
}

	$('a#paintings').click(function(e) {
		e.preventDefault();
		$('div#contentbod').stop().animate({marginLeft:-docWidth}, 500);
		$('img#indicpaintings').stop().animate({opacity: 1.0}, 1000);
		$('img#indichome').stop().animate({opacity: 0}, 1000);
		$('img#indicpaper').stop().animate({opacity: 0}, 1000);
		$('img#indiccolorbox').stop().animate({opacity: 0}, 1000);
		$('img#indicexhibitions').stop().animate({opacity: 0}, 1000);
		$('img#indicbiography').stop().animate({opacity: 0}, 1000);
		$('img#indicpresspage').stop().animate({opacity: 0}, 1000);
		$('img#indiccontact').stop().animate({opacity: 0}, 1000);
	});

	$('#contentpaintings img').mouseover(function() {
		$(this).animate({opacity:.5}, 500);
	})
	.mouseout(function() {
			$(this).animate({opacity:1.0}, 500);
	});

	$('a#worksonpaper').click(function(e) {
		e.preventDefault();
		$('div#contentbod').stop().animate({marginLeft:-docWidth*2}, 500);
		$('img#indicpaper').stop().animate({opacity: 1.0}, 1000);
		$('img#indichome').stop().animate({opacity: 0}, 1000);
		$('img#indicpaintings').stop().animate({opacity: 0}, 1000);
		$('img#indiccolorbox').stop().animate({opacity: 0}, 1000);
		$('img#indicexhibitions').stop().animate({opacity: 0}, 1000);
		$('img#indicbiography').stop().animate({opacity: 0}, 1000);
		$('img#indicpresspage').stop().animate({opacity: 0}, 1000);
		$('img#indiccontact').stop().animate({opacity: 0}, 1000);
	});

	$('#contentpaper img').mouseover(function() {
		$(this).animate({opacity:.5}, 500);
	})
	.mouseout(function() {
			$(this).animate({opacity:1.0}, 500);
	});

	$('a#colorbox').click(function(e) {
		e.preventDefault();
		$('div#contentbod').stop().animate({marginLeft:-docWidth*3}, 500);
		$('img#indiccolorbox').stop().animate({opacity: 1.0}, 1000);
		$('img#indichome').stop().animate({opacity: 0}, 1000);
		$('img#indicpaintings').stop().animate({opacity: 0}, 1000);
		$('img#indicpaper').stop().animate({opacity: 0}, 1000);
		$('img#indicexhibitions').stop().animate({opacity: 0}, 1000);
		$('img#indicbiography').stop().animate({opacity: 0}, 1000);
		$('img#indicpresspage').stop().animate({opacity: 0}, 1000);
		$('img#indiccontact').stop().animate({opacity: 0}, 1000);
	});

	$('#contentcolorbox img').mouseover(function() {
		$(this).animate({opacity:.5}, 500);
	})
	.mouseout(function() {
			$(this).animate({opacity:1.0}, 500);
	});

	$('a#biography').click(function(e) {
		e.preventDefault();
		$('div#contentbod').stop().animate({marginLeft:-docWidth*4}, 500);
		$('img#indicbiography').stop().animate({opacity: 1.0}, 1000);
		$('img#indichome').stop().animate({opacity: 0}, 1000);
		$('img#indicpaintings').stop().animate({opacity: 0}, 1000);
		$('img#indicpaper').stop().animate({opacity: 0}, 1000);
		$('img#indiccolorbox').stop().animate({opacity: 0}, 1000);
		$('img#indicexhibitions').stop().animate({opacity: 0}, 1000);
		$('img#indicpresspage').stop().animate({opacity: 0}, 1000);
		$('img#indiccontact').stop().animate({opacity: 0}, 1000);
	});

	$('#contentbiography img').mouseover(function() {
		$(this).animate({opacity:.5}, 500);
	})
	.mouseout(function() {
			$(this).animate({opacity:1.0}, 500);
	});

	$('a#exhibitions').click(function(e) {
		e.preventDefault();
		$('div#contentbod').stop().animate({marginLeft:-docWidth*5}, 500);
		$('img#indicexhibitions').stop().animate({opacity: 1.0}, 1000);
		$('img#indicbiography').stop().animate({opacity: 0}, 1000);
		$('img#indichome').stop().animate({opacity: 0}, 1000);
		$('img#indicpaintings').stop().animate({opacity: 0}, 1000);
		$('img#indicpaper').stop().animate({opacity: 0}, 1000);
		$('img#indiccolorbox').stop().animate({opacity: 0}, 1000);
		$('img#indicpresspage').stop().animate({opacity: 0}, 1000);
		$('img#indiccontact').stop().animate({opacity: 0}, 1000);
	});

	$('#contentexhibitions img').mouseover(function() {
		$(this).animate({opacity:.5}, 500);
	})
	.mouseout(function() {
			$(this).animate({opacity:1.0}, 500);
	});

	$('a#presspage').click(function(e) {
		e.preventDefault();
		$('div#contentbod').stop().animate({marginLeft:-docWidth*6}, 500);
		$('img#indicpresspage').stop().animate({opacity: 1.0}, 1000);
		$('img#indicexhibitions').stop().animate({opacity: 0}, 1000);
		$('img#indicbiography').stop().animate({opacity: 0}, 1000);
		$('img#indichome').stop().animate({opacity: 0}, 1000);
		$('img#indicpaintings').stop().animate({opacity: 0}, 1000);
		$('img#indicpaper').stop().animate({opacity: 0}, 1000);
		$('img#indiccolorbox').stop().animate({opacity: 0}, 1000);
		$('img#indiccontact').stop().animate({opacity: 0}, 1000);
	});

	$('#contentpresspage img').mouseover(function() {
		$(this).animate({opacity:.5}, 500);
	})
	.mouseout(function() {
			$(this).animate({opacity:1.0}, 500);
	});
	$('a#contact').click(function(e) {
		e.preventDefault();
		$('div#contentbod').stop().animate({marginLeft:-docWidth*7}, 500);
		$('img#indiccontact').stop().animate({opacity: 1.0}, 1000);
		$('img#indicpresspage').stop().animate({opacity: 0}, 1000);
		$('img#indicexhibitions').stop().animate({opacity: 0}, 1000);
		$('img#indicbiography').stop().animate({opacity: 0}, 1000);
		$('img#indichome').stop().animate({opacity: 0}, 1000);
		$('img#indicpaintings').stop().animate({opacity: 0}, 1000);
		$('img#indicpaper').stop().animate({opacity: 0}, 1000);
		$('img#indiccolorbox').stop().animate({opacity: 0}, 1000);
	});

	$('#contentcontact img').mouseover(function() {
		$(this).animate({opacity:.5}, 500);
	})
	.mouseout(function() {
			$(this).animate({opacity:1.0}, 500);
	});


	$('a#homebtn').click(function(e) {
		e.preventDefault();
		$('div#contentbod').stop().animate({marginLeft:0}, 500);
		$('img#indichome').stop().animate({opacity: 1.0}, 1000);
		$('img#indiccontact').stop().animate({opacity: 0.0}, 1000);
		$('img#indicpresspage').stop().animate({opacity: 0}, 1000);
		$('img#indicexhibitions').stop().animate({opacity: 0}, 1000);
		$('img#indicbiography').stop().animate({opacity: 0}, 1000);
		$('img#indicpaintings').stop().animate({opacity: 0}, 1000);
		$('img#indicpaper').stop().animate({opacity: 0}, 1000);
		$('img#indiccolorbox').stop().animate({opacity: 0}, 1000);
	});

	$('a#exscrolldown').click(function(e) {
		e.preventDefault();
		newsCheck = $('div#exroller').height();
		var checker = 415 - newsCheck;
		var curr = parseInt($('div#exroller').css('marginTop'));
		var user = curr-415;
		if (user>checker) {
			newsCheck = user;
		} else {
			if ((user == checker) && (curr == -522)) {
				return;
			}
			while (user<checker) {
				user+=1;
			}
		newsCheck = user;
		}
		var pxls = newsCheck;
		$('div#exroller').stop().animate({marginTop:newsCheck}, 300, 'swing', function() { $('div#exroller').css( {marginTop: pxls} ) })
  	});


	$('a#exscrollup').click(function(e) {
		e.preventDefault();
		newsCheck = $('div#exroller').height();
		var checker = 0;
		var curr = parseInt($('div#exroller').css('marginTop'));
		var user = curr+405;
		if (user<checker) {
		newsCheck = user;
		} else {
			while (user>checker) {
				user-=1;
			}
			newsCheck = user;
		}
		var pxls = newsCheck;
		$('div#exroller').stop().animate({marginTop:newsCheck}, 300, 'swing', function() { $('div#exroller').css( {marginTop: pxls} ) })
  	});

	$('a#prscrolldown').click(function(e) {
		e.preventDefault();
		newsCheck = $('div#prroller').height();
		var checker = 415 - newsCheck;
		var curr = parseInt($('div#prroller').css('marginTop'));
		var user = curr-415;
		if (user>checker) {
			newsCheck = user;
		} else {
			if ((user == checker) && (curr == -522)) {
				return;
			}
			while (user<checker) {
				user+=1;
			}
		newsCheck = user;
		}
		var pxls = newsCheck;
		$('div#prroller').stop().animate({marginTop:newsCheck}, 300, 'swing', function() { $('div#prroller').css( {marginTop: pxls} ) })
  	});


	$('a#prscrollup').click(function(e) {
		e.preventDefault();
		newsCheck = $('div#prroller').height();
		var checker = 0;
		var curr = parseInt($('div#prroller').css('marginTop'));
		var user = curr+405;
		if (user<checker) {
		newsCheck = user;
		} else {
			while (user>checker) {
				user-=1;
			}
			newsCheck = user;
		}
		var pxls = newsCheck;
		$('div#prroller').stop().animate({marginTop:newsCheck}, 300, 'swing', function() { $('div#rroller').css( {marginTop: pxls} ) })
  	});


	

});
