/*{{{ Global Init... */

if ( document.layers ) { document.all = document.layers; }

/*}}}*/

function getObject (objId)/*{{{*/
{
	var obj = 0;
	if ( document.getElementById ) {
		obj = document.getElementById(objId);
	}
	else {
		obj = document.all[objId];
	}
	return obj;
}/*}}}*/
function showObject (obj)/*{{{*/
{
	if ( obj && obj.style ) { obj.style.display = ''; }
}/*}}}*/
function hideObject (obj)/*{{{*/
{
	if ( obj && obj.style ) { obj.style.display = 'none'; }
}/*}}}*/
/*{{{*/function escJStr (s)
{
	s = String ( s );
	s = s.replace(/\&/g,'&amp;');
	s = s.replace(/\"/g,'&quot;');
	s = s.replace(/\</g,'&lt;');
	s = s.replace(/\>/g,'&gt;');
	return s;
}/*}}}*/

function escJSUnicode(s)/*{{{*/
{
	s = String(s);
	var res = '';
	for ( var i=0; i<s.length; i++ ) {
		var c = s.charCodeAt(i);
		if ( c>=192 ) {
			c += 1040-192;	// Cyr A++ (#192) U+0410 hex = U+1040 dec
		}
		var x = c.toString(16);
		while ( x.length<4 ) { x='0'+x; }
		res += '\\u'+x;
	}
	return res;
}/*}}}*/

function MenuClick (o)/*{{{*/
{
	var Id = o.id;
	oItems = getObject(Id+'Items');
	if ( oItems.style.display && oItems.style.display=='none' ) {
		/*
		alert('Id: '+Id+'\n'
		+'MenuRubric: '+MenuRubric+'\n'
		);
		*/
		oItems.style.display = 'block';
		if ( Id!=MenuRubric ) {
			oLastItems = getObject(MenuRubric+'Items');
			if ( oLastItems && ( !oLastItems.style.display || oLastItems.style.display!='none' ) ) {
				oLastItems.style.display = 'none';
			}
			MenuRubric = Id;
		}
	}
	else {
		//oItems.style.display = 'none';
		return true;
	}
	return false;
}/*}}}*/

