/*********************************************************************************************************
								POSITION
*********************************************************************************************************/
	
	POSITION_NAME = "Position";
	POSITION_VERSION = "1.04.0";
	POSITION_AUTHOR = "Бутков Антон";
	POSITION_COMPANY = "AmorPro Development";
	POSITION_CONTACT = "amorpro@mail.ru";
	POSITION_DESCRIPTION =	"Модуль для работы с позиционированием элементов.";
	//Модуль FRAMEWORK
	Uses(typeof(FRAMEWORK_NAME), 'Framework');
	function Uses( type, moduleName ){
		
		if ( type == "undefined" ){
		
			window.alert( "Отсутствует модуль " + moduleName + ". Модуль " + POSITION_NAME + 
				" (" + POSITION_DESCRIPTION + ") " + " не работает." );			
		}
	}
	function SetPosition( id, left, top ){
		SetTop( id, top );
		SetLeft( id, left );
	}
	function SetPositionRightOf(parentId, Id)
	{
		var menuLeft = GetLeft(parentId) + GetWidth(parentId);
		var menuTop = GetTop(parentId);
		SetPosition(Id, menuLeft, menuTop );
	}	
	function SetPositionLeftOf(parentId, Id)
	{
		var menuLeft = GetLeft(parentId) - GetWidth(Id);
		var menuTop = GetTop(parentId);
		SetPosition(Id, menuLeft, menuTop );
	}	
	function SetPositionTopOf(parentId, Id)
	{
		var menuLeft = GetLeft(parentId) ;
		var menuTop = GetTop(parentId) - GetHeight(Id);
		SetPosition(Id, menuLeft, menuTop );
	}	
	function SetPositionBottomOf(parentId, Id)
	{
		var menuLeft = GetLeft(parentId) ;
		var menuTop = GetTop(parentId) + GetHeight(parentId);
		SetPosition(Id, menuLeft, menuTop );
	}	
	function SetLeft( id, left ){
		SetAbsolutePosition( id )	
		Element(id).style.left = left + 'px';
	}
	function SetTop( id, top ){
		SetAbsolutePosition( id )	
		Element( id ).style.top = top + 'px';
	}
	function SetRight( id, right ){
		SetAbsolutePosition( id )	
		Element( id ).style.right = right;
	}	
	function GetLeft( id ){
		return CalcAbsLeft( id );
	}
	function GetTop( id ){
		return CalcAbsTop( id );
	}
	function GetHeight(id){
		return parseInt( Element( id ).offsetHeight );
	}	
	function GetWidth( id ){
		return parseInt( Element( id ).offsetWidth );
	}	
	function SetAbsolutePosition( id ){
		if ( Element( id ).style.position  != "absolute" ){
			Element( id ).style.position  = "absolute";	
		}
	}
	function CalcAbsLeft( id )
	{
	  obj = Element(id);
	  var l = 0 ;
	  for( ; obj != null ; obj = obj.offsetParent ) l += obj.offsetLeft ;
	  return l ;
	}
	function CalcAbsTop(id )
	{
	  obj = Element(id);
	  var l = 0 ;
	  for( ; obj != null ; obj = obj.offsetParent ) l += obj.offsetTop;
	  return l ;
	}
