// 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

document.write('<style>.mlyri{' + (navigator.userAgent.indexOf('Gecko') > -1 ? '' : 'width:1;height:1;') + 'position:absolute;left:0;top:0}.mlyrh{' + (navigator.userAgent.indexOf('Gecko') > -1 ? '' : 'width:1;height:1;') + 'position:absolute;left:0;top:0;visibility:hidden}</style>');

function doc () {
	var b_isMac = navigator.appVersion.indexOf('Mac') > -1
	this.onload = doc_load;
	this.getElem = document.all ?
		function (_i) { return document.all[_i] } : function (_i) { return document.getElementById(_i) };
	if (b_isMac && navigator.appVersion.indexOf('MSIE 4')) this.s_onload = 'onLoad';
	this.getOffs = function (n, init_x, init_y) {	
		var sz = { 'x' : init_x, 'y' : init_y };
		for(; n; n = n.offsetParent) { sz.x += n.offsetLeft; sz.y += n.offsetTop }
		return sz;
	};
	this.getOffs = b_isMac ? 
		function (n, init_x, init_y) {	
			var sz = { 'x' : init_x, 'y' : init_y };
			for(; n; n = n.offsetParent) { 
				sz.x += n.offsetLeft - 35;
				//sz.y += n.offsetTop
			 };
			if (document.body.leftMargin) {
		 		sz.x += document.body.leftMargin * 1 - 35; 
			}

			//if (document.body.topMargin) {
			//	sz.y += document.body.topMargin * 1;
			//}
			//alert( "hello macies" + sz.x + " " + sz.y );

			return sz;
		}	
			: 
		function (n, init_x, init_y) {	
			var sz = { 'x' : init_x, 'y' : init_y };
			for(; n; n = n.offsetParent) { sz.x += n.offsetLeft; sz.y += n.offsetTop };
			return sz;
		};
	this.divBlink = function (div, is_vis) { div.style.visibility = is_vis ? 'visible' : 'hidden' };
	this.divMove = function (div, coord) { div.style.left = coord.x; div.style.top = coord.y };
	this.divSize = window.opera
		? function (div, dim) { return div.style[dim ? 'pixelHeight' : 'pixelWidth'] }
		: function (div, dim) { return div[dim ? 'offsetHeight' : 'offsetWidth'] };
}

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) {
		if (  o_doc.getElem(this.a_forms[_i]) != null ) {
			//alert( o_doc.getElem(this.a_forms[_i]) );
			o_doc.getElem(this.a_forms[_i]).style.visibility = b_show ? 'visible' : 'hidden';
		}
	}


}
// --------------------------------------------------------------------------------
// menu methods
// --------------------------------------------------------------------------------
function menu_build (table) {
	document.write(['<div', this.is_master || top == window ? '' : ' class=mlyrh', ' id="m', this.id, '"><table cellpadding="', table[0], '" cellspacing="', table[1], '" border="', table[2], '" class="', this.items[0].getCSS('table'), '"><tr class=kut_menu_tr>', this.subHTML.join(''), '</tr></table></div>'].join(''));
	this.main = o_doc.getElem('m' + this.id);
}

// --------------------------------------------------------------------------------
// browser independent methods
// --------------------------------------------------------------------------------
function mitem_buildSub() {
	var table = this.a_kids[0].getProp('table');
	this.subHTML = ['<div class=mlyrh style="z-index:', this.depth + 1, '" id="m', this.o_root.id, 'c', this.id, '"><table cellpadding="', table[0], '" cellspacing="', table[1], '" border="', table[2], '" class="', this.a_kids[0].getCSS('table'), '" id="m', this.o_root.id, 't', this.id, '"><tr class=kut_menu_tr>', this.subHTML.join(''), '</tr></table></div>'];
}

function mitem_build(w, h) {
	var s = '<td width="' + w + '"><div style="position:relative;width:' + w + ';height:' + h + '">';
	for (var _i = 0; _i < 3; _i++)
		s = [s, _i ? '<div class=mlyrh id="m' + this.o_root.id + 'i'+ this.id + 'o' +
_i + '">' : '', '<table cellpadding="0" cellspacing="0" border="0" width="', w, '" height="', h, '" class="', this.getCSS('outer', _i), '"><tr class=kut_menu_tr><td class="', this.getCSS('inner', _i), '">', typeof(this.fields[0]) == 'object' ? this.fields[0][_i] : this.fields[0],	'</td></tr></table>', _i ? '</div>' : ''].join('');
	return [s, '<div class=mlyri><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)" 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)"><img src="', o_doc.pix, '" width="', w, '" height="', h, '" border="0"', this.o_cfg_cust.tt ? ' alt="' + this.o_cfg_cust.tt + '"' : '', '></a></div></div></td>', 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('');
}

function mitem_links() {
	this.elements = [];
	for (var _i = 1; _i < 3; _i++)
		this.elements[_i - 1] = o_doc.getElem('m' + this.o_root.id + 'i' + this.id + 'o' + _i);
}
// swithces states of menu item
function mitem_state(state) {
	if (this.state != null && state == this.state) return;
	if (this.state) o_doc.divBlink(this.elements[this.state - 1]);
	if (state) o_doc.divBlink(this.elements[state - 1], true);
	this.state = state;
}
// --------------------------------------------------------------------------------
// collapses menu to the level specified
function mitem_collapse(to_level) {
	if (this.subling)	{
		o_doc.divBlink(this.subling);
		for (var _i = 0; _i < this.a_kids.length; _i++)
			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.subling) {
		this.pos();	
		if (!o_doc.b_Gecko) this.o_root.selectsHide();
		o_doc.divBlink(this.subling, true);
	}
}

