$(function() {
	$('.field, textarea').focus(function() {
        if(this.title==this.value) {
            this.value = '';
        }
    }).blur(function(){
        if(this.value=='') {
            this.value = this.title;
        }
    });
});


$(document).ready(function() {
  
  $('.news-entry .more').click(function() {
    $(this).next().slideToggle();
    return false;
  });
  
  resizeBg();

  $(window).resize(function() {
      resizeBg();
  }); 


});

$(window).load(function  () {
  resizeBg();
});



	// Function Resize Background 
	function resizeBg() {

      var bgImg = $('img.body-bg');
      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'
        });     
      }

    } 
   


   

    
