$(document).ready(function()
{
	$.get('/load_nav.php', function(_data) 
	{
		if (_data.indexOf('<li class="nav_div">') > 0)
		{
			$('#root_nav_container').html(_data);

			$('.root_li').hover(function()
			{
				var _this = $(this);
				_this.addClass('hover');
				
				var _left = _this.offset().left;
				_left -= $('#main_container').position().left;
		
				var _nav = $('.navb1:first',this);
				var _width = _nav.width();
				
				if (_left + _width > 980)
				{
					if (_width < _left)
					{
						_nav.css('left', ((_width-4)*-1)+_this.width());
					}
					else
					{
						_nav.css('left', 980 - (_left + _width));
					}
				}
			},
			function()
			{
				$(this).removeClass('hover');
			});		
		}
	});
	
	$('#search_string').css('color', '#555');
	$('#search_string').val('Search...');

  	$("#search_string").focus(function() 
	{
    	if (this.value == 'Search...')
		{
			this.value = '';
      		this.style.color = '#000';
			$(this).blur(function() 
			{
			  if (this.value == '' || this.value == 'Search...') 
			  {
				this.style.color = '#555';
				this.value = 'Search...';
			  }
			});
		}
	});
});