function menuGoTo(menuform) {
    var baseurl = "http://www.lowellfootball.com/" ;
	
    selecteditem = menuform.newurl.selectedIndex ;
    newurl = menuform.newurl.options[ selecteditem ].value ;
    if (newurl.length != 0) {
		location.href = baseurl + newurl ;
    }
}

function toggleLayer( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}

$(document).ready(function(){
 
	//$("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled - Adds empty span tag after ul.subnav
	
	$("ul.topnav li span").hover(function() { //When trigger is clicked...
		
		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul.subnav").slideDown('slow').show(); //Drop down the subnav on click
 
		$(this).parent().hover(function() {
		}, function(){	
			$(this).parent().find("ul.subnav").slideUp('fast'); //When the mouse hovers out of the subnav, move it back up
		});
 
	//Following events are applied to the trigger (Hover events for the trigger)
	}).hover(function() { 
		$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
		$(this).removeClass("subhover"); //On hover out, remove class "subhover"
		});
 
	//action to close header message
	$('a.closeEl').bind('click', toggleContent);
	
	$("img.blocks").fadeTo("slow", 0.3);

	$("img.blocks").hover(function(){
		$(this).fadeTo("slow", 1.0); // This should set the opacity to 100% on hover
	},function(){
   		$(this).fadeTo("slow", 0.3); // This should set the opacity back to 60% on mouseout
	});
 
});

var toggleContent = function(e) {
	var targetContent = $('div.groupItem'); //, this.parentNode.parentNode
	if (targetContent.css('display') == 'none') {
		targetContent.slideDown(300);
		//$(this).html('[-]');
	} else {
		targetContent.slideUp(300);
		//$(this).html('[+]');
		var message = "false";
		
		$.post("/2010/sessionUpdate.php", { message: "no" });
	}
	return false;
};