$(document).ready( function() {
	_aaa();
	$.tabs();
	$.reportHover();
	$.imgHover();
	$.introHover();
	$.scripHover();

	$('#bimages > img').removeClass('hidden');
	$('#bimages').cycle({
		fx: 'fade',
		speed: 5000
	});
	
	$('div#flashmap').removeClass('hidden');

})


//tabs
$.tabs = function() {
	var tabContainers = $('div.tab_panels > div.panel');
		tabContainers.hide().filter(':first').show();
		
		$('ul.tabs a').click(function () {
			tabContainers.hide();
			tabContainers.filter(this.hash).show();
			$('ul.tabs li').removeClass('selected');
			$(this).parent().addClass('selected');
			return false;
		}).filter(':first').click();	
}

function setupSearch(button, text){
var default_message = "Search site";
	btn = document.getElementById(button);
	txt = document.getElementById(text);
	txt.value = default_message;

	txt.onclick = function(){
		if(this.value==default_message){
		this.value='';
		}
	}

	btn.onclick = function(){
		txt = document.getElementById(text);  
		if(txt.value==default_message|txt.value==""){
			alert("Please enter a search text");
			return false;
		}
	}
}

$.reportHover = function() {
	$('.report div a').hover(
		function() {$(this).parent().parent().find('p a').css({'color':'#FFF'});},
		function() {$(this).parent().parent().find('p a').css({'color':'#999'});}
	);
}

$.imgHover = function() {
	$(".addhover").hover(
		function() {this.src = this.src.replace("_off","_on");},
		function() {this.src = this.src.replace("_on","_off");}
	);
	
	$(".email_alert").hover(
		function() {$(this).find('img').attr('src', '/images/icon_email_h.gif');},
		function() {$(this).find('img').attr('src', '/images/icon_email.gif');}
	);
	
	$(".accessibility").hover(
		function() {$(this).find('img').attr('src', '/images/icon_key_h.gif');},
		function() {$(this).find('img').attr('src', '/images/icon_key.gif');}
	);
	
	$(".about").hover(
		function() {$(this).find('img').attr('src', '/images/arrow_yellow_h.gif');},
		function() {$(this).find('img').attr('src', '/images/arrow_yellow.gif');}
	);
}

$.introHover = function() {
	$(".introlink a").hover(
		function() {$('.corner').attr("src", "/images/banner_corner_hover1.png");},
		function() {$('.corner').attr("src", "/images/banner_corner.png");}
	);
}

$.scripHover = function() {
	$(".scriplink a").hover(
		function() {$('.corner').attr("src", "/images/banner_corner_hover.png");},
		function() {$('.corner').attr("src", "/images/banner_corner.png");}
	);
}