$(document).ready(function() {
	//borrowed from jQuery easing plugin
	//http://gsgd.co.uk/sandbox/jquery.easing.php
	$.easing.easeOutQuad = function(x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	};

	$("p.top a").each(
		function(){
			$(this).attr("href","javascript:;");
		}
	);
	$("a[rel=tBlank]").each(
		function(){
			$(this).attr("target","_blank");
		}
	);
	
	$("div.pics").hover(
	
		function() {
			
			var style=$(this).attr("style");
			style_arr = style.split(';')
			style_backgnd=style_arr[0].split(':');
			style_backgnd_img=style_backgnd[1].replace('url(','');
			style_backgnd_img=style_backgnd_img.replace(')','');
			style_backgnd_img=style_backgnd_img.replace('thumbnail/','');
			
			$("#main_img_div").html('<img src="'+style_backgnd_img+'" width="427" height="640" />');
			//$("#main_images").src=style_backgnd_img;												;
			//$(this).find("div.info").animate({opacity: ".95",height:"100%"}, 1000);
		}, function() {
			//$(this).find("div.info").animate({opacity: "hide",height:0}, 250 );
	});
	$("div.type2 div.pics").hover(
		function() {
			$(this).find("div.info").animate({opacity: "show",height:"25.2em"}, 500);
		}, function() {
			$(this).find("div.info").animate({opacity: "hide",height:0}, 250 );
	});
	$("#subNavigation li a").click(function(){
		$.scrollTo( $("#"+$(this).attr("rel")), 1500,{easing:'easeOutQuad'} );
	});
	$("p.top a").click(function(){
		$.scrollTo( {top:'0'}, 1500,{easing:'easeOutQuad'} );
	});
});