var samples=new Array();
samples["#hm"]="0";
samples["#ag"]="-400";
samples["#rd"]="-800";
samples["#rt"]="-1200";
samples["#rh"]="-1600";
samples["#bp"]="-2000";
samples["#br"]="-2400";


$(document).ready(function(){

	$(".textBlock").each(function(){
				
		$(this).attr("id", function(){
          return $(this).attr("id") + "1";
        });
			
	});
	
	if (jQuery.url.attr("anchor")) {
		
		var anchor = "#" + jQuery.url.attr("anchor");
			
		$("#textBlocks").css(
			"top", samples[anchor] + "px"
		);
	}

	$("#samples li a").click(function(){
				
		var textBlock = $(this).attr("href");
						
		$("#textBlocks").animate({
			top : samples[textBlock] + "px"
		}, 500 );

 	});
 	
 	
 	$("#textBlocks a").each(function(){
 		
 		if ($(this).attr("rel") == "external") {
 		
 			$(this).css({
 				'padding-right' : '15px',
 				'background-image' : 'url("./images/link.png")',
 				'background-position' : 'right',
 				'background-repeat' : 'no-repeat'
 			});
 		}
 		
 	});


});