function width_max(elem, start, end, step, speed) {
if(!wa) {isResize['width_max'] = true; wa = true;}
var i = start;
i+=step;
elem.style.width = i+'px';
if(i <= end) setTimeout(function() {width_max(elem, i, end, step)},speed);
else {isResize['width_max'] = false; tb = false;}
}
function left_left(elem, start, end, step, speed) {
if(!ll) {isResize['left_left'] = true; ll = true;}
var i = start;
i-=step;
elem.style.left = i+'px';
if(i >= end) setTimeout(function() {left_left(elem, i, end, step)},speed*2);
else {isResize['left_left'] = false; tb = false;}
}
function width_min(elem, start, end, step, speed) {
if(!wi) {isResize['width_min'] = true; wi = true;}
var i = start;
i-=step;
elem.style.width = i+'px';
if(i >= end) setTimeout(function() {width_min(elem, i, end, step)},speed);
else {isResize['width_min'] = false; tb = false;}
}
function left_right(elem, start, end, step, speed) {
if(!lr) {isResize['left_right'] = true; lr = true;}
var i = start;
i+=step;
elem.style.left = i+'px';
if(i <= end) setTimeout(function() {left_right(elem, i, end, step)},speed*2);
else {isResize['left_right'] = false; tb = false;}
}
if(gl_width<w) {
width_max(elem, parseInt(gl_width), w, step, speed);
left_left(elem, parseInt(gl_left), l, step, speed);
}
else if(gl_width>w) {
width_min(elem, parseInt(gl_width), w, step, speed);
left_right(elem, parseInt(gl_left), l, step, speed);
}