/**
 * jQuery.fullBg
 * Version 1.0
 * Copyright (c) 2010 c.bavota - http://bavotasan.com
 * Dual licensed under MIT and GPL.
 * Date: 02/23/2010
**/
(function($) {
  $.fn.fullBg = function(){
    var bgImg = $(this);		
 
    function resizeImg() {
      var imgwidth = bgImg.width();
      var imgheight = bgImg.height();
 
      var winwidth = $(window).width();
      var winheight = $(window).height();
 
      var widthratio = winwidth / imgwidth;
      var heightratio = winheight / imgheight;
 
      var widthdiff = heightratio * imgwidth;
      var heightdiff = widthratio * imgheight;
 
      if(heightdiff>winheight) {
        bgImg.css({
          width: winwidth+'px',
          height: heightdiff+'px'
        });
      } else {
        bgImg.css({
          width: widthdiff+'px',
          height: winheight+'px'
        });		
      }
    } 
    resizeImg();
    $(window).resize(function() {
      resizeImg();
    }); 
  };
})(jQuery)

$(document).ready(function(){
	$('.index').remove();
	$('dt').css('text-align','left');
	$('.skin-slidedeck dl.slidedeck > dt').css('width','175px');
	$('#nav li:last-child').addClass('last');
	$('#footer #footer-menu li:last-child a').addClass('last');
	$('#searchsubmit').val("");
	$('img.attachment-post-thumbnail').attr('title', '');

	$(window).load(function() {
		$("#bg").fullBg();
		$('.bottom-middle').jScrollPane({
					showArrows: true,
					horizontalGutter: 10,
					verticalDragMinHeight: 46,
					verticalDragMaxHeight: 46
		});
		$('#content').jScrollPane({
					horizontalGutter: 10,
					verticalDragMinHeight: 66,
					verticalDragMaxHeight: 66
		});
		$('#content-area').jScrollPane({
					horizontalGutter: 10,
					verticalDragMinHeight: 66,
					verticalDragMaxHeight: 66
		});
	});
});
