//------------------------------------------
// i-Tab
// © 2007 Kim & Dean - All Rights Reserved
// Written By:  Dean
//------------------------------------------

var itab_about        = false;
var itab_about_clog   = false;
var itab_about_skip   = false;
var itab_about_check  = false;
var itab_about_loaded = false;
var itab_ie7          = ((is_ie) && (uagent.indexOf('msie 7.') != -1));
var itab_year_start   = 2006;
var itab_about_key    = 'i-tab';
var itab_loaded       = false;
var itab_menu_js      = new Array();
var itab_about_timer;
var itab_cur_x;
var itab_cur_y;

function itab_add_event(o, e, f)
{
	if (o.addEventListener)
	{
		o.addEventListener(e, f, false);
	}
	else if (o.attachEvent)
	{
		o.attachEvent('on'+e, f);
	}
	else
	{
		eval('o.on'+e+'='+f);
	}
}

function itab_gogo_topic(tid)
{
	try
	{
		menu_action_close();
	}

	catch(e){}
	window.location.href = ipb_var_base_url+'showtopic='+tid;

	return true;
}

function topic_link_event_mouseup(e)
{
	e = global_cancel_bubble(e, false);

	var tid = _get_tid_from_id(this.id);
	tid_date[tid] = 0;
}

function itab_load_menus()
{
	try
	{
		var o = document.getElementById('itab-js-data');
		var b = document.getElementsByTagName('body')[0];

		if (o && b)
		{
			while (o.hasChildNodes() || o.childNodes.length > 0)
			{
				b.appendChild(o.childNodes[o.childNodes.length-1]);
			}
		}

		o.style.display = 'none';
	}

	catch(me){}
}

function itab_window_close()
{
	try
	{
		menu_action_close();
	}

	catch(e){}
	window.close();
}

function itab_view_profile(id, nw)
{
	try
	{
		menu_action_close();
	}

	catch(e){}

	nw = (nw == true) ? true : false;
	if (!isNaN(id))
	{
		var u = ipb_var_base_url+'showuser='+id;
		if (nw == true)
		{
			opener.window.location = u;
		}
		else
		{
			window.location = u;
		}
	}

	return false;
}

function itab_get_link_menu(o)
{
	var p = o;
	while (p)
	{
		if (!p || typeof(p) == 'undefined')
		{
			break;
		}

		if (p.className.toLowerCase() == 'popupmenu' && p.parentNode.id.indexOf('_menu'))
		{
			p = p.parentNode;
			break;
		}

		p = p.parentNode;
	}

	return p;
}

function itab_header_search()
{
	var d =
	{
		'obj'   : my_getbyid('ipb-tl-search'),
		'menu'  : my_getbyid('ipb-tl-search_menu'),
		'pmenu' : itab_get_link_menu(my_getbyid('ipb-tl-search'))
	}

	d.obj.onclick = itab_header_search_click;
}

function itab_header_search_click(e)
{
	e = ipsclass.cancel_bubble(e, true);
	var o = my_getbyid('ipb-tl-search_menu');

	if (o.style.display == 'none')
	{
		itab_header_search_show(e);
	}
	else
	{
		o.style.display = 'none';
	}

	return false;
}

function itab_header_search_show()
{
	var d =
	{
		'obj'   : my_getbyid('ipb-tl-search'),
		'menu'  : my_getbyid('ipb-tl-search_menu'),
		'pmenu' : itab_get_link_menu(my_getbyid('ipb-tl-search')),
		'top'   : 0,
		'left'  : 0
	}

	d.menwid = d.pmenu.offsetWidth;
	d.menhgt = d.pmenu.offsetHeight;
	d.width  = (parseInt(d.menu.style.width)) ? parseInt(d.menu.style.width) : d.menu.offsetWidth;
	d.height = (parseInt(d.menu.style.height)) ? parseInt(d.menu.style.height) : d.menu.offsetHeight;
	d.left   = ipsclass.get_obj_leftpos(d.obj.parentNode)+d.menwid;
	d.top    = ipsclass.get_obj_toppos(d.obj.parentNode)-1;

	if ((d.left+d.width) >= document.body.clientWidth)
	{
		d.left = d.left-d.menwid-d.width-2;
	}

	if ((d.top+d.height) >= document.body.clientHeight)
	{
		d.top = d.top+d.menhgt-d.height;
	}

	d.menu.style.position   = 'absolute';
	d.menu.style.top        = d.top+'px';
	d.menu.style.left       = d.left+'px';
	d.menu.style.display    = '';
	d.menu.style.zIndex     = 10000;
	d.menu.onclick          = ipsclass.cancel_bubble_low;

	my_getbyid('ipb-tl-search-box').focus();
}

function itab_header_search_hide()
{
	my_getbyid('ipb-tl-search_menu').style.display = 'none';
}

function itab_about_init()
{
	itab_about_create_box(document.getElementsByTagName('body')[0]);

	var z = new Array('a', 'span');
	for (var n=0; n<z.length; n++)
	{
		var a = document.getElementsByTagName(z[n]);
		var b = 'rel';
		var c;

		for (var i=0; i<a.length-1; i++)
		{
			c = a[i];
			if (c.getAttribute(b))
			{
				if (c.getAttribute(b).toLowerCase() == 'itab-about')
				{
					c.onclick = itab_about_show;
					try
					{
						c.style.cursor = 'pointer';
					}

					catch(er)
					{
						c.style.cursor = 'hand';
					}
				}
			}
		}
	}

	itab_about_loaded = true;
}

function itab_about_create_box(o)
{
	var d = itab_about_denc('521561566579493566561522500566577558559556558559572578577556559564500493576577582569562522500561566576573569558582519571572571562500523521508561566579523521561566579493566561522500566577558559556558559572578577556580575558573573562575500493576577582569562522500561566576573569558582519571572571562500523521561566579493566561522500566577558559556558559572578577556560572571577562571577500493576577582569562522500573572576566577566572571519575562569558577566579562500523521561566579493576577582569562522500573572576566577566572571519575562569558577566579562520577572573519514573581520569562563577519509573581520577562581577506558569566564571519560562571577562575500523521566570564493576575560522500584566570564507578575569586508566577558559556558559572578577556569572564572556573572573578573507564566563500493559572575561562575522500509500493558569577522500500493508523521559575493508523521576573558571493560569558576576522500566577558559556558559572578577556577566577569562500523566506545558559493527569578562493544577562562569493544568566571493579510507509521508576573558571523521559575493508523521576573558571493560569558576576522500566577558559556558559572578577556577566577569562556560500523630493584561558577562507582562558575586493506493526569569493543566564565577576493543562576562575579562561507521508576573558571523521508561566579523521559575493508523521561566579493576577582569562522500580566561577565519518509498500523521577558559569562493560569558576576522500566573559577558559569562500493560562569569576573558560566571564522500509500493560562569569573558561561566571564522500509500523521577575523521577561493558569566564571522500569562563577500493579558569566564571522500577572573500493580566561577565522500516509498500523521559523528575562561566577576519521508559523521508577561523521577561493558569566564571522500569562563577500493579558569566564571522500577572573500493580566561577565522500512509498500523521559523537566571568576519521508559523521508577561523521508577575523521577575523521577561493558569566564571522500569562563577500493579558569566564571522500577572573500523521577558559569562493560569558576576522500566573559577558559569562500493560562569569576573558560566571564522500509500493560562569569573558561561566571564522500509500523521577575523521577561493558569566564571522500569562563577500493579558569566564571522500570566561561569562500493580566561577565522500512514498500523521578523532575558573565566560576508529562576566564571519521508578523521508577561523521577561493558569566564571522500569562563577500493579558569566564571522500570566561561569562500493580566561577565522500511514498500523536566570493543566577560565566562521508577561523521577561493558569566564571522500569562563577500493579558569566564571522500570566561561569562500493580566561577565522500512509498500523552493521558493565575562563522500565577577573519508508580580580507576568566571559582561575558564572571563569582507560572570500493577558575564562577522500556559569558571568500523548562559576566577562521508558523493554521508577561523521508577575523521577575523521577561493558569566564571522500569562563577500493579558569566564571522500570566561561569562500523521578523541575572564575558570570566571564519521508578523521508577561523521577561493558569566564571522500569562563577500493579558569566564571522500570566561561569562500523544565558580571493529562558571521508577561523521577561493558569566564571522500569562563577500493579558569566564571522500570566561561569562500523552493521558493565575562563522500565577577573519508508580580580507561576560575566573577566571564507560572570500493577558575564562577522500556559569558571568500523548562559576566577562521508558523493554521508577561523521508577575523521508577558559569562523521508577561523521577561493558569566564571522500569562563577500493579558569566564571522500577572573500523521561566579493576577582569562522500570558575564566571506559572577577572570519514573581500523552493521558493565575562563522500565577577573519508508580580580507576568566571559582561575558564572571563569582507560572570508576577572575562508500493577558575564562577522500556559569558571568500523541578575560565558576562493544568566571521508558523493554521508561566579523552493521558493565575562563522500496500493572571560569566560568522500575562577578575571493566577558559556558559572578577556560565558571564562569572564501577575578562502500523547566562580493528565558571564562569572564521508558523493554521508577561523521508577575523521577575523521577561493558569566564571522500569562563577500493560572569576573558571522500511500493579558569566564571522500577572573500523521559523526559572578577519521508559523521508577561523521508577575523521577575523521577561493558569566564571522500569562563577500493560572569576573558571522500511500493579558569566564571522500577572573500523566506545558559493527569578562493544577562562569493576568566571493566576493573575566570558575566569582493561562576566564571562561493563572575493521558493565575562563522500565577577573519508508580580580507566571579566576566572571573572580562575507560572570500493577558575564562577522500556559569558571568500523534571579566576566572571493541572580562575493527572558575561521508558523493511507512507581494494499571559576573520493566506545558559493527569578562493544577562562569493566576493558571572577565562575493560565566569561493576568566571493572563493577565562493572575566564566571558569493566506545558559493576568566571493580565566560565493560572570573569562577562569582493560565558571564562561493577565562493566571577562575563558560562493572563493534541527507499571559576573520493534577576493563578571560577566572571576493558571561493558559566569566577566562576493558575562493577565562493576558570562505493567578576577493577565562493569572572568493558571561493563562562569493566576493561566563563562575562571577507499571559576573520493566506545558559493527569578562493544577562562569493566576493561562576566564571562561493563572575493577565562493565566564565506577562560565493573562572573569562493566571493570566571561493558571561493566576493573562575563562560577493563572575493582572578494521559575493508523521559575493508523521561566579493576577582569562522500563569572558577519569562563577500523566506545558559493527569578562493544577562562569493506493544577562562569566571564493550572578575493538566571561493526580558582494521508561566579523521561566579493576577582569562522500563569572558577519575566564565577520563572571577506576577582569562519566577558569566560520563572571577506576566583562519581581506576570558569569500523529572571500577493559562493558493563572572569494493522529521508561566579523521561566579493560569558576576522500560569562558575562561500523521508561566579523521508577561523521508577575523521508577558559569562523521559575493576577582569562522500570558575564566571506559572577577572570519512573581500493508523521561566579493558569566564571522500560562571577562575500523521577558559569562493560562569569576573558560566571564522500509500493560562569569573558561561566571564522500509500523521577575523521577561493558569566564571522500560562571577562575500493579558569566564571522500559572577577572570500523521566570564493576575560522500584566570564507578575569586508563566575562563572581507573571564500493559572575561562575522500509500493558569577522500500493558569566564571522500569562563577500493566561522500566577558559506563566575562563572581506569572564572500493508523521576573558571493576577582569562522500573558561561566571564506577572573519512573581500523566506545558559493527569578562493544577562562569493566576493572573577566570566583562561493577572493580572575568493566571493521558493565575562563522500565577577573519508508580580580507564562577563566575562563572581507560572570500493572571560569566560568522500575562577578575571493566577558559556564572556564572556563572581582501502500523531566575562531572581521508558523521559575493508523566506545558559493527569578562493544577562562569493566576493559562576577493579566562580562561493558577493510509511513581516515517493572575493565566564565562575521508576573558571523521508577561523521508577575523521508577558559569562523521508561566579523521508561566579523521561566579493566561522500566577558559556558559572578577556560569572576562500493572571560569566560568522500566577558559556558559572578577556565566561562501502500523549521508561566579523521508561566579523521508561566579523521561566579493566561522500566577558559556558559572578577556560565558571564562569572564500493576577582569562522500561566576573569558582519571572571562500523521561566579493566561522500566577558559556558559572578577556560565558571564562569572564556561558577558500523521508561566579523521561566579493558569566564571522500560562571577562575500523552493521558493565575562563522500496500493572571560569566560568522500575562577578575571493566577558559556558559572578577556560565558571564562569572564501563558569576562502500523528569572576562493528565558571564562569572564521508558523493554521508561566579523521508561566579523');
	if (d == '')
	{
		alert('Someone has altered something in here that they should not have been doing. >.<');
	}

	var z = new Date();
	var y = z.getFullYear();
	var x = (y > itab_year_start) ? itab_year_start+' - '+y : itab_year_start;

	var a = document.createElement('div');
	a.setAttribute('id', 'itab_about_box');
	a.style.display = '';
	a.innerHTML     = d.replace(/\{date\.year\}/ig, x).replace(/\{img\.url\}/ig, ipb_var_image_url);

	o.appendChild(a);

	try
	{
		var f = my_getbyid('itab-firefox-logo');
		if (f)
		{
			f.setAttribute('title', "Visit Mozilla Firefox's Website");
			itab_add_event(f, 'click', itab_go_go_foxy);
		}
	}

	catch(e){}
}

function itab_go_go_foxy()
{
	if (itab_about)
	{
		itab_about_hide();
	}

	var ffw = window.open('http://www.getfirefox.com', '_blank');
	ffw.focus();

	return false;
}

function itab_about_enc_key()
{
	var k = 0;
	for (var i=0; i<itab_about_key.length; i++)
	{
		k = k+itab_about_key.charCodeAt(i);
	}

	if (k == 0)
	{
		alert('Someone has altered something in here that they should not have been doing. >.<');
	}

	return k;
}

function itab_about_denc(c)
{
	var k = itab_about_enc_key();
	var j = 3;
	var r = '';

	{
	if (k > 0)
		if (c.length > 0)
		{
			for (var i=0; i<c.length; i+=3)
			{
				var x = c.substring(i, j);
				var t = (parseInt(x)-k);
				var y = unescape('%'+t.toString(16));

				if (y == '%d' || y == '%a')
				{
					if (y == '%a')
					{
						r = r+'\n';
					}
					else
					{
						r = r+' ';
					}
				}
				else
				{
					r = r+y;
				}

				j += 3;
			}
		}
	}

	return r;
}

function itab_about_show(e)
{
	if (!itab_about_loaded)
	{
		return false;
	}

	if (itab_about)
	{
		itab_about_hide();
		return false;
	}

	itab_about = true;
	itab_about_display_bg();
	itab_about_display();

	itab_about_skip  = true;
	itab_about_timer = setInterval('itab_about_display_bg();itab_about_display();', 10);

	window.onresize = itab_screen_freeze;
	document.oncontextmenu = function(){return false;}
	//window.onscroll = function(){window.scroll(itab_cur_x, itab_cur_y);}

	return false;
}

function itab_about_display()
{
	if (!itab_about_loaded)
	{
		return false;
	}

	var o = document.getElementById('itab_about_wrapper') || document.all['itab_about_wrapper'];

	if (!itab_about_skip)
	{
		o.style.display    = '';
		o.style.visibility = 'hidden';
		o.style.zIndex     = 1005;
	}

	itab_about_center(o);
	if (!itab_about_skip)
	{
		o.style.visibility = 'visible';
	}

	if (itab_about_clog)
	{
		var c = document.getElementById('itab_about_changelog') || document.all['itab_about_changelog'];
		itab_about_center(c);
	}
}

function itab_about_display_bg()
{
	if (!itab_about_loaded)
	{
		return false;
	}

	var b = document.getElementById('itab_about_bg') || document.all['itab_about_bg'];
	var l = 8;

	if (!itab_about_skip)
	{
		b.style.display = '';
		b.style.zIndex  = 1004;
		b.style.opacity = 0;
		b.style.filter  = 'alpha(opacity=0)';

		for (var i=0; i<=l; i++)
		{
			setTimeout("itab_set_opacity('itab_about_bg', "+i+")", 70*i);
		}
	}

	var sx = self.pageXOffset || (document.documentElement && document.documentElement.scrollLeft)   || document.body.scrollLeft;
	var sy = self.pageYOffset || (document.documentElement && document.documentElement.scrollTop)    || document.body.scrollTop;
	var dw = self.innerWidth  || (document.documentElement && document.documentElement.clientWidth)  || document.body.clientWidth;
	var dh = self.innerHeight || (document.documentElement && document.documentElement.clientHeight) || document.body.clientHeight;
	var ua = navigator.userAgent;

	if (ua.indexOf('MSIE ') != -1)
	{
		b.style.width = dw+'px';
	} 
	else
	{
		try
		{
			ssy = sy;
			if (sx == 0 && sy == 0 && itab_about_check == false)
			{
				window.scroll(0, 1);
				ssy = self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || document.body.scrollTop;
				window.scroll(sx, sy);
				itab_about_check = true;
			}

			if (ssy > 0 || itab_about_check == true)
			{
				b.style.width = dw-20+'px';
			}
			else
			{
				b.style.width = dw+'px';
			}
		}

		catch(e)
		{
			b.style.width = dw+'px';
		}
	}

	b.style.height = dh+sy+'px';
	if (!itab_about_skip)
	{
		itab_selects_status('hidden');
	}
}

function itab_about_key_handler(e)
{
	if (!itab_about_loaded)
	{
		return true;
	}

	var c = (document.all) ?  window.event.keyCode : e.keyCode;
	if (c == 27)
	{
		if (itab_about_clog)
		{
			itab_about_changelog(false);
		}
		else
		{
			if (itab_about)
			{
				itab_about_hide();
			}
			else
			{
				itab_about_show();
			}
		}

		return false;
	}

	return true;
}

function itab_about_hide()
{
	if (!itab_about_loaded)
	{
		return false;
	}

	if (!itab_about)
	{
		itab_about_show();
		return false;
	}

	itab_about = false;
	itab_about_hide_bg();

	var o = document.getElementById('itab_about_wrapper') || document.all['itab_about_wrapper'];
	o.style.display = 'none';

	itab_about_skip  = false;
	if (itab_about_timer)
	{
		clearInterval(itab_about_timer);
	}

	document.oncontextmenu = function(){return true;}
	if (document.body.style.oldoverflow)
	{
		document.body.style.overflow = document.body.style.oldoverflow;
	}

	if (itab_about_clog)
	{
		itab_about_changelog(false);
	}

	return false;
}

function itab_about_hide_bg()
{
	if (!itab_about_loaded)
	{
		return false;
	}

	var b = document.getElementById('itab_about_bg') || document.all['itab_about_bg'];
	b.style.display = 'none';

	itab_selects_status('visible');
}

function itab_selects_status(s)
{
	var a = document.getElementsByTagName('select');	
	for (var i=0; i<a.length; ++i)
	{
		a[i].style.visibility = s;
	}
}

function itab_set_opacity(id, v)
{
	o               = document.getElementById(id) || document.all[id];
	o.style.opacity = v/10;
	o.style.filter  = 'alpha(opacity='+v*10+')';
}

function itab_screen_freeze()
{
	if (!itab_about_loaded)
	{
		return false;
	}

	o = document.getElementById('itab_about_wrapper') || document.all['itab_about_wrapper'];
	b = document.getElementById('itab_about_bg')      || document.all['itab_about_bg'];
	w = self.innerWidth  || (document.documentElement && document.documentElement.clientWidth)  || document.body.clientWidth;
	h = self.innerHeight || (document.documentElement && document.documentElement.clientHeight) || document.body.clientHeight;
	a = navigator.userAgent;

	if (a.indexOf('MSIE ') != -1)
	{
		b.style.width = w+'px';
	} 
	else
	{
		b.style.width = w-20+'px';
	}

	if (a.indexOf('Opera/9') != -1)
	{
		b.style.height = document.body.scrollHeight+'px';
	}
	else
	{
		b.style.height = document.body.scrollHeight+50+'px';
	}

	itab_about_center(o);
	if (itab_about_clog)
	{
		c = document.getElementById('itab_about_changelog') || document.all['itab_about_changelog'];
		itab_about_center(c);
	}
}

function itab_about_center(o)
{
	var sx = self.pageXOffset || (document.documentElement && document.documentElement.scrollLeft)   || document.body.scrollLeft;
	var sy = self.pageYOffset || (document.documentElement && document.documentElement.scrollTop)    || document.body.scrollTop;
	var dw = self.innerWidth  || (document.documentElement && document.documentElement.clientWidth)  || document.body.clientWidth;
	var dh = self.innerHeight || (document.documentElement && document.documentElement.clientHeight) || document.body.clientHeight;
	var ew = o.offsetWidth;
	var eh = o.offsetHeight;
	var x  = Math.round(dw/2)-(ew/2)+sx;
	var y  = Math.round(dh/2)-(eh/2)+sy;

	o.style.left = x+'px';
	o.style.top  = y+'px';
}

function itab_global_login()
{
	var r = my_getbyid('itab-global-login-return').value;
	if (r != '')
	{
		r = r.replace(/&/gi, '&');
		r = r.replace(ipb_var_base_url, '');
		r = r.replace(/^\?/, '');
		r = r.replace(/s=(\w){32}/i, '');
		r = r.replace(/act=(login|reg|lostpass)/i, '');

		my_getbyid('itab-global-login-return').value = r;
	}
}

itab_add_event(window, 'load', itab_load_menus);
itab_add_event(window, 'load', itab_about_init);
itab_add_event(window, 'scroll', itab_screen_freeze);


var is_safari_win = false;
if (is_win && is_safari)
{
	is_safari_win = true;
	is_safari     = false;
}

var d = new Date();
if (!itab_year_start || typeof(itab_year_start) == 'undefined' || itab_year_start > d.getFullYear())
{
	itab_year_start = 2006;
}

function itab_about_changelog(d)
{
	if (!itab_about_loaded || !itab_about)
	{
		return false;
	}

	var o = document.getElementById('itab_about_changelog')      || document.all['itab_about_changelog'];
	var c = document.getElementById('itab_about_changelog_data') || document.all['itab_about_changelog_data'];
	var w = document.getElementById('itab_about_wrapper')        || document.all['itab_about_wrapper'];
	var b = document.getElementById('itab_about_bg')             || document.all['itab_about_bg'];

	if (d)
	{

		if (o.style.zIndex < b.style.zIndex)
		{
			b.style.zIndex = parseInt(w.style.zIndex/1+1);
			o.style.zIndex = parseInt(w.style.zIndex/1+2);
		}

		c.innerHTML        = itab_about_denc('493506506506506506506506506506506506506506506506506506506506506506506471508493493493566506545558559493527569578562493544577562562569493493493553493471553493493493493493493493528565558571564562569572564493493493493493493508493471493506506506506506506506506506506506506506506506506506506506506506506493471493471493471552579510507509554493471506493531566575576577493573578559569566560493575562569562558576562493501565572573566571564493558569569493559578564576493558575562493564572571562494502').replace(/\n/gi, '<br />').replace(new RegExp(' ', 'ig'), ' ').replace(new RegExp('<br(.+?)>', 'ig'), '<br />');
		o.style.display    = '';
		o.style.visibility = 'visible';
		itab_about_clog    = true;
		itab_about_center(o);
	}
	else
	{
		o.style.display = 'none';
		b.style.zIndex  = parseInt(w.style.zIndex-1);
		o.style.zIndex  = parseInt(b.style.zIndex-1);
		itab_about_clog = false;
	}

	return false;
}

function itab_get_child(o, n)
{
	for (var z=0; z<o.childNodes.length; z++)
	{
		if (o.childNodes[z].nodeName == n)
		{
			return o.childNodes[z];
		}
	}

	return o;
}

function itab_get_parent(o, id)
{
	while ((o=o.parentNode) != null)
	{
		if (o.id && o.id.indexOf(id) != -1)
		{
			return o;
		}
	}

	return o;
}

function itab_read_style(o, n)
{
	if (o.style[n])
	{
		return o.style[n];
	}
	else if (o.currentStyle)
	{
		return o.currentStyle[n];
	}
	else if (document.defaultView && document.defaultView.getComputedStyle)
	{
		var s = document.defaultView.getComputedStyle(o, null)
		return s.getPropertyValue(n);
	}
	else
	{
		return null;
	}
}

function itab_center_obj(o)
{
	st = (is_ie) ? itab_truebody().scrollTop    : window.pageYOffset;
	dw = (is_ie) ? itab_truebody().clientWidth  : window.innerWidth;
	dh = (is_ie) ? itab_truebody().clientHeight : window.innerHeight;
	ow = o.offsetWidth;
	oh = o.offsetHeight;

	o.style.left = dw/2-ow/2+'px';
	o.style.top  = st+dh/4-oh/4+'px';
}

function itab_truebody()
{
	return (document.compatMode && document.compatMode != 'BackCompat') ? document.documentElement : document.body;
}

function menu_action_close(e)
{
	try
	{
		if (e.button == 2 || e.button == 3)
		{
			return;
		}
	}

	catch(me){};

	ipsmenu.close(e);
	itab_header_search_hide();
}