/*Script is designed to keep a gradient from being cropped by the browser
this script requires JQuery, tested on version 1.6 free with no waranty GPL License .

SETUP-Place what you need here:...*/
var whenreaches = 1100; //When resize reaches this point do it to provide a smooth transition
var minwidth = 500; //This will position the left side of the image at the minwidth when whenreaches is reached

//Resize event will trigger this JS...
$(window).resize(adjust_gradient);
//Make sure the gradient looks good while loaded too...
$(document).ready(adjust_gradient);

function adjust_gradient(){
var current_width = $(window).width();
	 var current_bg = $('body').css('background-position');
	 if(current_width <= whenreaches){
	 //We need to change it to scroll, so the effect is not lost...
		$('body').css('background-attachment','scroll');
		$('body').css('background-position',minwidth+"px 0%");
	 }
	 //Make sure it can return too...
	 if(current_width >= whenreaches){
		$('body').css('background-attachment','fixed');
		$('body').css('background-position',"100% 100%");
	 }
}

