$(document).ready(function() 
{
	$(".accordion").accordion({ active: false, collapsible: true });	
	$(".menuitem").hover(
		function() {
			//$(this).fadeOut(100);$(this).fadeIn(100);
			$(this).find("img.rollover").show(); 
			$(this).find("img.normal").hide();
			$(this).find("div").addClass("rollover");
			//alert('w00t2');
		},
		function() {
			$(this).find("img.rollover").hide();
			$(this).find("img.normal").show();
			$(this).find("div").removeClass("rollover");
			//alert('w00t');
		}
	);
	//$("#footer").corner("round bl br 20px");
	$("#footer").corner("round 15px");
	$(".icc").corner("round 15px");
	$(".applications").corner("round 15px");
	
	$("#sidebar ul li").corner("round 10px");
	onAfterCycle = function() {
	    var max_image_height = 0
	    $('#rotator img').each(function() {max_image_height = Math.max(this.height, max_image_height);} )
	    $('#rotator').height(max_image_height);

	    var max_image_width = 0
	    $('#rotator img').each(function() {max_image_width = Math.max(this.width, max_image_width);} )
	    $('#rotator').width(max_image_width);

		//$('#rotator img').each(function(){ $(this).css({'margin-top' : (max_image_height - this.height)/2 } );})
	}
///	$("#tabs").tabs();

	$('table.alternating tr:odd').addClass('odd');


	//alert(window.location.pathname);
	$("#sidebar").find("a[href='"+window.location.pathname+"']").each(function(){
		$(this).parent().addClass("current");
		//alert("w00t");
		//add your own logic here if needed
	})

});


$(window).load(
  function(){
  	$('#rotator').cycle({
		timeout: 6000,
		after: onAfterCycle
	});
	onAfterCycle();
  }
)

