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
	}
};

$(function(){
	
	//to automatically erase text in a search field
	GB.text_labels()
	
	$('.mainThumbs').mouseover(function(){ 
		$(this).addClass('hover') 
	});
	$('.mainThumbs').mouseout(function(){ 
		$(this).removeClass('hover') 
	});
	
	//When you click on an open or closed parent li,
	$('li.parent > a').click(function(e){
window.e = e;
		//check to see if it has the open class,
		if($(this).parent().hasClass('open'))
			//if yes, then remove open class,
			$(this).parent().removeClass('open');
		else
			//otherwise, add open class, 
			$(this).parent().addClass('open'); 
			
			return false;
	});
	

	//When you click on an open or closed parent li,
	$('.expand').click(function(){
		//check to see if it has the open class,
		if($(this.parentNode).hasClass('collapsed'))
			//if yes, then remove open class,
			$(this.parentNode).removeClass('collapsed'); 
		else
			//otherwise, add open class, 
			$(this.parentNode).addClass('collapsed'); 
			return false;
	
			
	});
	$('div.quote').prepend('<div class="quoteStart"></div>');
	$('div.quote p:nth-child(2)').append('<span>"</span>');
	


//	$('#siteSearch_button').click(function(){
//		$form = $('#siteSearch');
//		if($form.hasClass('open') && $('#searchField').attr('value') == 'looking for something?')
//		{
//			$form.animate({ width: '28px' }, 200 );
//			$form.removeClass('open');
//			return false;
//		}
//		else if(!$form.hasClass('open'))
//		{
//			$form.animate({ width: '270px' }, 200 );
//			$form.addClass('open');
//			return false;
//		}		
//	});

});




