$(document).ready(function(){
	$('div.hidden').css("visibility", "hidden").animate({height: 0},'fast');
if($.browser.mozilla){
	$('div.hidden').css("top", "345");
}

$("#USlink").click(function(){
	$('div.hidden').animate({height: 1},'slow');
	$('#US').css("visibility", "visible").animate({height: 250},'slow');
});
$("#CAlink").click(function(){
	$('div.hidden').animate({height: 1},'slow');
	$('#CA').css("visibility", "visible").animate({height: 85},'slow');
});
$("#ENlink").click(function(){
	$('div.hidden').animate({height: 1},'slow');
	$('#EN').css("visibility", "visible").animate({height: 235},'slow');
});
$("#SSlink").click(function(){
	$('div.hidden').animate({height: 1},'slow');
	$('#SS').css("visibility", "visible").animate({height: 175},'slow');
});
$("#WLlink").click(function(){
	$('div.hidden').animate({height: 1},'slow');
	$('#WL').css("visibility", "visible").animate({height: 100},'slow');
});
$("#IElink").click(function(){
	$('div.hidden').animate({height: 1},'slow');
	$('#IE').css("visibility", "visible").animate({height: 70},'slow');
});
$("#AUlink").click(function(){
	$('div.hidden').animate({height: 1},'slow');
	$('#AU').css("visibility", "visible").animate({height: 90},'slow');
});
$("#NZlink").click(function(){
	$('div.hidden').animate({height: 1},'slow');
	$('#NZ').css("visibility", "visible").animate({height: 100},'slow');
});
$("#ZAlink").click(function(){
	$('div.hidden').animate({height: 1},'slow');
	$('#ZA').css("visibility", "visible").animate({height: 85},'slow');
});
$("#IIlink").click(function(){
	$('div.hidden').animate({height: 1},'slow');
	$('#II').css("visibility", "visible").animate({height: 100},'slow');
});


$("div.stateLinkBox").click(function(){
	$('div.hidden').animate({height: 1},'slow');
	$("#content").animate({height: 1},'slow');
//	$("#content").animate({opacity: 0.1},'slow');
	$("#schoolframe").css("visibility", "visible");
	$("#schoolframe").animate({height: 580},'slow');
});


$("#headerSearch").submit(function(){
	search_type = getRadioValue(document.headerSearch.search_type);

	if(search_type == 'school'){
		$("#headerSearch").attr('action', 'findallschools.php');
		return true;
	}else if(search_type == 'teacher'){
		$("#headerSearch").attr('action', 'findteachers.php');
		return true;
	}else if(search_type == 'course'){
		$("#headerSearch").attr('action', 'findcourses.php');
		return true;
	}
});


function getRadioValue(radioObject){
	var value = null;
	for (var i=0; i<radioObject.length; i++){
		if(radioObject[i].checked){
			value = radioObject[i].value;
			break;
		}
	}
	return value;
}

});
