function CreateMessageDivs()
{
	this.msgDiv = function(lastNr,zIndex,isTabBar)
	{
		var msgDiv = document.createElement("div");
		msgDiv.id = "msgDiv" + lastNr;
		msgDiv.className = "msgDiv";
		if (zIndex)
		{
			msgDiv.style.zIndex = zIndex;
		}
		//msgDiv.setAttribute("onfocus", "Msg.restore(" + lastNr + ");");
		
		var table = document.createElement("table");
		table.setAttribute("cellpadding", "0");
		table.setAttribute("cellspacing", "0");
		table.style.width = "100%";
		
		var titleTd = document.createElement("td")
		titleTd.id = "msgDivTitleText" + lastNr;
		titleTd.className = "msgDivTitleText";
		titleTd.setAttribute("onmousedown", "Msg.Action.startDrag(" + lastNr + ");")
		titleTd.setAttribute("onmouseup", "Msg.Action.stopDrag(" + lastNr + ","+zIndex+");");
		
		
		var actionsTd = document.createElement("td");
		actionsTd.id = "msgDivCloseTd" + lastNr;
		actionsTd.className = "msgDivActionsTd";
		actionsTd.setAttribute("onclick", "Msg.hide('" + "msgDiv" + lastNr + "');");
		
		var spaceTxt = document.createTextNode(" ");
		
		if (isTabBar == true)
		{
			var minimizeImg = document.createElement("img");
			minimizeImg.src = "Cubik/CMS/gfx/graphics/minimize.gif";
			minimizeImg.alt = "Minmize";
			minimizeImg.setAttribute("onclick", "Msg.Action.miniMize(" + lastNr + ");");
			actionsTd.appendChild(minimizeImg);
		}
		
		actionsTd.appendChild(spaceTxt);
		
		var closeImg = document.createElement("img");
		closeImg.src = "Cubik/CMS/gfx/graphics/close2.gif";
		closeImg.alt = "Close";
		//closeImg.setAttribute("onclick", "Msg.hide('" + "msgDiv" + lastNr + "');");
		actionsTd.appendChild(closeImg);
		
		
		
		var tr = document.createElement("tr");
		tr.appendChild(titleTd);
		tr.appendChild(actionsTd);
		
		var tbody = document.createElement("tbody");
		
		tbody.appendChild(tr);
		table.appendChild(tbody);
		msgDiv.appendChild(table);
		
		
		var sourceDiv = document.createElement("div");
		sourceDiv.id = "msgDivSource" + lastNr;
		sourceDiv.className = "msgDivSource";
		
		msgDiv.appendChild(sourceDiv);
		
		
		this.assignElementToBody(msgDiv);
		/*
		 * For fucking ie must to this
		 */
		msgDiv.innerHTML = msgDiv.innerHTML;
	}
	
	this.transparentDiv = function(zIndex)
	{
		if (!$("transparentContentDiv")) 
		{
			var transparentDiv = document.createElement("div");
			transparentDiv.id = "transparentContentDiv";
			if (zIndex)
			{
				transparentDiv.style.zIndex = zIndex;				
			}
			var windowSize = getWindowSize();
			transparentDiv.style.height = windowSize[1];
			this.assignElementToBody(transparentDiv);
		}
	}
	
	this.tabBar = function()
	{
		if (!$("tabBar")) 
		{
			var tabBarDiv = document.createElement("div");
			tabBarDiv.id = "tabBar";
			this.assignElementToBody(tabBarDiv);
		}
	}
	
	this.loadingDiv = function(zIndex,returnHtml,smallLoading)
	{
		var div = document.createElement("div");
		div.id = "LoadingContainerDiv";
		if (zIndex)
		{
			div.style.zIndex = zIndex;				
		}
		
		var titleDiv = document.createElement("div");
		titleDiv.id = "loadingTitle";
		titleDiv.appendChild(document.createTextNode("&nbsp;"));
		div.appendChild(titleDiv);
		
		var loadingDiv = document.createElement("div");
		loadingDiv.style.textAlign = "center";
		var img = document.createElement("img");
		img.setAttribute("onclick", "Msg.hideLoad()");
		if (smallLoading == true)
		{
			var picName = "smallLoading";
		}
		else
		{
			var picName = "bigLoading";
		}
		img.src = "Cubik/CMS/gfx/graphics/"+picName+".gif";
		img.alt = "";
		loadingDiv.appendChild(img);
		div.appendChild(loadingDiv);
		
		if (returnHtml == true)
		{
			div.style.visibility = "visible";
			var returnDiv = document.createElement("div");
			returnDiv.style.width = "100%";
			returnDiv.style.height = "100%";
			returnDiv.appendChild(div);
			alert(returnDiv.innerHTML);
			return returnDiv.innerHTML;
		}
		else
		{
			this.assignElementToBody(div);
		}
	}
	
	this.assignElementToBody = function(element)
	{
		$("MessageDiv").appendChild(element);
	}
}

function MessageActions()
{
	this.tragableItem;
	this.startDrag = function(nr)
	{
		var id = "msgDiv"+nr;
		var sourceID = "msgDivSource"+nr;
		$(sourceID).style.visibility = "hidden";
		var tragableItem = new Draggable(id, 
		{
			revert: false,
			starteffect : false,
			endeffect : function()
			{
				tragableItem.destroy();
			},
			onEnd : function()
			{
				tragableItem.destroy();
			}
		});
	}
	
	this.stopDrag = function(nr,zIndex)
	{
		var msgDivID = "msgDiv"+nr;
		var sourceID = "msgDivSource"+nr;
		$(sourceID).style.visibility = "";
		if (this.tragableItem) 
		{
			//setTimeout("Msg.tragableItem.destroy();", 20);
			Msg.Action.tragableItem.destroy();
		}
		/*
		 * See siin on see et ei saaks vasakust ega paremast ??rest ?le minna
		var id = "msgDiv"+nr
		 var div = $(id);
		 var leftWidth = div.offsetLeft + div.offsetWidth;
		 var bodySize = getBodySize();
		 if (leftWidth > bodySize[0])
		 {
			 $(id).style.left = '0px';
		 }
		 if (div.offsetLeft < 0)
		 {
		 	$(id).style.left = '0px';
		 }
		 $(msgDivID).style.zIndex = zIndex;
		 */
	}
	
	this.miniMize = function(nr)
	{
		$("msgDiv"+nr).style.display = "none";
		$("tabBarItem"+nr).style.background = "url('Cubik/CMS/gfx/graphics/tabbarInActive.png')";
		
	}
	this.restore = function(nr)
	{
		$("msgDiv"+nr).style.display = "";
		$("tabBarItem"+nr).style.background = "url('Cubik/CMS/gfx/graphics/tabbarActive.png')";
	}
	
	this.bringoToFront = function(nr)
	{
		$("msgDiv"+nr).style.display = "";
		$("tabBarItem"+nr).style.background = "url('Cubik/CMS/gfx/graphics/tabbarActive.png')";
	}
}

var Msg = new function()
{
	this.title = "";
	this.width = 0;
	this.height = 0;
	this.textAlign = "";
	this.hideLoading = false;
	this.count = 0;
	this.lastID = false;
	this.lastNr = 0;
	this.loadingIsActivated = false;
	this.showTransparentDiv = true;
	this.hideTransparentDivOnHideLoad = false;
	this.transParentDivZIndex = 900;
	this.displayedMessages = new Array();
	this.msgDivParametersTMP = new Array();
	this.showTabbar = false;
	//kas lisame eelmise pop div sisu juurde
	this.updateLastMsgDivContent = false;
	/*
	 * Kui kuvatav Div on tulnud vormi validatsioonist, ehk siis error div. 
	 */
	this.isErrorDiv = false;
	this.Create = new CreateMessageDivs();
	this.Action = new MessageActions();
	
	this.message = function()
	{
		this.preloadImages();
	}
	
	this.set = function(title, width, hideLoad,addToSource)
	{
		this.title = title;
		if (width == true) 
		{
			width = 0;
		}
		if (width == false) 
		{
			width = 0;
		}
		this.width = width;
		if (addToSource == true && this.lastNr > 0)
		{
			this.updateLastMsgDivContent = true;
		}
		this.hideLoading = hideLoad;
	}
	
	this.win = function(source, title)
	{
		Msg.showTabbar = true;
		Msg.showTransparentDiv = false;
		Msg.hideTransparentDivOnHideLoad = true;
		this.pop(source, title);
	}
	this.pop = function(source, title, divWidth, addToSource, screenHeight, onCloseReloadWindow, textAlign)
	{
		if (this.updateLastMsgDivContent == false)
		{
			this.lastNr++;
			if (this.showTransparentDiv == true) 
			{
				this.Create.transparentDiv();
			}
			this.Create.msgDiv(this.lastNr,(this.transParentDivZIndex+this.lastNr),this.showTabbar);
		}
		else
		{
			this.updateLastMsgDivContent = false;
		}

		
		if (this.hideLoading == true) 
		{
			this.hideLoad();
			this.hideLoading = false;
		}
		if (this.showTabbar == true) 
		{
			this.Create.tabBar();
			this.resetTabBar();
		}
		
		
		this.fillMessage(source, title,addToSource);
		if(!divWidth)
		{
			divWidth = "auto";
		}
		this.setParams(divWidth, textAlign, screenHeight);
		
		if (onCloseReloadWindow) 
		{
			$('a.close' + this.lastNr).setAttribute('onclick', 'window.location.reload();')
		}
		
		
		
		divID = 'msgDiv' + this.lastNr;
		this.lastID = divID;
		
		if (this.loadingIsActivated == true) 
		{
			this.hideLoad();
		}
		this.popUpDiv(divID);
		this.setDisplayedMessages();
		
		if (this.showTabbar == true) 
		{
			this.setTabBarItems();
		}
		this.setMsgDivDimensions(this.lastNr,this.showTabbar);
		
		/*
		 * Kui on error div siis saadame �lej��nud div transparent div taha
		 */
		if (this.isErrorDiv == true)
		{
			this.sendMsgDivsBehindTransparentDiv();
		}
		
		
		//Null some values
		this.showTabbar = false;
		this.showTransparentDiv = true;
		this.sendAllMsgToBack = false;
	}
	
	/**
	 * Saadame k�ik div transparent div taha.
	 */
	this.sendMsgDivsBehindTransparentDiv = function(sendToBack)
	{
		var nr;
		if (this.displayedMessages.length > 1)
		{
			for (i = 0; i < (this.displayedMessages.length-1); i++)
			{
				nr = this.displayedMessages[i];
				$('msgDiv'+nr).style.zIndex = this.transParentDivZIndex-10;
			}
		}
	}
	
	this.setTabBarItems = function()
	{
		if (this.displayedMessages.length > 0) 
		{
			var html = '<table cellpadding="0" cellspacing="0" border="0" style="width:100%"><tr>';
			for (i = 0; i < this.displayedMessages.length; i++) 
			{
				var divID = "msgDivTitleText" + this.displayedMessages[i];
				if ($('msgDiv'+this.displayedMessages[i]).style.display == "none")
				{
					img = "tabbarInActive"
				}
				else
				{
					img = "tabbarActive"
				}
				html += '<td onclick="Msg.Action.restore('+this.displayedMessages[i]+')" id="tabBarItem'+this.displayedMessages[i]+'" class="tabBarTd" style="background:  url(\'Cubik/CMS/gfx/graphics/'+img+'.png\');" >' + $(divID).innerHTML + '</td>';
			}
			html += '<td colspan="' + this.displayedMessages.length + '">&nbsp;</td>';
			html += '</tr></table>';
			$('tabBar').innerHTML = html;
		}
	}
	
	this.doNiceForm = function()
	{
		divID = 'msgDiv' + this.lastNr;
		//NiceForm.doNice(divID);
	}
	
	this.setDisplayedMessages = function()
	{
		var nr = this.lastNr;
		this.displayedMessages.push(nr);
		var newItems = new Array();
		c = 0;
		for (i = 0; i < this.displayedMessages.length; i++) 
		{
			if ($('msgDiv' + this.displayedMessages[i])) 
			{
				newItems[c] = this.displayedMessages[i];
				c++;
			}
		}
		this.displayedMessages = newItems;
	}
	
	this.fillMessage = function(source, title)
	{
		if (this.title && this.title.length > 0) 
		{
			title = this.title;
			this.title = "";
		}
		if (title && title.length < 1) 
		{
			title = "&nbsp;"
		}
		if (title == "undefined") 
		{
			title = "&nbsp;"
		}
		$('msgDivTitleText' + this.lastNr).innerHTML = title;
		$('msgDivSource' + this.lastNr).innerHTML = source;
	}
	
	this.setParams = function(width, textAlign, screenHeight)
	{
		var msgDivID = "msgDiv" + this.lastNr;
		var msgSourceDivID = "msgDivSource" + this.lastNr;
		var msgTitleDivID = "msgDivTitleText" + this.lastNr;
		
		if (textAlign && textAlign.length > 0) 
		{
			$('msgDivSource' + this.lastNr).style.textAlign = textAlign;
		}
		if (!this.width)
		{
			var tmpGWidth = width;
		}
		else
		{
			var tmpGWidth = this.width;
		}
		if (tmpGWidth) 
		{
			var tmpWidth = tmpGWidth.toString();
			if (tmpWidth == "auto")
			{
				width = "auto";
			} 
			else if (tmpWidth.indexOf("%") > 0)
			{
				width = tmpWidth;
			}
			else
			{
				width = tmpWidth;
			}
		}
		else 
		{
			if (tmpGWidth > 0) 
			{
				width = tmpGWidth;
				this.width = 0;
			}
		}
		
		if (this.height <= 0) 
		{
			if ($(msgSourceDivID).offsetHeight > 680) 
			{
				if (screenHeight) 
				{
					$(msgSourceDivID).style.height = $('transparentContentDiv').offsetHeight - 55 + 'px';
				}
				else 
				{
					$(msgSourceDivID).style.height = '680px';
				}
				$(msgSourceDivID).style.overflow = 'auto';
			}
		}
		else 
		{
			var tmpHeight = this.height.toString(); 
			if (tmpHeight.indexOf("%") > 0) 
			{
				$(msgDivID).style.height = this.height;
			}
			else
			{
				$(msgDivID).style.height = this.height+'px';
			}
		}

		
		
		var minusExtra = 0;
		if (width != 'undefined') 
		{
			var tmpWidth = width.toString();
			if (tmpWidth.indexOf("%") > 0)
			{
				/*
				var bodySize = getBodySize();
				W = tmpWidth.substring(0,(tmpWidth.length-1));
				$(msgDivID).style.width = ((W * bodySize[0])/ 100 )+'px';
				*/
				$(msgDivID).style.width = tmpWidth;
			}
			else if (width == "auto") 
			{
				width = $('msgDivSource' + this.lastNr).offsetWidth;
				//$(msgDivID).style.width = (eval(width) + 20) + 'px';
				$(msgDivID).style.width = 'auto';
			}
			else
			{
				$(msgDivID).style.width = (eval(width) + 20) + 'px';
			}
		}
		else 
		{
			$(msgDivID).style.width = '970px';
		}
		this.width = 0;
		this.height = 0;
	}
	
	this.setMsgDivDimensions = function(nr,showTabbar,lastScreenSize)
	{
		var msgDivID = "msgDiv"+nr;
		var msgSourceDivID = "msgDivSource"+nr;
		var msgTitleDivID = "msgDivTitleText"+nr;
		
		if (showTabbar == true)
		{
			if ($("systemMenu")) 
			{
				$(divID).style.top = $("systemMenu").offsetHeight+'px';
			}
			$(divID).style.top = $("systemMenu").offsetHeight+'px';

			var msgDivTmpHeight = $(msgDivID).offsetHeight;
			//Msg div and tabbbar border
			var borderWidth = 4;
			if ($("tabBar"))
			{
				msgDivTmpHeight = $("tabBar").offsetTop - borderWidth;
				if ($("systemMenu"))
				{
					msgDivTmpHeight -= $("systemMenu").offsetHeight;
				}
			}
			$(msgDivID).style.height = msgDivTmpHeight+'px';
			
			//M��rame soruce div suuruse
			$(msgSourceDivID).style.margin = "0px;";
			$(msgSourceDivID).style.height = $(msgDivID).offsetHeight - $(msgTitleDivID).offsetHeight -borderWidth + 'px';
			
			if (this.msgDivParametersTMP[nr]["offsetWidth"])
			{
				alert(this.msgDivParametersTMP[nr]["offsetWidth"]);
			}
			
			this.msgDivParametersTMP[nr] = new Array();
			this.msgDivParametersTMP[nr]["offsetWidth"] = $(msgDivID).style.width;
			
			
			var bodySize = getBodySize();
			$(msgDivID).style.width = $(msgDivID).offsetWidth - (borderWidth*2)+'px';
		}
	}
	
	this.hide = function(id, dontHideTransparentDiv)
	{
		if (this.displayedMessages.length > 0) 
		{
			if (!id) 
			{
				id = "msgDiv" + this.lastNr;
			}
			removeElement(id);
			if (this.lastNr == 1 && dontHideTransparentDiv != true) 
			{
				if ($("transparentContentDiv")) 
				{
					removeElement("transparentContentDiv");
				}
				if ($('tabBar'))
				{
					removeElement("tabBar");					
				}
				window.onresize = "";
			}
			this.lastNr--;
			this.setDisplayedMessages();
			this.bringMsgsToFront();
			if ($('tabBar'))
			{
				this.resetTabBar();
				this.setTabBarItems();
			}
		}
		return false;
	}
	
	this.showLoad = function(title)
	{
		this.loadingIsActivated = true;
		if ($("transparentContentDiv"))
		{
			$("transparentContentDiv").style.zIndex = 998;
		}
		else
		{
			this.Create.transparentDiv(999);			
		}
		this.resetTabBar();
		this.Create.loadingDiv(999,false,this.isLoadingPicSmall);
		if (title) 
		{
			$('loadingTitle').innerHTML = title;
			$('loadingTitle').style.display = 'inline';
		}
		else 
		{
			$('loadingTitle').innerHTML = '&nbsp;';
			$('loadingTitle').style.display = 'none';
		}
		
		this.popUpDiv('LoadingContainerDiv');
	}
	
	/**
	 * N�itame laadismist mingi elemendi sees
	 * @param {Object} title
	 * @param {Object} intoElement
	 */
	this.isLoadingPicSmall = false;
	this.showLoadIntoElement = function(title,intoElementID)
	{
		this.loadingIsActivated = true;
		this.Create.transparentDiv(999);
		$('transparentContentDiv').style.position = "absolute";
		$('transparentContentDiv').style.left = findPosX($(intoElementID))+"px";
		$('transparentContentDiv').style.top = findPosY($(intoElementID))+"px";
		$('transparentContentDiv').style.width = $(intoElementID).offsetWidth+"px";
		$('transparentContentDiv').style.height = $(intoElementID).offsetHeight+"px";
		
		
		this.Create.loadingDiv(999,false,this.isLoadingPicSmall);
		if (title) 
		{
			$('loadingTitle').innerHTML = title;
			$('loadingTitle').style.display = 'inline';
		}
		else 
		{
			$('loadingTitle').innerHTML = '&nbsp;';
			$('loadingTitle').style.display = 'none';
		}
		
		this.popUpDiv('LoadingContainerDiv','transparentContentDiv');
	}
	
	this.getLoading = function()
	{
		return this.Create.loadingDiv(false,true);
	}
	
	this.load = function(title,intoElement,smallLoading)
	{
		if (smallLoading == true)
		{
			this.isLoadingPicSmall = true;
		}
		
		if (intoElement)
		{
			this.showLoadIntoElement(title,intoElement)
		}
		else
		{
			this.showLoad(title)
		}
		this.isLoadingPicSmall = false;
		
	}
	
	this.hideLoad = function()
	{
		this.loadingIsActivated = false;
		removeElement("LoadingContainerDiv");
		if (this.lastNr <= 0 || this.hideTransparentDivOnHideLoad == true) 
		{
			removeElement("transparentContentDiv");
			this.hideTransparentDivOnHideLoad = false;
		}
		if ($("transparentContentDiv"))
		{
			$("transparentContentDiv").style.zIndex = this.transParentDivZIndex;
		}
	}
	
	
	this.bringMsgsToFront = function()
	{
		if (this.displayedMessages.length > 0) 
		{
			var start = this.transParentDivZIndex;
			nr = 1;
			for (i = 0; i < this.displayedMessages.length; i++) 
			{
				start++;
				$("msgDiv" + this.displayedMessages[i]).style.zIndex = start;
				nr++;
			}
		}
	}
	
	this.preloadImages = function()
	{
		var preloads = new Array();
		preloads[1] = new Image();
		preloads[1].src = "Cubik/CMS/gfx/graphics/bigLoading.gif";
		preloads[2] = new Image();
		preloads[2].src = "Cubik/CMS/gfx/graphics/close2.gif";
		preloads[3] = new Image();
		preloads[3].src = "Cubik/CMS/gfx/graphics/minimize.gif";
		preloads[4] = new Image();
		preloads[4].src = "Cubik/CMS/gfx/graphics/tabbarActive.png";
		preloads[5] = new Image();
		preloads[5].src = "Cubik/CMS/gfx/graphics/tabbarInActive.png";
		preloads[6] = new Image();
		preloads[6].src = "Cubik/CMS/gfx/graphics/smallLoading.gif";
		
		
	}
	
	
	
	this.popUpLastDivName = "";
	this.onWindowResize_showTabTab = false;
	this.onWindowResize = function()
	{
		if (Msg.displayedMessages.length > 0) 
		{
			Msg.resetTabBar();
			for (i = 0; i < Msg.displayedMessages.length; i++) 
			{
				Msg.centerDivIntoWindow("msgDiv" + Msg.displayedMessages[i],Msg.displayedMessages[i]);
				Msg.setMsgDivDimensions(Msg.displayedMessages[i],Msg.onWindowResize_showTabTab);
			}
		}
	}
	
	this.popUpDiv = function(div,intoDivID)
	{
		if (div) 
		{
			this.popUpLastDivName = div;
			this.onWindowResize_showTabTab = this.showTabbar;
			window.onresize = Msg.onWindowResize;//Akna suuruse muutumisel tuleb asukoht uuesti arvutada
			if (intoDivID)
			{
				this.centerDivIntoDiv(div,intoDivID)
			}
			else
			{
				this.centerDivIntoWindow(div,this.lastNr)
			}
			
			$(div).style.display = "inline";
			$(div).style.visibility = "visible";
			if (Browser.getVersion() == 6 &&  Browser.get() == "explorer")
			{
				//$(div).style.position = "absolute";
			}
			else
			{
				//$(div).style.position = "fixed";
			}
		}
	}
	
	this.centerDivIntoDiv = function(divID, intoDivID)
	{
		
		var tmpWidth = $(divID).style.width;
		tmpWidth.toString();
		
		var tmpHeight = $(divID).style.height;
		tmpHeight.toString();
		
		var left,top,widthType;
		
		var intoDivWidth = $(intoDivID).offsetWidth;
		var intoDivHeight = $(intoDivID).offsetHeight;

		var W = $(divID).offsetWidth; //Minus right scrollbar width and msgdiv border size
		left = Math.round((intoDivWidth / 2) - (W / 2) + eval(findPosX($(intoDivID))));
		widthType = "px";
		if (left < 0) 
		{
			left = 0;
		}
		$(divID).style.left = left + widthType;
		
		var H = $(divID).offsetHeight;
		top = Math.round((intoDivHeight / 2) - (H / 2) + eval(findPosY($(intoDivID))));
		widthType = "px";
		if (top < 0) 
		{
			top = 0;
		}
		$(divID).style.top = top +"px";
	}
	
	this.centerDivIntoWindow = function(divID, lastNr)
	{
		var tmpWidth = $(divID).style.width;
		tmpWidth.toString();
		
		var tmpHeight = $(divID).style.height;
		tmpHeight.toString();
		
		var windowSize = getBodySize();
		
		
		var left,top,widthType;
		if (tmpWidth.indexOf("%") > 0)
		{
			tmpWidth = tmpWidth.replace("%","");
			left = (100 - tmpWidth) / 2;
			widthType = "%";
		}
		else
		{
			var W = $(divID).offsetWidth - 4; //Minus right scrollbar width and msgdiv border size
			left = Math.round(windowSize[0] / 2) - Math.round(W / 2);
			widthType = "px";
		}
		if (left < 0) 
		{
			left = 0;
		}
		$(divID).style.left = left + widthType;
		
		if (tmpHeight.indexOf("%") > 0)
		{
			tmpWidth = tmpWidth.replace("%","");
			left = (100 - tmpWidth) / 2;
			widthType = "%";
		}
		else
		{
			var H = $(divID).offsetHeight;
			top = Math.round(windowSize[1] / 2) - Math.round(H / 2);
			widthType = "px";
		}
		var scrollXy = getScrollXY();
		top += scrollXy[1];
		if (top < 0) 
		{
			top = 0;
		}
		$(divID).style.top = top + widthType;
	}
	
	this.resetTabBar = function()
	{
		if ($('tabBar')) 
		{
			var xy = getScrollXY();
			var bodySize = getBodySize();
			var scrollBarHeight = getScrollBarSize("x");
			//$('tabBar').style.top = bodySize[1] - xy[1] - scrollBarHeight - $('tabBar').offsetHeight + 'px';
		}
	}
	
	
}

Msg.message();







