function answer(id) { if (opros_selected > -1) { f = document.getElementById("voteForm"); var navRoot = document.getElementById("oprelements"); node = navRoot.childNodes[opros_selected]; dchild=node.firstChild; f.variant.value = node.id; //f.variant.value = dchild.firstChild.id; f.submit(); } else { div = document.getElementById("errmsg"); div.style.display = '' setTimeout(function(){ div.style.display = 'none';},8000); //alert("\u0432\u044B \u043D\u0438\u0447\u0435\u0433\u043E \u043D\u0435 \u0432\u044B\u0431\u0440\u0430\u043B\u0438!"); } } function to(ref){ document.location.href='http://'+ref; } var opros_selected=-1; start_opros = function() { var navRoot = document.getElementById("oprelements"); if(navRoot){ for (i=0; i-1) { last_node=navRoot.childNodes[opros_selected]; dchild=last_node.firstChild; dchild.firstChild.className=''; } opros_selected=this.getAttribute('rid'); dchild=this.firstChild; dchild.firstChild.className='selected'; } } } }} } window.onload=start_opros;