	
/////////////////////////////////////////////////////////////	
	
	var iBgWidth = 1620;
	var iBgPartWidth = iBgWidth / 3;

	var iNegativeMultiplier = 0.11;
	var iMinimumStep = 1;
	
	var iStep;
	var iStepTabPanel;
	
	var iPos = 1;

	var iTimer;
	var iTimerTabPanel;

	var oSlider;
	var oTabPanel;
	
	var oSliderItems;
	var aSliderItems;
	
	var iLeftPosition = 0;
	var iCurrentLeftPosition = 0;
	
	var iLeftPositionTabPanel = 0;
	var iCurrentLeftPositionTabPanel = 0;
	
	
	var iCurrentTabWidth;
	var iNextTabWidth;
	
	function initSlider()
	{
		oSlider = $$('slider-box');
		oSliderItems = $$('slider-items');
		oTabPanel = $$('tab-panel');
		aSliderItems = getElementsByClassName(oSliderItems, 'span', 'buttons');
		
		showContent();
	}
	
	function slideBg(e)
	{
		if (iTimer || iTimerTabPanel) {
			return true;
		}


		var iPrevPos = iPos;
		iPos = getIntegerFromString(this.id);

		if (!arguments.callee.done) { //disable background for first element
			$$('si-' + iPrevPos).parentNode.className = '';
			oTabPanel.style.width = ($$('si-' + iPrevPos).offsetWidth + 32) + 'px';
			oTabPanel.style.height = ($$('si-' + iPos).offsetHeight + 32) + 'px';
		}
		arguments.callee.done = 1;
		
		for (var i = 1; i < iPos; i++) {
			iLeftPositionTabPanel += $$('si-' + i).offsetWidth + 32;	
		}

		iCurrentTabWidth = $$('si-' + iPrevPos).offsetWidth + 32;
		iNextCurrentTabWidth = $$('si-' + iPos).offsetWidth + 32;

		iTimerTabPanel = setInterval(moveTabPanel, 10);

		iLeftPosition = iPos * iBgPartWidth - iBgPartWidth;
		iTimer = setInterval(moveBg, 10);
	}
	
	function moveTabPanel()
	{
		var done;
		
		//////////////////////////
		var i100PC = iLeftPosition <= 0 ? (iBgPartWidth * 2) : iLeftPosition;
		var iRestPC = 100 - Math.floor(Math.abs(iLeftPosition - iCurrentLeftPosition) / Math.abs(i100PC) * 100);
		var iVarianceWidth = (iNextCurrentTabWidth - iCurrentTabWidth) / 100;
		var iGrowthWidth = Math.round(iVarianceWidth * iRestPC);
		var iWidth = iCurrentTabWidth + iGrowthWidth;
		oTabPanel.style.width = iWidth + 'px';
		////////////////////////////

		iStepTabPanel = Math.abs(iLeftPositionTabPanel - iCurrentLeftPositionTabPanel) * iNegativeMultiplier;
		iStepTabPanel = iStepTabPanel < 1 ? 1 : iStepTabPanel;

		if (iLeftPositionTabPanel > iCurrentLeftPositionTabPanel + iStepTabPanel) {
			iCurrentLeftPositionTabPanel += iStepTabPanel;
		} else if (iLeftPositionTabPanel > iCurrentLeftPositionTabPanel) {
			iCurrentLeftPositionTabPanel = iLeftPositionTabPanel;
		} else if (iLeftPositionTabPanel < iCurrentLeftPositionTabPanel - iStepTabPanel) {
			iCurrentLeftPositionTabPanel -= iStepTabPanel;
		} else if (iLeftPositionTabPanel < iCurrentLeftPositionTabPanel) {
			iCurrentLeftPositionTabPanel = iLeftPositionTabPanel;
		} else {
			done = 1;	
		}

		if (!done) {
			oTabPanel.style.left = iCurrentLeftPositionTabPanel + 'px';
		} else {
			oTabPanel.style.width = iNextCurrentTabWidth + 'px';
			tryClearIntervalTabPanel();
		}	
	}
	
	function tryClearIntervalTabPanel()
	{
			clearInterval(iTimerTabPanel);
			iTimerTabPanel = null;
			iStepTabPanel = null;
			iLeftPositionTabPanel = 0;
	}

	function moveBg()
	{
		var done;

		iStep = Math.abs(iLeftPosition - iCurrentLeftPosition) * iNegativeMultiplier;
		iStep = iStep < iMinimumStep ? iMinimumStep : iStep;

		if (iLeftPosition > iCurrentLeftPosition + iStep) {
			iCurrentLeftPosition += iStep;
		} else if (iLeftPosition > iCurrentLeftPosition) {
			iCurrentLeftPosition = iLeftPosition;
		} else if (iLeftPosition < iCurrentLeftPosition - iStep) {
			iCurrentLeftPosition -= iStep;
		} else if (iLeftPosition < iCurrentLeftPosition) {
			iCurrentLeftPosition = iLeftPosition;
		} else {
			done = 1;	
		}

		if (!done) {
			oSlider.style.backgroundPosition = '-' + iCurrentLeftPosition + 'px' + ' top';
		} else {
			showContent();
			tryClearInterval();
		}
	}
	
	function tryClearInterval()
	{
			clearInterval(iTimer);
			iTimer = null;
			iStep = null;
	}
	
	function showContent()
	{
		var aItems = getElementsByClassName(oSliderItems, 'span', 'buttons');
		for (var i = 1; i < aItems.length + 1; i++) {
			var oSI = $$('si-' + i);
			var oSC = $$('sc-' + i);
			var oSubSC = $$('sub-sc-' + i);
			if (i != iPos) {
				oSI.className = 'active buttons';
				oSI.onclick = slideBg;
				oSC.className = 'none container-box';
				if (null != oSubSC) {
					oSubSC.className = 'none';		
				}
			} else if (arguments.callee.done) {
				oSI.className = 'passive buttons';
				oSI.onclick = '';
				oSC.className = 'block container-box';
				if (null != oSubSC) {
					oSubSC.className = '';		
				}
			}
		}
		if (!arguments.callee.done) {
			arguments.callee.done = 1;
		}
	}
	
/////////////////////////////////////////////////////////////
	
	var oMap;
	var iMapPos = 1;
	 
	function initMap()
	{
		oMap = $$('partners-map-container');
		showMap();	
	}

	function showMap()
	{
		var aMaps = getElementsByClassName(oMap, 'table', 'region');
		for (var i = 1; i < aMaps.length + 1; i++) {
			if (i != iMapPos) {
				hideMapOne(i);
			}
		}
	}

	function regionOn()
	{
		var iId = getIntegerFromString(this.id);
		$$('mr-' + iId).className = 'block';
	}
	
	function regionOff()
	{	
		var iId = getIntegerFromString(this.id);
		$$('mr-' + iId).className = 'none';
	}
	
	
	function showSelectedRegion()
	{
		hideMapOne(iMapPos);
		iMapPos = getIntegerFromString(this.id);
		showMapOne(iMapPos);
		return true;
	}

	function showMapOne(id)
	{
		$$('mr-' + id).className = 'block';
		var oMC = $$('mc-' + id);
		var oMP = $$('mp-' + id);
		oMC.className = 'block region';
		oMP.onmouseover = '';
		oMP.onmouseout = '';
	}
	
	function hideMapOne(id)
	{
		$$('mr-' + id).className = 'none';
		var oMC = $$('mc-' + id);
		var oMP = $$('mp-' + id);
		oMC.className = 'none region';
		oMP.onmouseover = regionOn;
		oMP.onmouseout = regionOff;
		oMP.onclick = showSelectedRegion;
		
	}

////////////////////////////////////////////////////////////////

	function structureInit()
	{
		if ($$('slider-box')) {
			initSlider();
			initMap();
		}	
	}
