function clear_item()
{
	navRoot = document.getElementById("top_menu");
    for (i=0; i<navRoot.childNodes.length; i++) {
          node = navRoot.childNodes[i];
          if (node.nodeName=="LI") {
               node.className=node.className.replace("hover", "");
          }
    }

}

function defaultMenu() {
	cur_id='vocabulary';
	d1=document.getElementById(cur_id);
	if(d1!=null)d1.style.display='block';
}
cur_id="vocabulary";

function switch_item(obj,in_id)
{
	clear_item();
	obj.className+=" hover";
	if (in_id != '')
	{
	d1=document.getElementById(cur_id);
	d2=document.getElementById(in_id);
	if (in_id != cur_id)
	{
		if (cur_id != '')
		{
			d1.style.display='none';
		}
		d2.style.display='block';
		cur_id=in_id;
	}
	}
}

function hideLogin(obj) {
	if (obj.value == 'Логин') {
		obj.style.color = '#000000'
		obj.value = '';
	}
}

function showLogin(obj) {
	if (obj.value == '') {
		obj.style.color = '#999999'
		obj.value = 'Логин';
	}
}

function hidePasswd(id) {
	obj = document.getElementById(id);
	if (obj.value == 'Пароль') {
		var inputNode = document.createElement('input');
		inputNode.type = 'password';
		inputNode.value = '';
		inputNode.id = 's';
		inputNode.name = 'USER_PASSWORD';
		inputNode.className = 'text_field';
		inputNode.onblur = function() {showPasswd('s');}
		obj.parentNode.replaceChild(inputNode, obj);
		inputNode.style.color = '#000000'
		inputNode.focus();
		inputNode.setActive();
	}
}

function showPasswd(id) {
	obj = document.getElementById(id);
	if (obj.value == '') {
		var inputNode = document.createElement('input');
		inputNode.type = 'text';
		inputNode.value = 'Пароль';
		inputNode.id = 's';
		inputNode.name = 'passwd';
		inputNode.className = 'text_field';
		inputNode.onfocus = function() {hidePasswd('s');}
		obj.parentNode.replaceChild(inputNode, obj);
		inputNode.style.color = '#999999'
	}
}