/**********************************************
 Blackbaud Design Custom JavaScript
***********************************************
 Site:    		Houston Community College	
 Author:        Kay Foreman
 Created:       1/31/2012
 BBNC Version: 	6.35
 
*********** CHANGE LOG ************************

**********************************************/


/************* global definitions ************/
var bbpage = Sys.WebForms.PageRequestManager.getInstance(); //BBNC
var isEditView = window.location.href.match('edit=');
var _protocol = window.location.protocol;
var _currentHref = window.location.href;

/*** jQuery Tools ***/
document.write('<script type="text/javascript" src="document.doc?id=3675"></script>');

/*** jQuery Browser Detection ***/
document.write('<script type="text/javascript" src="document.doc?id=3695"></script>');

/*** SlideSet ***/
document.write('<script type="text/javascript" src="document.doc?id=3635"></script>');

if (isEditView) {
document.write('<style type="text/css"><!-- #home #wrapNav { height: auto; } #home #wrapNav .mainMenu {margin-bottom:40px; } #home .slide{width:200px; float: left; } #home .slide .image img{height:100%;width:100%;} #home .slide .content{display:none;padding:0;width:auto;}  --></style>');
}


/************* run page load functions ************/
bbpage.add_pageLoaded(function(){
  bbGlobal();
  siteGlobal();
});

//For Local Testing [comment out for BBNC]
/*
$(document).ready(function(){
  bbGlobal();
  siteGlobal();
  windowReady();
});
*/

/********** define plugins and functions **********/

// core design global functions
function bbGlobal()
{

	// replace copyright with current year
	function currentYear()
	{
		$("#currentYear").text((new Date).getFullYear());
	};
	
	function fixPositioning()
	{
		$('div[id$=_panelPopup]').appendTo('body');
		$('div[id$=_panelPopup_DropShadow]').appendTo('body');
		$('div[id *= "_panelPopup"]').appendTo('body');
	}; 
	
	$('ul.menu li').hover(function(){$(this).addClass('hover')},function(){$(this).removeClass('hover')});
	
	// execute functions
	// remove or comment out unused functions
	fixPositioning();
	currentYear();

};


// site specific global functions
function siteGlobal()
{
	
	// SlideSet in edit admin mode
	if (isEditView) {
	}
	else {
		/* setup ul.tabs to work as tabs for 
		 each div.pane directly under div.panes */
		$("ul.tabs").tabs("div.panes > div.pane", {
		tabs: 'li',
		/* tabs configuration goes here */
		effect: 'fade'
		/* rotate: true */
		})/* .slideshow({autoplay: true, interval: 10000}) */;
	}
	
	// SlideSet in normal/preview mode
	if (!isEditView) {
		$('.slide').SlideSet({
			 display: 'slideshow',
			 tabs: 'browse',
			 prev: '&laquo;',       // text/html for 'previous' button
			 next: '&raquo;',       // text/html for 'next' button
			 tabParams: {           // slide transitions
			  effect: "fade",
			  fadeOutSpeed: "slowest",
			  rotate: true
			 },
			 slideshowParams: {     // additional slideshow options
			  autoplay: true,
			  interval: 5000		// slide duration in milleseconds
			 }
		});
	}
	
	
};

