/**When the document loads, apply FX to elements
 */
/*$(document).ready(
	function(){
		setRotate('.webFX_rotate');
	}
);
*/
/** Creates a image rotation effect.
 */
function setRotate(id){
	//No need to use JS if there is nothing to rotate.
	if($(id).children().length<2){return;}

	//rotate!
	$(id).cycle({fx: 'fade', speed:  2000, timeout: 7000});
	
	//correct for alignment issues within the 960 framework
	$(id).css('margin-left','10px');
}

function iBlockToggle(list_id,block_id){
	//toggle the visibility of the list, then set the scrollbars, if necessary
	$(list_id).toggle('slow',function(){

		var blockHeight=$(block_id).height();	//the height of the block
		var contentHeight=0;					//the height of the block's content

		//compute the height of all the block's children.
		//This is the actual height of the content for the block.
		$(block_id).children().each(function(){contentHeight+=$(this).height();});
		contentHeight+=12;
		//set the scrollbars, if necessary
		$(block_id).css(
				'overflow',
				(blockHeight<=contentHeight)?'auto':'hidden' );
	});
}
