// Button & Menu Options ---------------------------------//

// Use animation menus
// Requires scriptaculous
	var anim_menus = 0;

//Auto link buttons to overview pages
	var use_overview_pages = 0;

//Show sub-menus for current section( 0=no, 1=yes)
	var section_subs = 0;

//Other button definitions
//"btn_name,menu_name(|menu_direction),section_id,img_src,img_src_on"
//Ex. "ql_btn,ql_menu,0,uploaded/images/ql_btn.gif,uploaded/images/ql_btn.gif"
var otherBtns = new Array( );

// List other images that need to be pre-loaded
var otherImages = new Array();

//other JS functions to run onLoad
function loadJS(){


	fsNewsSlider('#newsheadlines','.headlinesfeed .newspostitem',4000,true);

	$j('#search_btn').click(function(){
		$j(this).attr('src', function(){if(this.src.search(/_on/)<0){ return this.src.replace(/\.gif/,'_on.gif')}});
		$j('#ask_btn').attr('src', function(){ return this.src.replace(/_on/,'') });
		$j('#search_keywords').val('SEARCH SITE BY KEYWORD');
		$j('#search_div form').attr('action','searchresults.cfm');
	});
	$j('#ask_btn').click(function(){
		$j(this).attr('src', function(){if(this.src.search(/_on/)<0){ return this.src.replace(/\.gif/,'_on.gif')}});
		$j('#search_btn').attr('src', function(){ return this.src.replace(/_on/,'') });
		$j('#search_keywords').val('ASK A QUESTION');
	
		$j('#search_div form').attr('action','http://harpercollege.intelliresponse.com');
	});

	$j('#searchform').submit(function(){
		document.forms['searchform'].question.value = document.forms['searchform'].keywords.value;
		return true;
	});

	$j('#search_keywords').focus(function(){
		if( $j('#search_keywords').val() == 'SEARCH SITE BY KEYWORD' || $j('#search_keywords').val() == 'ASK A QUESTION' ){
			$j(this).val('');
		}
	}).blur(function(){
		if( $j(this).val() == '' ){
			if( $j('#search_div form').attr('action') == 'http://harpercollege.intelliresponse.com' ){
				$j(this).val('ASK A QUESTION');
			}else{
				$j(this).val('SEARCH SITE BY KEYWORD');
			}
		}
	});
}

function fsNewsSlider (fsNewsTarget,fsNewsContents,fsNewsDelay,random){
	// fsNewsTarget is the container that will receive the news items
	// fsNewsContents is the class of the containers with the news items
	// fsNewsDelay is the length of time (milliseconds) that each item is displayed
	// random (true/false) determines if it should pick a random item to stop on
	// these variables must be in jQuery format (#idname, .classname, tagname)	
	
	var r =  random ? Math.floor( $j(fsNewsContents).length * Math.random()) : 0;
		
	$j(fsNewsTarget).html( $j(fsNewsContents).eq(r).html() );
		
	function startSlider(){
		$j(fsNewsContents).each(function(i){
			if( $j(this).text().search(/alert:/i) != -1 ){
				$j(this).wrapInner('<span class="newsAlert"></span>');
			}	
		});
		

		if($j(fsNewsContents).length>1){

			fsNewsTimer = setInterval(function(){
				r = r < $j(fsNewsContents).length-1 ? r+1 : 0;
				$j(fsNewsTarget).animate({opacity:'.1'},150,'',function(){
						$j(fsNewsTarget).html( $j(fsNewsContents).eq(r).html() );
						$j(fsNewsTarget).animate({opacity:'1'},150);
						if(isIE){ $j(fsNewsTarget).hide().show(); }
					}
				);
			},fsNewsDelay); //end setInterval
			
		$j(fsNewsTarget).mouseenter(function(){clearInterval(fsNewsTimer)});			
			
		}
	}//end startSlider


	$j(fsNewsTarget).mouseleave(function(){startSlider()});
	
	startSlider();
}

