
$(document).ready(function () {

////////////////////// Scroller ///////////////////////////////////
var length = $("#content").height();
if (length <= 350) {
	$("#down").css("display","none");
	$("#up").css("display","none");
	}
// Scroll Up //
	$("#up").click(function(){
		$("#down").css("display","block");
		var height = $("#content").height();
		if (height > 350 && height < 690) {
			height = 690;}
		else if (height > 690 && height < 1050) {
			height = 1050;  }
		var marg = parseInt(jQuery("#long").css("margin-top"));
		  if(height > 689){
		  var newheight = height-320;
		  $("#long").animate({ 
			marginTop: marg-320+"px"}, 300 )
		   if(newheight < 689) {
			$("#up").css("display","none");
			};
		}
	 });

// Scroll Down //
	$("#down").click(function(){
		var marg = parseInt(jQuery("#long").css("margin-top"));
		  $("#long").animate({ 
			marginTop: marg+320+"px"}, 300 )
		  var newmarg = marg+320;		  
		  if (newmarg <= 0) {
			 $("#up").css("display","block");
	}
		  if(newmarg == 0){
			$("#down").css("display","none");
	}
	 });

/////////////////////////////////////////////////////////////////

// function getQuerystring(key, default_)
// {
//   if (default_==null) default_="";
//   key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
//   var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
//   var qs = regex.exec(window.location.href);
//   if(qs == null)
//     return default_;
//   else
//     return qs[1];
// }

// var theme = getQuerystring('theme');

///////////////////// Scroll to Theme //////////////////////////////////////////


//  if (theme == "hunt" || theme == "puppet" || theme == "shadow") {
// 	$('html, body').scrollTop(300);
// 	$("#long").css("margin-top","-320px");
// 	 $("#up").css("display","block");
// 	 $("#down").css("display","block");
// }

// else if (theme == "bird" || theme == "jewels" || theme == "sand") {
// 	$('html, body').scrollTop(300);
// 	$("#long").css("margin-top","-660px");
// 	 $("#up").css("display","block");
// 	 $("#down").css("display","block");
// }
// else if (theme == "splat") {
// 	$('html, body').scrollTop(300);
// 	$("#long").css("margin-top","-960px");
// 	 $("#up").css("display","none");
// 	 $("#down").css("display","block");	
// }

// else if (theme == "cook" || theme == "playdoh"){
// 		$('html, body').scrollTop(300);
// }

});

