function getObj(el)
{
	if(document.all) return document.all[el];
	else if(document.layers) return document.layers[el];
	else return document.getElementById(el);
}

function menu_over(id)
{
	getObj("m_td"+id).className="menu_on";
	getObj("a_m"+id).className="menu";
}
function menu_out(id)
{
	getObj("m_td"+id).className="menu_off";
	getObj("a_m"+id).className="";
}

function pop_win(img, w, h)
{
	w=640;h=480;
	if(3*w>=4*h && w>640)
	{
		h=640*h/w;
		w=640;
	}
	else if(3*w<4*h && h>480)
	{
		w=480*w/h;
		h=480;		
	}
	var x,y;
	x=(screen.width-w)/2;
	y=(screen.height-h)/2;
	if(x<0) x=0;
	if(y<0) y=0;
	window.open(img,'','left='+x+',top='+y+',width='+w+',height='+h+',toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes');
}


function checkLength(TextArea)
{
	var msg=TextArea.value;
	if(msg.length>500) TextArea.value = msg.substring(0,500);
}