$(window).load(function() {		
	var w_img=1500, h_img=1000;
	var w,new_w,h, new_h, num;
	setWidth();
	setHeight();
	w=new_w;h=new_h;
	setSize();
	function setWidth(){
		new_w=$(window).width();
	}
	function setHeight(){
		new_h=$(window).height();
	}
	function setSize(){
		if ((w/w_img) > (h/h_img)) {
			w_img_new=w+20;
			h_img_new=~~((w+20)*h_img/w_img);
		} else {
			h_img_new=h+20;	
			w_img_new=~~((h+20)*w_img/h_img);
		}
		$('#bgSlider img').css({width:w_img_new, height:h_img_new});
		if (h>826) {
			$('body').css({overflowY:'hidden'});
			$('.container_24').stop().animate({marginTop:~~((h-826)/2), height:'766'});
			if ((location.hash=='')||(location.hash=='#')) {
				$('header').stop().animate({marginTop:'569'})
			}
		} else {
			if ((location.hash=='')||(location.hash=='#')) {
				$('.container_24').css({ height:h-60});
				$('header').css({marginTop:h-257+'px'})
			}
			$('.container_24').css({marginTop:0});
			$('body').css({overflow:'inherit'})
		}
	}
	setInterval(setNew,60);
	function setNew(){
		setWidth();
		setHeight();
		if ((w!=new_w)|(h!=new_h)) {
			w=new_w;h=new_h;
			setSize();
		}
	}
})
