var fl;
var w_img=1504, h_img=1392;
var w,new_w,h, new_h, num;
h_cont=600;
setWidth();
setHeight();
w=new_w;h=new_h;
setSize();
function setWidth(){
new_w=$(window).width();
}
function setHeight(){
new_h=$(window).height();
}
function setSize(){
m_top=~~((h-h_img)/2);
m_left=~~((w-w_img)/2);
$('.bg1').css({ marginTop:m_top});
$('.spinner').css({ backgroundPosition:m_top+'px center'});
$('.bg1 img').css({marginLeft:m_left});
if (h>h_cont) {
p_top=~~((h-h_cont)/2);
if (fl) {
p_top=~~((h-h_cont)/1.2);
}
} else p_top=0;
$('.container').stop().animate({paddingTop:p_top+20},1000, 'easeOutCirc');
h_cont_new=h_cont;
}
setInterval(setNew,10);
function setNew(){
setWidth();
setHeight();
if (fl) {h_cont=300;} else {h_cont=800;}
if ((w!=new_w)||(h!=new_h)||(h_cont_new!=h_cont)) {
w=new_w;h=new_h;
setSize();
}
}

