/* JS document common variables */

var d = document;

/* Show-hide layer function */

function $h(id, f)
{
	var o = typeof id == 'object'? id : $(id);

	if(f != 1)
		o.style.display = o.style.display == 'block'? 'none' : 'block';
	else
		o.style.visibility = o.style.visibility == 'visible'? 'hidden' : 'visible';
}

/* Show-hide layer function end */

/* Find element function */

function $()
{
	var a = $.arguments;

	if(typeof a[0] == 'string' && a[0].indexOf('#') != 0)
		return eval('d.getElementById(a[0])' + (a[1] == 1? '.style' : ''));
	else if(typeof a[0] == 'string' && a[0].indexOf('#') == 0)
		return $($(a[0].substring(1)), a[1], a[2], a[3]);
	else if(typeof a[0] == 'object' && typeof a[1] == 'string' && typeof a[2] == 'undefined')
		return a[0].getElementsByTagName(a[1]);
	else if(typeof a[0] == 'object' && a[2] >= 0 && typeof a[3] == 'undefined')
		return a[0].getElementsByTagName(a[1])[a[2]];
	else if(typeof a[0] == 'object' && a[2] >= 0 && a[3] == 1)
		return a[0].getElementsByTagName(a[1])[a[2]].style;
	else
		return;
}

/* Find element function end */

