// JavaScript Document
function $id(obj){
	return document.getElementById(obj);
}
// Function ShowMotion.
var d = "sm";
var tmax = 300;
var speed = 15;
var t = 0; var state = 1;

function sm(obj){
	$id(d).innerHTML = "";
	if (state == 1){
		f = function () { sm_show(obj); }
		$id(d).style.height = t + "px";
		$id(d).style.display = "block";
		si = setInterval(f,speed);
	} else {
		ff = function () { sm_hide(obj); }
		$id(obj).style.display = "none";
		sii = setInterval(ff,speed);
	}
}

function sm_show(objj){
	t = t + 10;
	$id(d).style.height = "" + t + "px";
	if (t >= tmax){
		clearInterval(si);
		$id(d).innerHTML = $id(objj).innerHTML;
		//t = 0;
		state = 2;
	}
}

function sm_hide(objjj){
	t = t - 10;
	$id(d).style.height = "" + t + "px";
	if (t <= 0){
		clearInterval(sii);
		$id(d).style.display = "none";
		//t = 0;
		state = 1;
		sm(objjj);
	}
}
// Function QueryString.
function rqs(){
	var r = qs();
	if (r['d'] != undefined){
		sm(r['d']);
	}
}
