// Button & Menu Options ---------------------------------//

//Time before menus auto-hide
	var menu_pause = 250; 

//Show sub-menus for current section( 0=no, 1=yes)
	var section_subs = 0;

//Use auto position find for the menus( 0=no, 1=yes)
//Used for relatively positioned/centered layouts
//This option can be turned on for individual layouts by setting it in the <head> tag
	var pos_find = 1;


// Set offsets for the menus
    // x/y offset from top left corner of parent button
    // ( This setting is global for all menus, use the css file for more precise positioning)
    var pos_x = 0; 
    var pos_y = 0;


	// Safari seems to ignore margins on dynamically positioned elements(?)
	var safari_xoffset = 0;
	var safari_yoffset = 0;

// Menu Direction up|center (default is down)
	var menu_dir = "";

// Style Sheet Switcher Options
	//Define stylesheets: "title,href"
	// MUST Have "Default,some/stylesheet.css" defined! 

	var sheets = new Array(
		"default,uploaded/code/small.css",
		"large,uploaded/code/large.css"
	);


// Auto Color link options
// This will automatically color links in the left banner that appear in the page_array
// meaning the pages above the current page will be colorized in the left nav

	var link_color = "#ffffff";
	var bg_color = "#0F4D2A";

//Other button definitions
//"btn_name,menu_name(|menu_direction),section_id,img_src,img_src_on"
var otherBtns = new Array(
	"ql_btn,ql_menu,0,uploaded/images/ql_btn.gif,uploaded/images/ql_btn.gif"
);


// List other images that need to be pre-loaded
var otherImages = new Array();

//other JS functions to run onLoad
function loadJS(){
	if(pageid==1){createStories(); fsCalList();}	

//$j('#ss_div').prepend('<a href="page.cfm?p=3284" id="onlineCourses"><img src="uploaded/images/onlineCourses.gif" border="0" align="top" alt="Online Courses" /></a>');

}

function fsCalList(list,target){

	$j('#contentdiv').append('<div id="calModal" />');
	$j('#calModal').hide();

	var list = ".callist";
	var target = ".calcontainer .bannermodcontent";
	
	//text for link (%total% will be replaced with the total number of unseen events)
	var moreEventsText = 'There are <b>%total%</b> more events for today. <a href="#" style="font-weight:bold; white-space:nowrap;" id="viewEvents">view all ></a>';

	$j(list).width( $j(target).width() );

	var n = $j(list).find('.eventobj'); //number of events
	var h = $j(target).height(); // height of the target container
	var th = 0; //record the height as we add elements
	var t = 0; //record the total number of events that are hidden
	$j(target).html('<div id="calContent" class="bannercon"></div><div id="calControls"></div>');

	
	//add the heights of the event containers and only show the ones there is room for
	for (var i=0; i < n.length; i++) {
		if( (th + $j(n[i]).height()) < h ){
			$j(n[i]).clone().appendTo('#calContent');
			th += $j(n[i]).height();
		}else{
			t = n.length - i;
			break;
		}
	};
		
	if (t != n.length && t > 0) { //only show this if there are extra events
		moreEventsText = moreEventsText.replace(/%total%/, t);
		$j('#calControls').html(moreEventsText);		
	};
	
	$j('#viewEvents').click(function(){ //show remaining events in a modal pop up
		$j('#calModal').html( $j(list).html() );
		$j('#calModal').dialog({width:350, height:400, title:"Calendar Events"});
		// fsModalPanel( $j(list).html(),'','',"Calendar Events",'<a href="page.cfm?p=240">View Full Calendar</a>' );
	});
	
}



