function showHSSMenu(obj, a){	
	a.style.color = '#fff';
	obj.style.display = '';
	//turnAdsOff();
	navhideflash('hide');
}

function hideHSSMenu(obj, a){	
	a.style.color = '#000';
	obj.style.display = 'none';
	//turnAdsOn();
	navhideflash('show');
}

var page = "/portal.cfm";
function showSchoolObj(pageName){
	page = pageName;
	if(document.all)e = event;
	//var obj = $$('.schoolObjArea');
	var obj3 = $('schoolSelectObj');
	obj3.style.left = 0;
	obj3.style.left = (window.getScrollWidth()-980)/2 + 'px';
	if(obj3.style.left < 0){
		obj3.style.left = 0;
	}
	var doscroll = new Fx.Scroll(window, {wait: false, duration: 500, transition: Fx.Transitions.Quad.easeInOut});
	doscroll.scrollTo(0,0);
	recentSchools();
		
}
function hideSchoolObj(){
	$('schoolSelectObj').style.left = '-9999px';
}
function findNewSchoolTab(){
	$('findNewSchoolTab').setAttribute('class', 'active');
	$('findNewSchoolTab').setAttribute('className', 'active');
	$('viewByStateTab').setAttribute('class', '');
	$('viewByStateTab').setAttribute('className', '');
	$('schoolSearchWrap').style.display = '';
	$('stateListWrap').style.display = 'none';
}

function viewByStateTab(){
	$('findNewSchoolTab').setAttribute('class', '');
	$('findNewSchoolTab').setAttribute('className', '');
	$('viewByStateTab').setAttribute('class', 'active');
	$('viewByStateTab').setAttribute('className', 'active');
	$('schoolSearchWrap').style.display = 'none';
	$('stateListWrap').style.display = '';
}

function searchSchoolsHome(searchStr, pageName){
	$('schoolSearchId').value = searchStr;
	showSchoolObj(pageName);
	getSchools(searchStr, pageName);
}

function checkKey(e, str, sType){
	var keynum;		
	if(window.event) // IE
	{
		keynum = e.keyCode;
	}
	else if(e.which) // Netscape/Firefox/Opera
	{
		keynum = e.which;
	}
	if(keynum == 13){
		getSchools(str.value, sType);
	}
}
function showHomeSchool(e, str, pageName){
	var keynum;
		
	if(window.event) // IE
	{
		keynum = e.keyCode;
	}
	else if(e.which) // Netscape/Firefox/Opera
	{
		keynum = e.which;
	}
	if(keynum == 13){
		 showSchoolObj(pageName);
		 getSchools(str.value, page);
		 $('schoolSearchId').value = str.value;
	}
}

function makeScrollbar(content,scrollbar,handle,horizontal,ignoreMouse){
	scrollbar.style.visibility = 'visible';
	var steps = (horizontal?(content.getSize().scrollSize.x - content.getSize().size.x):(content.getSize().scrollSize.y - content.getSize().size.y))
	var slider = new Slider(scrollbar, handle, {	
		steps: steps,
		mode: (horizontal?'horizontal':'vertical'),
		onChange: function(step){
			// Scrolls the content element in x or y direction.
			var x = (horizontal?step:0);
			var y = (horizontal?0:step);
			content.scrollTo(x,y);
		}
	}).set(0);
	if( !(ignoreMouse) ){
		// Scroll the content element when the mousewheel is used within the 
		// content or the scrollbar element.
		$$(content, scrollbar).addEvent('mousewheel', function(e){	
			e = new Event(e).stop();
			var step = slider.step - e.wheel * 30;	
			slider.set(step);					
		});
	}
	// Stops the handle dragging process when the mouse leaves the document body.
	$(document.body).addEvent('mouseleave',function(){slider.drag.stop()});
}

function getSchools(searchStr){
		var s = document.createElement('script');
		s.src = "http://www.highschoolsports.net/HSS_Chrome/searchSchools.cfm?search=" + searchStr + '&boxId=schoolRes&pageName='+page ;
		<!--alert(s.src);-->
		document.getElementsByTagName('head')[0].appendChild(s);
	}
function recentSchools(){
		var s = document.createElement('script');
		s.src = "http://www.highschoolsports.net/HSS_Chrome/recentSchools.cfm?boxId=schoolRecent&pageName="+page ;
		<!--alert(s.src);-->
		document.getElementsByTagName('head')[0].appendChild(s);
	}