	var d = document;
	var m_table;
	var open_rt = true;
	var set_int;
	var width = 170;
	var height;
	var max_width;
	var max_height;
	var speed = 5;
	var flock = true;
	var top = false;

function start_rt(obj, w, h){

	if (!flock) return false;

	if (String(d.location).indexOf("/registration/") != -1) return false;

	if (obj) m_table = d.getElementById(obj);

	if (w) max_width = w;

	if (h) max_height = h;

	if (!d.getElementById('c_rt')) d.getElementById('cont_rt').innerHTML = "<div id='c_rt' style='width:100%;height:100%;'>" + d.getElementById('cont_rt').innerHTML + "</div>";

	set_int = setInterval(modify_rt, 1);

	return false;
}

function modify_rt(){

	flock = false;

	width = (open_rt)?width + speed:m_table.clientWidth - speed;

	if (max_width - width < speed) width += max_width - width;

	height = (max_height*(100*width/max_width)/100);

	if (!top) top = (d.body.clientHeight/2+(d.body.scrollTop-50));

	m_table.style.width = width.toFixed(0);

	m_table.style.height = height.toFixed(0);

	m_table.style.left = proz(d.body.clientWidth, width);

	m_table.style.top = 100*(top-(height/2))/d.body.clientHeight+"%";

	d.getElementById('c_rt').style.display = "none";

	if (open_rt){

		if (width > max_width/2.5) speed = 30;

		m_table.style.display = (typeof window.external == "object")?"block":"table";

		if (width >= max_width){

			clearInterval(set_int);

			d.getElementById('c_rt').style.display = "block";

			m_table.getElementsByTagName('input')[0].focus();

			open_rt = false;

			flock = true;

			speed = 5;

			window.onresize = resize;
		}

	} else {

		speed = 30;

		if (width < max_width/2) speed = 5;

		if (width <= 170){

			clearInterval(set_int);

			m_table.getElementsByTagName('form')[0].reset();

			m_table.style.display = "none";

			open_rt = true;

			flock = true;

			top = false;

			window.onresize = fal;
		}
	}
}

function proz(n1, n2){

	return 100*((n1/2)-(n2/2))/n1+"%";
}

function resize(){

	m_table.style.left = proz(d.body.clientWidth,width);

	m_table.style.top = 100*(top-(height/2))/d.body.clientHeight+"%";
}

function fal(){

	return false;
}
