/**
 * 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)

// SDCo Actions
$(document).ready(function() {
	$('#homecopy').css({opacity: 0});
	$('#full_bg').hide();
	
	$(window).load(function () {
 	$('#homecopy').animate({opacity: 1.0}, 3000);
	$('#full_bg').show().fullBg();
	$('#full_bg').mousedown(function(e) { e.preventDefault(); });
	});

	/* ------Hide elements if Window is too small------- */
	
	function checkWidth () {
    if ($(window).width() > 1140) {
        $('ul#footer_social').show();
        }
    else {
        $('ul#footer_social').hide();
        }
    }
	
	// check the window size when page loads
    checkWidth();
 
    // check on resize
    $(window).resize(function() {
        checkWidth();
    });
	
});
