//=======================================================================================================
//-------------------------------------------------------------------------------------------------------
//	Custom Javascript functions
//-------------------------------------------------------------------------------------------------------
//=======================================================================================================
	function toggleSearch()
	{


	}

//---------------------------------------------------------------------------------------------------------
//	search
 //---------------------------------------------------------------------------------------------------------
	var search_on = 0;
	function searchOn()
	{	
		search_on = 1;
		$('#img-g-search').attr('src','/images/search2.png');
		$('#search_area').css({'display':'block'});

		setTimeout("searchOff(1)",5000);
	}

	function searchOff(timeLapse)
	{	
		if( timeLapse )
		{
			if($('#search_area #findtext').val())
			{
				return;
			}
		}
		if(  !search_on )
		{
			return;
		}
		$('#img-g-search').attr('src','/images/search0.png');
		$('#search_area').css({'display':'none'});
		search_on = 0;
	}

//---------------------------------------------------------------------------------------------------------
//	js function for dropdown - when someone chooses other in the select dropdown, show a text box
 //---------------------------------------------------------------------------------------------------------
	function checkOther(obj,other_prefix)
	{
		var other_div = document.getElementById('fieldblock-'+other_prefix+'other');
		var other = document.getElementById(other_prefix+'other');

		if( obj.options[obj.selectedIndex].value == 'Other' )
		{
			if( other.value == "n/a" )
			{
				other.value = "";
			}	
			other_div.style.display="";	
		}
		else
		{
			other_div.style.display='none';

			if( other.value == "" )
			{
				other.value = "n/a";
			}	
		}
	}
	
/*
//*********************************************************************************************************
//		Function:	NextHomeBanner()
//---------------------------------------------------------------------------------------------------------
//	What it does:	show the next homepage banner
//*********************************************************************************************************
	function NextHomeBanner(q)
	{
		if(q >= total_banners )
		{
			q	= 	1;

		}
		else
		{
			q++;
		}

		var next		= '#home_banner_'+q;
		
		var link = $(next+' a').attr('href');
		$('#home_banner_link').attr('href',link);

		// unset current thumb and banner image
		$('.thumb_nav_div_active').removeClass('thumb_nav_div_active'); 
		$(".home_banner:visible").toggle(); 

		// set current thumb and banner image
		$(next).toggle();
		$(next_thumb).addClass('thumb_nav_div_active');
		
		if( stop_rotating )
		{
			return;
		}
		curr_timeout = setTimeout( "NextHomeBanner("+q+")", speed );
	}
*/
	//Document.ready
	// - 
	$(document).ready(function(){
		$('.button-image').hover( 
			function()
			{
				if( $(this).attr('hover_image'))
				{
					$(this).attr('src',$(this).attr('hover_image'));
				}
			},
			function()
			{
				if( $(this).attr('normal_image'))
				{
					$(this).attr('src',$(this).attr('normal_image'));
				}
			}	
		);
		// li:nth-child(-2n)
		$('.m1 li:nth-child(1) a').css('border-top','none');
		$('.m1 ul li:nth-child(1) a').css('border-top','1px solid #9a9a9a');

		if (is_ie6 )
		{
			//$('#nav-main li a').css('display','none');
			//$('#nav-main li a').css('display','block');
		}
		
	});