function fixHeight( fid, sid ){
	if( $(fid).height() < $(sid).height() ){
		$(fid).height($(sid).height());
	}
}

$(document).ready(function(){

	$("#gallery div.photo a").fancybox();
	$('div.homepage_featured_gallery a:not(.noslideshow)').fancybox();
	
	fixHeight( '#contents', '#sidebar' );
	fixHeight( '#cq_container', '#gal_container' );
	fixHeight( '#sidebar_notes .left', '#sidebar_notes .right' );
	

/*
	$('#twitter_update_list').SetScroller({	velocity: 	 50,
											direction: 	 'horizontal',
											startfrom: 	 'right',
											loop:		 'infinite',
											movetype: 	 'linear',
											onmouseover: 'pause',
											onmouseout:  'play',
											onstartup: 	 'play',
											cursor: 	 'pointer'
										});*/	

});

$(window).load(function(){

	cf = $('#content_footer').position();
	sf = $('#sidebar_notes').position();
	
	if( cf.top > sf.top ){
		dif = (cf.top - sf.top) + 20;
		$('#sidebar_notes').css({
			'position':'relative',
			'top':(dif)+'px'
		});
		
	} else if( sf.top > cf.top ){
		dif = (sf.top - cf.top) - 20;
		$('#content_footer').css({
			'position':'relative',
			'top':(dif)+'px'
		});
	}
	
	fixHeight( '#contents', '#sidebar' );
	fixHeight( '#cq_container', '#gal_container' );
	fixHeight( '#sidebar_notes .left', '#sidebar_notes .right' );
	
	
});
