$(document).ready(function()
{
	  
	  // =====================================================================
	  // Cufon
	  Cufon.replace('.contra', { fontFamily: 'Contra' });
	  
	  
	  
	  
	  // =====================================================================
	  // Form Text Fields Focus/Blur
	  $('input.text').focus(function()
	  { if (this.value == this.defaultValue) { this.value = ''; $(this).parents('form').css('background-position', 'bottom');}});
	  $('input.text').blur(function()
	  { if (this.value == '') { this.value = this.defaultValue; $(this).parents('form').css('background-position', 'top');} });
	  
	  $('input.button').attr('value', '');
	  
	  
	  
	  
	  // =====================================================================
	  // Cleanup
	  var mainnav_divider = '<img src="http://www.clients.eirestudio.net/logbook/wp-content/themes/comparelogbokloans/elements/images/mainnav/divider.gif">';
	  $('#mainnav li:first').prepend(mainnav_divider).addClass('first');
	  $('ul.news li:last').css('margin-right', '0');
	  
	  var compare = $('.compare');
	  $('p#insert_here').append(compare);
	  
	  
	  
	  
	  // =====================================================================
	  // Sliding Ids
	  $('a[href*=#]').click(function() 
	  {
		    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')&& location.hostname == this.hostname) 
			{
				  var $target = $(this.hash);
				  $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
				  
				  if ($target.length) 
				  {
					    var targetOffset = $target.offset().top;
						$('html,body').animate({scrollTop: targetOffset}, 600);
						return false;
				  }
            }
      });
	  
	  
	  
	  
	  //$("div.scrollable").scrollable({size: 3, clickable: false, speed: 500}).circular(true).autoscroll({steps: 1, autoplay: true, autopause: true});
	  
	  

	  
	  	  
	  // =====================================================================
	  // Dropdown Menu
      $('#mainnav a').bind('mouseover', function()
      {
            $(this).parents('li').children('ul').show();
      });
	  
	  $('#mainnav a').bind('mouseout', function()
	  {
	        $(this).parents('li').children('ul').hide();
	  });
	  
	  
});


			      

