startList = function() 
{
	if (document.all && document.getElementById) 
	{
		navRoot = document.getElementById ("nav");
		for (i = 0; i < navRoot.childNodes.length; i++) 
		{
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") 
			{
				node.onmouseover = function() { this.className += ' on'; }
				node.onmouseout = function() { this.className = this.className.replace (' on', ''); }
			}
		}

	}

	tabRoot = document.getElementById ("tab");
	if(tabRoot) {
		for (i = 0; i < tabRoot.childNodes.length; i++) 
		{
			node = tabRoot.childNodes[i];
			if (node.nodeName=="LI") 
			{
				node.onmouseup = function() { 
					nRoot = document.getElementById ("tab");
					for (j = 0; j < nRoot.childNodes.length; j++) 
					{
						node2 = nRoot.childNodes[j];
						if (node2.nodeName == "LI") { node2.className = 'off' };
					}
			
					this.className = 'on'; 
				}
			}
		}
	}
}

window.onload = startList;

var Frame = {
	answer: function(incoming_text)
	{
		var param = /^(.+?)\|/.exec(incoming_text);
	    
		if (!param)	return;
		
		var text = incoming_text.replace(/.+?\|/, "");
		param[1] = param[1].replace(/(^[^a-z_]*)|([^a-z_]*$)/gi, '');// удаляем мусор
		
		if (typeof(handlers[param[1]]) != "function")
		return;
		
		handlers[param[1]](text);
		return;
		
	},
	
	process: function(name)
	{
		try
		{
			var nf_innerHTML = name.contentWindow.document.body.innerHTML;
			
			if (nf_innerHTML != '')
			Frame.answer(nf_innerHTML);
		}
		catch(e){};
	}
}

if (!window.u_common)
{
	window.u_common = true;
	window.handlers = {};
	document.write('<iframe id="null_frame" src="images/0.gif" name="null_frame" onload="Frame.process(this);" style="position: absolute; display: none; visibility: hidden" width="0" height="0"> </iframe>');
};


handlers['test']=function(text)
{
	alert(text);
}
