$(document).ready(
				  
	function ()
	{
		
		/*IE8 visibility bug with cufon...
		*/
		if ($.browser.msie != null)
		{
			
			$('.mainNav .dropListWrapper').each(
									   function() {
										   $(this).css('visibility', 'visible');
										   }
									);
			
	
			Cufon.replace('.mainNav .dropListWrapper ul li a', {hover: true});
			
			$('.dropListWrapper').each(
									   function() {
										   $(this).css('visibility', 'hidden');
										   }
									);
			
			Cufon.replace('.mainNav ul.mainList > li > a', {hover: true});
		}	
		else
			Cufon.replace('.mainNav ul.mainList li a', {hover: true});
		
		Cufon.replace('.subscribeLink', {hover: true});
		Cufon.replace('.footerBottomWrapper h1.title');
		Cufon.replace('.footerBottomWrapper .statsWrapper div.text');
		
		$('.mainNav ul.mainList > li').hover(function()
		  {
			  $(this).addClass('hover');			  
		  }, 
		  function() 
		  {
			  $(this).removeClass('hover');
			  if ($.browser.msie != null)
			  	Cufon.refresh('.mainNav ul.mainList > li > a');	
			  else
				Cufon.refresh('.mainNav ul.mainList li a');	
		  }
		);
		
		var quickSearchDefaultText = 'Search...';
		
		//search
		$('form#searchForm input#searchBox').focus(
			function()
			{
				
				if ($(this).val() == quickSearchDefaultText)
					$(this).val('');	
			}
		);
		$('.commentSubmitLink').click(
			function()
			{
				$('form#commentForm').submit();
				return false;
			}								
		);
		$('.contactSubmitLink').click(
			function()
			{
				$('form#contactForm').submit();
				return false;
			}
		);
		$('form#searchForm input#searchBox').blur(
			function()
			{
				val = $(this).val();
				if (val == '')
					$(this).val(quickSearchDefaultText);
				
					
			}
		);
		
		/*IE 7 z-indexing bug fix(floating drop down menus are covered by lower elements)... reverses the natural z-indexing that is generated and assures that elements higher in the page will actually have a higher z-index then elements appearing lower*/
		
		$(function()
		{
			var zIndexNumber = 10000;
			$('div').each(function()
			{
				$(this).css('z-index', zIndexNumber);
				zIndexNumber -= 10;
			});
		});
		

		
	} //function
);
