// JavaScript Document
window.addEvent('domready', function() {

// add active hover state to tab 

	// get location
	var myLocation = window.location.href.slice(window.location.href.indexOf('?') + 1).split('/');
	var tag = $('divMainNav').getElements('a');

	
	switch(myLocation[3])
{
		case "gcccHistory.php":
					$(tag[0]).addClass('mainNavHover');
		  break;
		case "gcccServices.php":
					$(tag[1]).addClass('mainNavHover');
			  break;
		case "gcccStaff.php":
					$(tag[2]).addClass('mainNavHover');
			  break;
		case "staffMIA.php":
					$(tag[2]).addClass('mainNavHover');
			  break;
		case "staffWPB.php":
					$(tag[2]).addClass('mainNavHover');
			  break;
	    case "staffMCO.php":
					$(tag[2]).addClass('mainNavHover');
			  break;		
		case "recentProjects.php":
					$(tag[3]).addClass('mainNavHover');
			   break;
		case "gcccInstallWorking.php": 
					$(tag[4]).addClass('mainNavHover');    
			  break;
		case "gcccProjects.php":
					$(tag[5]).addClass('mainNavHover');
			  break;
		case "gcccProjectsMIA.php":
					$(tag[5]).addClass('mainNavHover');
			  break;
		case "gcccProjectsWPB.php":
					$(tag[5]).addClass('mainNavHover');
			  break;
		case "gcccProjectsMCO.php":
					$(tag[5]).addClass('mainNavHover');
			  break;
		case "gcccFacilities.php":
					$(tag[6]).addClass('mainNavHover');
			  break;
			case "gcccAffiliations.php":
					$(tag[7]).addClass('mainNavHover');
				break;
			case "gcccCareers.php":
					$(tag[8]).addClass('mainNavHover');
				break;
			case "index2.php":
					$(tag[9]).addClass('mainNavHover');
				break;
			case "":
					$(tag[9]).addClass('mainNavHover');
			
		default:
}



// staff page rollovers
 
 if (typeof document.body.style.maxHeight == "undefined") {
 try {
 document.execCommand('BackgroundImageCache', false, true);
 } catch(e) { /* unless it's not IE6... */ }
 } // if

 $$('.bvFadeLink').each(
 function(el) {
 el.fl = new Fx.FadeHoverLink(el,{duration:500});
 });
 
 // project rollover
 

}); // end ready



//  ................ functions ........
// Add darken rollover effect

Fx.FadeHoverLink = Fx.Style.extend({
 initialize: function(el, options) {
 options.wait = false;
 this.parent(el, 'opacity', options);
 this.set(0.01);
 this.element.addEvent('mouseenter', function() { this.custom(0.01,1); }.bind(this) );
 this.element.addEvent('mouseleave', function() { this.custom(1,0.01); }.bind(this) );
 }
});



// project auto submit
function autoSubmit(){
     document.frmCatagories.submit();
}