$(document).ready(function(){
						   
						   
					 $(".dropdown").hide();
					 $("div.container").hover(
								function(event){
									$(event.target).children("div").css("height","auto").stop().slideDown("slow");
									},
								function(event){$(".dropdown").stop().hide();}
								
											);
					  $("#expandomap span").fadeTo(100, 0.8);   
					  $("#subnav.ani ul").hide();
					   $("li.menuanchor").remove();
					   $("#subnav.ani a.main[href*=.pdf]").attr("target","_blank");
					   $("#subnav.ani a.main[href^=#]").click(function(){
														 $("#subnav ul").slideUp("fast");
														 $(this).next("ul").slideDown("slow");
														 return(false);
														 
														 });
					  $("table.facts tr").hover(function(){
						  $(this).addClass("hovered");
						  },
						  function(){
							  $(this).removeClass("hovered");
							  }); 
					$("table.bordersfacts tr").each(function(){$(this).children("td:even").addClass("alttd");});


$("#sendtofriend form").hide();
$("#emaillink").click(function(){$("#sendtofriend form").slideDown("slow"); $("#emaillink").html("email"); return(false);});
$("#formsubmitter").attr("action","")
$("#formsubmitter").click(function(){
								   $(".error").remove();
								   if(! validateEmails()){
								   $("#formsubmitter").attr("disabled", "true");
								   $("#sendtofriend form").addClass("sending");
								   $.post("send.asp", {
										  from: $("#yourname").val() ,
										  senderemail: $("#youremail").val(),
										  recipientemail: $("#friendemail").val(),
										  content: $("#tosend").val()
										  },function(data){
											  $("#sendtofriend form").removeClass("sending");
											  $("#formsubmitter").removeAttr("disabled");
											  
											  $("#emaillink").html("sent!");
											  $("#sendtofriend form").slideUp("slow");
											  
										  });
								   }
								   return(false);
								 
								   });
$("#cancel").click(function(){$("#sendtofriend form").slideUp("fast"); return(false);});

$(".access #expandomap").hover(
	function(){
		$("#expandomap span").stop().fadeTo(1000, 0.3);   
		$(this).children("div").stop().animate( {bottom: "0px"}, 1000, "swing");
		$(this).stop().animate( {height: "400px"}, 1500, "swing");
		
		},
	function(){
		$("#expandomap span").stop().fadeTo(1000, 0.8);   
		$(this).children("div").stop().animate( {bottom: "-100px"}, 1000, "swing");
		$(this).stop().animate( {height: "200px"}, 1500, "swing");
		});

$(".workforce #expandomap").hover(
	function(){
		$("#expandomap span").stop().fadeTo(1000, 0.3);   
		$(this).children("div").stop().animate( {bottom: "0px"}, 1000, "swing");
		$(this).stop().animate( {height: "476px"}, 1500, "swing");
		
		},
	function(){
		$("#expandomap span").stop().fadeTo(1000, 0.8);   
		$(this).children("div").stop().animate( {bottom: "-100px"}, 1000, "swing");
		$(this).stop().animate( {height: "200px"}, 1500, "swing");
		});
});


//here's the sIfr
//code for the h1 tags
var centurygothic = {  src: 'centurygothic.swf' };
sIFR.activate(centurygothic);
sIFR.replace(centurygothic, {
  selector: 'h1', 
  wmode: 'transparent', 
  src: 'centurygothic.swf', 
  css: [ '.sIFR-root {color:#123473; }'  ]
});

function validateEmails(){
	var hasError = false;
	var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
	if($("#yourname").val() == '') {
			$("#yourname").after('<span class="error">*</span>');
			hasError = true;
		}
		
		
	var emailFromVal = $("#youremail").val();
		if(emailFromVal == '') {
			$("#youremail").after('<span class="error">*</span>');
			hasError = true;
		} else if(!emailReg.test(emailFromVal)) {	
			$("#youremail").after('<span class="error">*</span>');
			hasError = true;
		}
	
	
		emailFromVal = $("#friendemail").val();
		if(emailFromVal == '') {
			$("#friendemail").after('<span class="error">*</span>');
			hasError = true;
		} else if(!emailReg.test(emailFromVal)) {	
			$("#friendemail").after('<span class="error">*</span>');
			hasError = true;
		}
	return (hasError);
	}

function runSiteScripts() {



// gets rid of focus box on click
if(document.getElementsByTagName) {
var a = document.getElementsByTagName("a");
//collect all anchors A
for(var i = 0; i < a.length; i++){
// mouse onfocus, blur anchors
a[i].onfocus = function(){this.blur();};
}
}


}