/*
  --- menu level scope settins structure --- 
  note that this structure has changed its format since previous version.
  Now this structure has the same layout as Tigra Menu GOLD.
  Format description can be found in product documentation.
*/

var prevOffset;
var MSIE = (navigator.appName=="Microsoft Internet Explorer")?true:false;
var MFOX = (navigator.appName=="Netscape")?true:false;

function whichBrs() 
{
	var agt=navigator.userAgent.toLowerCase();
	
	if (agt.indexOf("opera") != -1) return 'Opera';
	if (agt.indexOf("firefox") != -1) return 'Firefox';
	if (agt.indexOf("safari") != -1) return 'Safari';
	if (agt.indexOf("msie") != -1) return 'Internet Explorer';
	if (agt.indexOf("netscape") != -1) return 'Netscape';
	if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
	if (agt.indexOf('\/') != -1) 
		{
		if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') 
			{
			return navigator.userAgent.substr(0,agt.indexOf('\/'));
			}
		else return 'Netscape';
		} 
	else if (agt.indexOf(' ') != -1)
	
	return navigator.userAgent.substr(0,agt.indexOf(' '));
	else return navigator.userAgent;
}

function getLeftPos(inputObj)
{
	var returnValue = inputObj.offsetLeft;
	
	if (MSIE)
	  while((inputObj = inputObj.offsetParent) != null)returnValue += inputObj.offsetLeft + 4;
	else
	{
		if (window.innerWidth > 1014)
			returnValue = ((window.innerWidth-1014) / 2) + 28;
		else
			returnValue = 28;
	}
		
	if(whichBrs()=='Safari')
	  return returnValue+9;
	else 
	  return returnValue+3;
}

function updateMenuPos()
{
	var offsetChange = prevOffset-getLeftPos(document.getElementById('MiddleTab'));
	prevOffset = getLeftPos(document.getElementById('MiddleTab'));
	//alert(prevOffset);
	//var offsetChange = prevOffset;
	var i, leftPos;
	//alert(offsetChange);
	for (i=0; i<28; i++)
	{
		leftPos = document.getElementById('e0_' + i +'o').style.left.replace('px','')/1;
		document.getElementById('e0_' + i +'o').style.left = leftPos - offsetChange + 'px';
	}
}

var MENU_POS = [
{
	// item sizes
	'height': 39,
	'width': 75,
	// menu block offset from the origin:
	//	for root level origin is upper left corner of the page
	//	for other levels origin is upper left corner of parent item
	'block_top': 0,
	'block_left': 40,
	// offsets between items of the same level
	'top': 0,
	'left': 75,
	// time in milliseconds before menu is hidden after cursor has gone out
	// of any items
	'hide_delay': 200,
	'expd_delay': 50,
	'css' : {
		'outer': ['m0l0oout', 'm0l0oover'],
		'inner': ['m0l0iout', 'm0l0iover']
	}
},
{
	'height': 20,
	'width': 170,
	'block_top': 39,
	'block_left': 0,
	'top': 21,
	'left': 0,
	'css': {
		'outer' : ['m0l1oout', 'm0l1oover'],
		'inner' : ['m0l1iout', 'm0l1iover']
	}
},
{
	'block_top': 5,
	'block_left': 170,
	'css': {
		'outer': ['m0l2oout', 'm0l2oover'],
		'inner': ['m0l1iout', 'm0l2iover']
	}
}
]

// ff inaczej obsluguje szerokosc elementow w menu, jesli nie odejmiemy tych 5 jednostek
// elementy beda za szerokie w ff (bedzie to widac tylko na ostatnim el. menu, bo pozostale przykrywaja to, co wystaje
if (!MSIE)
	MENU_POS[0]["width"]-=5;
	


