$.fn.search = function() {
	$(this).focus(function() {
		if( this.value == this.defaultValue ) {
			this.value = "";
		}
	}).blur(function() {
		if( !this.value.length ) {
			this.value = this.defaultValue;
		}
	});
};


/**
* Full Size Backgrounded
* 
* @version 1.0
* @author Vaska 
*/
function bg_img_resize()
{
    var w = $(window).width();
    var h = $(window).height();
    var iw = $('img#background').attr('width');
    var ih = $(' img#background').attr('height');
    var rw = iw / ih;
    var rh = ih / iw;
    var sc = h * rw;
    if (sc >= w) {
        nh = h;
        nw = sc;
    } else {
        sc = w * rh;
        nh = sc;
        nw = w;
    }

    $('img#background').css({height: nh, width: nw});
}

$(document).ready(function(){ 
bg_img_resize(); 
$("#s").search();

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

$(window).resize(function(){ 
    bg_img_resize(); 
    $('#background').css({ 'top' : 0, 'left' : 0 }); 
});
$(window).scroll(function(){ 
    bg_img_resize(); 
    $('#background').css({ 'top' : 0, 'left' : 0 }); 
});