
$(document).ready(function(){
	var GB = {
		text_labels: function(){
			//to automatically erase text in a search field
			$('input[type=text], textarea').each(function(){
				var $input = $(this);
				if(!$input.attr('placeholder'))
					$input.attr('placeholder', this.value);
				$input.focus(function(){
					if(this.value == $input.attr('placeholder'))
					this.value = '';
					$input.addClass('focus');
				});
				$input.blur(function(){
					if(this.value == '')
					this.value = $input.attr('placeholder');
				$input.removeClass('focus'); 
				});
			});
		},
		close_overlay: function(){
			$('#contactOverlay, #overlay_container, #overlay').remove();
			return false
		}
	};
	
	GB.text_labels();
							   
	//$("div.toggleButton").next().removeClass('hide');
	//$('.articleResults').css('display' , 'none');
	$('.hide').removeClass('hide').hide();						   
	$("div.toggleButton").click(function(){
	   //$(this).toggleClass('open').next().slideToggle(900)
	   if ($(this).hasClass('open'))
	       $(this).toggleClass('open').next().hide();
	   else
	       $(this).toggleClass('open').next().show();
	});	
	
	$('ul.menuList').removeClass('hide').hide();
	
	$('ul#mainNav li').hoverIntent(
		function(){
			$('ul',this).slideDown(100); 				
		},
		function(){
			$('ul',this).slideUp(100); 	
		}
	);
	
	$('.print').click(function(){
		window.print();
		return false;
	});
	
	//alert($('#runtime').text())
	
});

