var animspeed = 'normal';

$(function(){
	$('body').addClass('with-js');
	$('#home #slidenav')
		.prepend('<a id="prev" href="#" alt="previous" title="previous">&laquo;<\/a>')
		.append('<a id="next" href="#" alt="next" title="next">&raquo;<\/a>');
	$('#home ul#content-items').cycle({
		fx:'scrollHorz',
		timeout:0,
		speed:1000,
		pause:1,
		pager:'#slidenav span',
		pagerAnchorBuilder:function(idx,slide){
			// var slideType = $('ul#content-items li:eq('+idx+') div.item').attr('class').split(' ')[1];
			// return '<a href="#" alt="'+slideType+'" title="'+slideType+'">&bull;<\/a>';
			return '<a href="#">&bull;<\/a>';
		},
		next:'a#next',
		prev:'a#prev'
	});
	$('#home #slidenav a').bind('focus',function(){ this.blur(); });
	
	// controls for "about" popup
	$('#about-toggle').toggle(
		function(){ $('#about').fadeIn(animspeed); return false; },
		function(){ $('#about').fadeOut(animspeed); return false; }
	);
	$('#about-toggle').bind('focus',function(){ this.blur(); });
	
	// tries to adjust height of photos to fit on the screen
	// since this is based on max-height it doesn't work in IE
	var maxImgHeight = (100*(Math.floor($('body').height()/100)-1))-50;
	$('div.photo').each(function(){
		if($.browser.msie){
			if($('div.img img',this).height() > maxImgHeight){
				$('div.img img',this).attr('height',maxImgHeight);
			}
		}else{
			$('div.img img',this).css('max-height',maxImgHeight);
		}
	});
	
});

