$(document).ready(function() {
	w1=459;
   SetWidth();
   function SetWidth(){
		new_w=$(window).width();
	}
	w=new_w;
	k=-1;
	function setBg(pos){
		$('.bg_slider').css({backgroundPosition:pos});	
	}
		now=~~((w-w1)/2)-w1;
		pos=now+'px 60px';
		setBg(pos);
	
	setInterval(SetNew,600);
	function SetNew(){
		new_w=$(window).width();
		now=now-(w-new_w)/2;
		pos=now+'px 60px';
		setBg(pos);
		w=new_w;
	}
 });
$(window).load(function() {
   $('#slider').nivoSlider({
        effect:'fade', //Specify sets like: 'fold,fade,sliceDown, sliceDownLeft, sliceUp, sliceUpLeft, sliceUpDown, sliceUpDownLeft' 
        slices:1,
        animSpeed:200,
        pauseTime:6000,
        startSlide:0, //Set starting Slide (0 index)
        directionNav:true, //Next & Prev
        directionNavHide:false, //Only show on hover
        controlNav:false, //1,2,3...
        controlNavThumbs:false, //Use thumbnails for Control Nav
        controlNavThumbsFromRel:false, //Use image rel for thumbs
        controlNavThumbsSearch: '.jpg', //Replace this with...
        controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
        keyboardNav:true, //Use left & right arrows
        pauseOnHover:true, //Stop animation while hovering
        manualAdvance:false, //Force manual transitions
        captionOpacity:1, //Universal caption opacity
        beforeChange: function(){},
        afterChange: function(){},
        slideshowEnd: function(){} //Triggers after all slides have been shown
    });
});
