/********************************************************/
/*		This functions works for Mozilla and IE			*/
/*				Updated	Jan 26, 2006					*/
/*			Mike Semenov * Data Optimum 				*/
/********************************************************/
/*
 * Following GET procedures work good in both IE and Mozilla
 */

function GetNextValidSibling(el) {
    var nextNode = el.nextSibling;
    while (nextNode && (nextNode.tagName != el.tagName)) {
        nextNode = nextNode.nextSibling;
    }
    return nextNode;
}


function GetParentByTag (el, tag) {
    var parent = el.parentNode;
    while (parent)  {
        if (parent.tagName == tag)	break;
        parent = parent.parentNode;
    }
    return parent;
}


function GetChildByTag (el, tag) {
    var children = el.childNodes;
    for (var i = 0; i < children.length; i++)  {
        if (children [i].tagName == tag)	return (children [i]);
    }
    return null;
}

function GetNumberOfRows (el) {
    var parent = el.parentNode;
    while (parent)  {
        if (parent.tagName == "TABLE")	break;
        parent = parent.parentNode;
    }
    return parent.rows.length;

}

/*
 *	Retrieve Parameters from URI line
 *	call: GetParameters (document.URL)
 *  returns array of 2 element arrays;
 *
 *  Do not forget to UNESCAPE the second parameter!
 */
 
function GetParameters (uri)
{
	var all_params = uri.split("?");
	if (all_params.length <2)
	{
		return null;
	}
	var out = [];
	var param_formulas = all_params[1].split("&");
	for (i = 0; i < param_formulas.length; i++)
	{
		out.push (param_formulas[i].split("="));
	}
}


/*
 * Hides email from Robots leaving it visible for humans
 */
 

var mt = "mai" + "lto%3A";
var at = "%40";

function hma(address_user, address_domain, text_user, text_domain)
{
		document.write(
			unescape(String.fromCharCode(37,51,67,97,32,104,114,101,102,61,34) +
				mt + address_user + at + address_domain + '">'+ text_user +
				(text_domain? at + text_domain : '') +
				'%3C/a>'
			)
		);
}

/*
 * "Hides" text from Robots leaving it visible for humans
 */
function htxt(txt1,txt2)
{
		document.write(txt1 + (txt2? txt2 :""));
}
