// Title: Tigra Menu GOLD
// URL: http://www.softcomplex.com/products/tigra_menu_gold/
// Version: 2.4
// Date: 05-22-2003 (mm-dd-yyyy)
// Technical Support: support@softcomplex.com (specify product title and order ID)
// Notes: Registration needed to use this script legally.
// Visit official site for details.

// Please, don't modify this file

function doc () {
	this.getElem = function (n, d) {
	  var _i, x;  
		if (!d) d = document; 
		x = d[n];
	  for (_i = 0; !x && d.layers && _i < d.layers.length; _i++) 
			x = o_doc.getElem(n, d.layers[_i].document);
		return x;
	};
	this.getOffs = function (n, init_x, init_y) {	
		var sz = {
			'x' : init_x + (n.pageX != null ? n.pageX : n.x), 
			'y' : init_y + (n.pageY != null ? n.pageY : n.y) 
		};
		return sz;
	};
	this.divBlink = function (div, is_vis) { div.visibility = is_vis ? 'show' : 'hide' };
	this.divMove = function (div, coord) { div.left = coord.x; div.top = coord.y };
	this.divSize = function (div, dim) { return div.document[dim ? 'height' : 'width'] };
	this.onload = doc_load;
}

function TMGSelectsHide (b_show) {
	var b_needed = false;
	for (var _i in menus) if (menus[_i].last_item != null) b_needed = true;
	if (b_needed && b_show) return;
	for (_i in this.a_forms)
		o_doc.getElem(this.a_forms[_i]).visibility = b_show ? 'show' : 'hide';
}
// --------------------------------------------------------------------------------
// menu methods
// --------------------------------------------------------------------------------
function menu_build (table) {
	document.write (
		(this.is_master || top == window ? 
			'<img src="' + o_doc.pix + '" width=0 height=0 border=0' : '<layer visibility=hide z-index=0')
		+ ' name="m' + this.id + '"><div class="' + this.items[0].getCSS('table') + '"><table cellpadding="' + table[0] + '" cellspacing="' + table[1] + '" border="' + table[2] + '"><tr class=kut_menu_tr>' + this.subHTML.join('') + '</tr></table></div>' + (this.is_master || top == window ? '' : '</layer>'));
	this.main = this.is_master ? document.images['m' + this.id] : o_doc.getElem('m' + this.id);
}
// --------------------------------------------------------------------------------
// browser independent methods
// --------------------------------------------------------------------------------
function mitem_buildSub() {
	var depth_sub = this.depth + 1, 
	table = this.a_kids[0].getProp('table');

	this.subling = new Layer(0);
	this.subling.document.open();
	this.subling.document.write(['<div class="', this.getCSS('table'), '"><table cellpadding="', table[0], '" cellspacing="', table[1], '" border="', table[2], '" class="', this.getCSS('table'), '"><tr class=kut_menu_tr>', this.subHTML.join(''), '</tr></table></div>'].join(''));
	this.subling.document.close();
}

function mitem_links() {
	this.elements = [];
	for (var _i = 0; _i < 3; _i ++)
		this.elements[_i] = o_doc.getElem('m' + this.o_root.id + '_i' + this.id + 'o' + _i);
}

function mitem_build (w, h) {
	var s_css, s = '<td><ilayer z-index=' + this.depth + '>';
	for (var _i = 0; _i < 3; _i ++) {
		s_css = this.getCSS('outer', _i);
		s += ['<layer name="m', this.o_root.id, '_i', this.id, 'o', _i, '" width="', w, '" height="', h, '" visibility="', _i || !this.depth ? 'hide' : 'show', '"><table cellpadding=0 cellspacing=0 border=0 width="', w, '" height="', h, '" class="', s_css, '"><tr class=kut_menu_tr><td><div class="', s_css, '"><div class="', this.getCSS('inner', _i), '">', typeof(this.fields[0]) == 'object' ? this.fields[0][_i] : this.fields[0], '</div></div></td></tr></table></layer>'].join('');
	}	
	return [s, '<layer width="', w, '" height="', h, '" onmouseout="menus[\'', this.o_root.id, '\'].exec(', this.id, ',1)" onmouseover="menus[\'', this.o_root.id, '\'].exec(', this.id, ',2)" onmousedown="menus[\'', this.o_root.id, '\'].exec(', this.id, ',3)"><a href="', this.fields[1] ? this.fields[1] : '', '"', this.o_cfg_cust.tw ? ' target="'	+ this.o_cfg_cust.tw + '"' : '', ' onclick="return menus[\'', this.o_root.id, '\'].exec(', this.id, ',0)"><img src="', o_doc.pix, '" width="', w, '" height="', h, '" border="0"', this.o_cfg_cust.tt ? ' alt="' + this.o_cfg_cust.tt + '"' : '', '></a></layer></ilayer></td>\n', this.arrpath[this.depth] != this.o_parent.child_count - 1 && this.o_parent.a_kids[0].b_vertical ? '</tr><tr class=kut_menu_tr>' : ''].join('');
}
// swithces states of menu item
function mitem_state(state) {
	if (this.state != null && state == this.state) return;
	if (this.state != null) this.elements[this.state].visibility = 'hide';
	this.elements[state].visibility = 'inherit';
	this.state = state;
}
// --------------------------------------------------------------------------------
// collapses menu to the level specified
function mitem_collapse(to_level) {
	if (this.subling) this.subling.visibility = 'hide';	
	for (var _i in this.a_kids)
		this.a_kids[_i].set_state(0);
	if (to_level >= this.depth) {
		if (this != this.o_root.o_hovered) this.set_state(0);
	}
	else this.o_parent.collapse(to_level);
}
// expands menu to calling items
function mitem_expand() {
	if (this.o_root.last_item && this.depth <= this.o_root.last_item.depth)
		this.o_root.last_item.collapse((this.o_root.last_item.o_parent == this) * 1 + this.depth);
	this.o_root.last_item = this;
	if (this.child_count > 0) {
		if (!this.subling) {
			this.f_born_kids();
		}
		this.pos();
		this.o_root.selectsHide();
		o_doc.divBlink(this.subling, true);
	}
}
