$(document).ready(function(){
//OPENS URL NEW WINDOW -(target is not a valid attribute in XHMTL 1.0 Strict)
$('a[href^="http://"]').attr({target: "_blank"});

//Larger thumbnail preview 
$("ul.thumb li").hover(function() {
	$(this).css({'z-index' : '10'});
	$(this).find('img').addClass("hover").stop()
		.animate({
			marginTop: '-110px', 
			marginLeft: '-110px', 
			top: '50%', 
			left: '50%', 
			width: '174px', 
			height: '174px',
			padding: '20px' 
		}, 200);
	
	} , function() {
	$(this).css({'z-index' : '0'});
	$(this).find('img').removeClass("hover").stop()
		.animate({
			marginTop: '0', 
			marginLeft: '0',
			top: '0', 
			left: '0', 
			width: '100px', 
			height: '100px', 
			padding: '5px'
		}, 400);
});

//Swap Image on Click
	$("ul.thumb li a").click(function() {
		$("#main_view").empty().load($(this).attr('href')+ ' #gallery', function(){
			//OPENS URL NEW WINDOW -(target is not a valid attribute in XHMTL 1.0 Strict)
			$('a[href^="http://"]').attr({target: "_blank"}); 
		});
		return false;
	});
	
	
//SCROLLTO 
  $("#nav ul > li").click(function() {
    var qu = $(this).attr("id");
		var an = "#" + qu.replace("q","a");

		$.scrollTo(an, {duration: 800, axis:"y", onAfter:function(){
			$(an).effect("highlight", {color: "#ddd"}, 2000);
		  }
		});
		return false;
  });
  $("#footer ul > li").click(function() {
    var fo = $(this).attr("id");
		var se = "#" + fo.replace("f","a");

		$.scrollTo(se, {duration: 800, axis:"y", onAfter:function(){
			$(se).effect("highlight", {color: "#ddd"}, 2000);
		  }
		});
		return false;
  });
	
	$(".return-top").click(function(event) {
		event.preventDefault();
		$.scrollTo("body", {duration: 800, axis:"y"});
		return false;
	});
	
		
});

