// JavaScript Document

/*$(document).ready(function(){
	$(".smallpic").hover(
		function(){
			$(".smallinactive", $(this).parent()).switchClass("smallinactive", "smallactive", 10);
			//$(".smalltext", parent().parent()).addClass("smalltextactive");
		},
		function(){
			$(".smallactive", $(this).parent()).switchClass("smallactive", "smallinactive", 200);
			//$(".smalltext", parent().parent()).removeClass("smalltextactive");
		}
	)
	
	$(".objectcontainer").hover(
		function(){
			$(".smallinactive", this).switchClass("smallinactive", "smallactive", 10);
			//$(".smalltext", parent().parent()).addClass("smalltextactive");
		},
		function(){
			$(".smallactive", this).switchClass("smallactive", "smallinactive", 200);
			//$(".smalltext", parent().parent()).removeClass("smalltextactive");
		}
	)
	
	$("a.test").click(
		function(){
		$(window).scrollTo("#test",2000);
		}
	);
	
	var prevId = "";
	
	$(".objectcontainer").click(
		function(){
			if (prevId > "0" & !(prevId == this.id)) {
				closeMe(prevId);
			}
			$(".smallpic", this).switchClass("smallpic", "smallpicinactive", 1),
			$(".smallactive .content", this).load("objectsections.php ." + this.id),
			
			//Load content from objectsections.php into content
			//$(".smallactive .content", this).load("scroll.php"),
			$(".smallactive .content", this).switchClass("content", "contentactive", 1),
			$(".smallactive", this).switchClass("smallactive", "bigactive", 0);
			//$(window).delay(800).scrollTo(this,1000);
			prevId = this.id;
		}
	)
});

function closeMeX(what){
	$("#" + what + " .smallpicinactive").switchClass("smallpicinactive", "smallpic", 1),
	$("#" + what + " .contentactive").switchClass("contentactive", "content", 50),
	$("#" + what + " .bigactive").switchClass("bigactive", "smallinactive", 100);
	prevId = "";
}

function closeMe(what){
	$("#" + what + " .smallpicinactive").switchClass("smallpicinactive", "smallpic", 0),
	$("#" + what + " .contentactive").switchClass("contentactive", "content", 0),
	$("#" + what + " .bigactive").switchClass("bigactive", "smallinactive", 0);
}

function hideLoading(){
	var hideDiv = document.getElementById("loading");
	$(hideDiv).delay(1000).switchClass("loadingactive", "loading", 0);
}

(function($) {
  var cache = [];
  // Arguments are image paths relative to the current page.
  $.preLoadImages = function() {
    var args_len = arguments.length;
    for (var i = args_len; i--;) {
      var cacheImage = document.createElement('img');
      cacheImage.src = arguments[i];
      cache.push(cacheImage);
    }
  }
})(jQuery)

function writeEmail() {
	document.write("marcus@marcusostlund.se");
}
*/

$(document).ready(function() {
	$.fn.cycle.defaults.speed   = 800;
	
	$('.click').cycle({
		fx:		'scrollRight',
		next:	'.click',
		timeout:0,
		easing:	'backinout'
	});
	
	$(".menu .inactive").mouseenter(function() {
		$(this).fadeTo('fast', 1);
	}).mouseleave(function(){
		$(this).fadeTo('slow', 0.6);
	});
});
