$(window).load(function(){
if ($('#portfolioImage ul li').length < 2) {
		var img = $($('#portfolioImage').find('img')[0]);
		var newImg1 = new Image();
		newImg1.src = img.attr('src');
		newImg1.onload = function()
		{
			$("#portfolioImage").height(0);
			$("#portfolioImage li").css('display','block');
			$("#portfolioImage").animate({"height": newImg1.height}, "slow");
		}
		$('#thumbImg li a').click(function(){
			return false;
		});
		//$("#portfolioImage").animate({"height": h}, "slow");
} else {
	$('#portfolioImage ul').cycle({ 
	    fx:     'fade', 
	    speed:  'slow',
	 	timeout:0,
		pager:  '#thumbImg', 
		pagerAnchorBuilder: function(idx, slide) { 
		   return '#thumbImg li:eq(' + idx + ') a'; 
		 },
		containerResize:0,
		fit:1,
		before:function(currSlideElement, nextSlideElement, options, forwardFlag) {
			$("#portfolioImage").animate({"height": $(this).find('img')[0].height}, "slow");		
		}
	});
}

		
});