

var accordionIndexToLoadWhenAnimationComplete = -1; // used by accordion callback mechanism to store index


function openFirstAccordionSection(){
	$('#elevator_accordion').accordion('activate', 0);
}
$("#elevator_accordion").css('display','block');
	// randomize gateway:
//	get_random(displayPercentage);
	// init accordion:
	$("#elevator_accordion").accordion({
		autoHeight: true,
		event: "mouseover",
		active:".selected",
		header: "a.accordion_header",
		jQuerySelectorStrForSections:"ul#elevator_accordion li.accordion_section" // this is a MC custom option
	});
	
	
	
	
	
	// callback to activate section that may have tried to open during animation
	$("#elevator_accordion").bind("accordionchange", function(event, ui){
		if(accordionIndexToLoadWhenAnimationComplete > -1){ // a section should be opened up:
			$('#elevator_accordion').accordion('activate', accordionIndexToLoadWhenAnimationComplete);
			// reset:
			accordionIndexToLoadWhenAnimationComplete = -1;
		}
		
	});
	
	// this makes the first tab active again when mouse leaves space:
	$("#elevator_accordion").bind("mouseleave", function(e){
		$('#elevator_accordion').accordion('activate', 0);
	});

	// fix height of quick links:
	var accordionHeight = $("#elevator_accordion").height();
	var heightEnforcedByAccordion = accordionHeight - 250;
	
	var quickLink_1_Height = $("#quickLinkBox_1").height();
	var quickLink_2_Height = $("#quickLinkBox_2").height();
	var quickLink_3_Height = $("#quickLinkBox_3").height();
	
	// logic: if any of the three QL boxes are taller than the accodion would otherwise require them to be, use the tallest QL box's height:
	var tallestQlBox = Math.max(Math.max(quickLink_1_Height,quickLink_2_Height),quickLink_3_Height);
	var quickLinkHeight = Math.max(heightEnforcedByAccordion,tallestQlBox);
	$("#right_col_bottom_row").height(quickLinkHeight);
	
	var c = 0;	
var t;

function timedCount()
{
	if(c==4) {
$('#elevator_accordion').accordion('activate', 0);
return;
}
	$('#elevator_accordion').accordion('activate', c);
	t=setTimeout("timedCount()",1000);
	c=c+1;
	
}
window.onload(timedCount());

	







