var bottomStat = new Array(false,false);
var moveto = new Array();
function bottomExtend(fullWidth) {
	var bottomStr = (fullWidth==1)?'boxRight':'boxLeft';
	var obj = $(bottomStr);
	if(!bottomStat[fullWidth]) {
		movebox(bottomStr,0,-280,70,true,0);
	} else {
		movebox(bottomStr,-280,0,350,false,-280);
	}
	bottomStat[fullWidth] = !bottomStat[fullWidth];
}
function movebox(bottomStr,boxtop,end,hei,isup,marg) {
	var obj = $(bottomStr);
	var objP = $(bottomStr).parentNode;
	var browser=navigator.appName;
	var saf = navigator.appVersion;
	if(isup) {
		if(boxtop>end) {
			boxtop-=10;
			hei+=10;
			obj.style.bottom = -boxtop+'px';
			obj.style.height = hei+'px';
			obj.style.marginBottom = boxtop+'px';
	   	  	window.setTimeout("movebox('"+bottomStr+"',"+boxtop+","+end+","+hei+","+isup+");", 10);
		}
	} else {
		if(boxtop<end) {
			boxtop+=10;
			hei-=10;
			obj.style.bottom = -boxtop+'px';
			obj.style.height = hei+'px';
			obj.style.marginBottom = boxtop+'px';
	   	  	window.setTimeout("movebox('"+bottomStr+"',"+boxtop+","+end+","+hei+","+isup+");", 10);	
		}
	}
}
EventSelectors.register({ 
	
	"a.updown:click": function(el) {
		if($(el).hasClassName('leftbox')) {
			bottomExtend(0);
			if($("boxLeft").hasClassName("up")) {
				$("boxLeft").removeClassName("up");
				$("boxLeft").addClassName("down");
			} else if ($("boxLeft").hasClassName("down")){
				$("boxLeft").removeClassName("down");
				$("boxLeft").addClassName("up");
			}
		} else if ($(el).hasClassName('rightbox')) {
			bottomExtend(1);
			if($("boxRight").hasClassName("up")) {
				$("boxRight").removeClassName("up");
				$("boxRight").addClassName("down");
			} else if ($("boxRight").hasClassName("down")){
				$("boxRight").removeClassName("down");
				$("boxRight").addClassName("up");
			}
		}
	}

}, true);