function MacStyleDock(node, contents, minimumSize, maximumSize, range){
	var generalBlock = $( node ).parent().parent();
	var gHeight = $( generalBlock ).height();
	var gMouseEntered = false;
	var contents = $( contents );
	var gTop = 0;
	var gDirection = 0;
	var childrenNode = $( node ).find( 'img' );
	var childrenLink = $( node ).find( 'a' );
	var childrenNodeClone = new Array();
	var activedImages = new Array();
	
	loadingActivedImages();
	
	var lastMousePosition = { 'x': 0, 'y': 0 };
	var maximumWidth  = 0;
	var scale  = 0;
	
	var lastSRC = '';
	
	var fixingProcedur = false;
	var latestTarget = 0;
	var latestIndex = 0;
	
	var latestIndexContent = 0;
	var latestIndexContentPrev = 0;
	var latestIndexContentChanged = true;
	
	var currentNodeIndex = -1;
	var lastNodeIndex = 0
	var currentIconNode = 0;
	var checkMoving = false;
	
	var closeTimeout  = null;
	var closeInterval = null;
	var openInterval  = null;
	var gCloseInterval = null;
	var gOpenInterval  = null;
	
	var images = [];
	var iconNodes = [];
	var iconSizes = [];
	for (var i = 0; i < childrenNode.length; i++)
	{
		$( childrenNode[i] ).attr( 'rel', i );
		iconNodes[i] = $( childrenNode[i] );
		childrenNodeClone[i] = $( childrenNode[i] ).clone();
		iconSizes[i] = minimumSize;

		updateIconProperties(i);

		$( iconNodes[i] ).mousemove( processMouseMove );
		//$( iconNodes[i] ).mouseleave( processMouseOut );

	}
	
	if( $( childrenLink[0] ).hasClass( 'has_bg' ) )
	{
		$( iconNodes[0] ).css( 'right', '-22px' );
	}
	$( iconNodes[0] ).attr( 'src', $( activedImages[0] ).attr( 'src' ) );
	
	eventNow = { 'target': $( iconNodes[0] ), 'layerY': 30 };
	processMouseMove( eventNow );
	
	function loadingActivedImages()
	{
		$.each( childrenLink,
			function(index, item)
			{
				activedImages[index] = $( '<img alt=""/>' ).attr( 'src', $( item ).attr( 'href' ) );
			}
		);
	}
	
	function updateIconProperties(index)
	{
		var size = minimumSize + scale * (iconSizes[index] - minimumSize);

		//$( iconNodes[index] ).attr('width',  size);
		$( iconNodes[index] ).attr( 'height', size - 20 );
			
		if( !latestIndexContentChanged )
		{
			latestIndexContentChanged = true;
			$( iconNodes[latestIndexContentPrev] ).css( 'right', '0px' );
			//var tempUrl = $( iconNodes[latestIndexContentPrev] ).attr( 'src' );
			$( iconNodes[latestIndexContentPrev] ).attr( 'src', $( childrenNodeClone[latestIndexContentPrev] ).attr( 'src' ) );
			//$( activedImages[latestIndexContentPrev] ).attr( 'src', tempUrl );
			latestIndexContentPrev = latestIndexContent;
		}
		if( latestIndexContent != index )
		{
			if( size == maximumSize )
			{
				if( currentNodeIndex != index )
				{
					
					if( latestIndexContent != currentNodeIndex && currentNodeIndex != -1 )
					{
						$( iconNodes[currentNodeIndex] ).css( 'right', '0px' );
						//lastSRC = $( activedImages[currentNodeIndex] ).attr( 'src' );
						//$( activedImages[currentNodeIndex] ).attr( 'src', $( iconNodes[currentNodeIndex] ).attr( 'src' ) );
						$( iconNodes[currentNodeIndex] ).attr( 'src', $( childrenNodeClone[currentNodeIndex] ).attr( 'src' ) );
						
					}
					currentNodeIndex = index;
					if( $( childrenLink[index] ).hasClass( 'has_bg' ) )
					{
						$( iconNodes[index] ).css( 'right', '-22px' );
					}
					//lastSRC = $( iconNodes[index] ).attr( 'src' );
					$( iconNodes[index] ).attr( 'src', $( activedImages[index] ).attr( 'src' ) );
					//$( activedImages[index] ).attr( 'src', lastSRC );
					
				}
			}
		}
		else
		{
			if( $( childrenLink[latestIndexContent] ).hasClass( 'has_bg' ) )
			{
				$( iconNodes[latestIndexContent] ).css( 'right', - 16 - ( ( size - 70 ) / 20 ) * 6 );
			}
			if( size == maximumSize )
			{
				if( currentNodeIndex != index )
				{
					
					if( latestIndexContent != currentNodeIndex && currentNodeIndex != -1 )
					{
						//lastSRC = $( activedImages[currentNodeIndex] ).attr( 'src' );
						//$( activedImages[currentNodeIndex] ).attr( 'src', $( iconNodes[currentNodeIndex] ).attr( 'src' ) );
						$( iconNodes[currentNodeIndex] ).attr( 'src', $( childrenNodeClone[currentNodeIndex] ).attr( 'src' ) );
						$( iconNodes[currentNodeIndex] ).css( 'right', '0px' );
					}
					currentNodeIndex = -1;
				}
			}
		}
	}
	
	function processMouseMove(e)
	{
		window.clearTimeout(closeTimeout);
		closeTimeout = null;
		window.clearInterval(closeInterval);
		closeInterval = null;

		if (scale != 1 && !openInterval)
		{
			openInterval = window.setInterval(
				function()
				{
					if (scale < 1) scale += 0.125;
					if (scale >= 1)
					{
					  scale = 1;
					  window.clearInterval(openInterval);
					  openInterval = null;
					}
					for (var i = 0; i < iconNodes.length; i++)
					{
					  updateIconProperties(i);
					}
				},
				20
			);
		}
		processCalculatePositions(e);
	}
	
	function processCalculatePositions(e)
	{
		if (!e) e = window.event;
		var target = e.target || e.srcElement;
		var index = parseInt( $( target ).attr( 'rel' ) );
		var across = (e.layerY || e.offsetY) / iconSizes[index];
		if ( across )
		{
			var currentWidth = 0;
			for (var i = 0; i < iconNodes.length; i++)
			{
				if (i < index - range || i > index + range)
				{
					iconSizes[i] = minimumSize;
				}
				else if (i == index)
				{
					iconSizes[i] = maximumSize;
				}
				else if (i < index)
				{
					iconSizes[i] = minimumSize + Math.round( (maximumSize - minimumSize - 1) * ( Math.cos( (i - index - across + 1) / range * Math.PI) + 1) / 2);
					currentWidth += iconSizes[i];
				}
				else
				{
					iconSizes[i] = minimumSize + Math.round((maximumSize - minimumSize - 1) * ( Math.cos( (i - index - across) / range * Math.PI) + 1) / 2);
					currentWidth += iconSizes[i];
				}
			}

			if (currentWidth > maximumWidth) maximumWidth = currentWidth;
			if (index >= range && index < iconSizes.length - range && currentWidth < maximumWidth)
			{
				iconSizes[index - range] += Math.floor((maximumWidth - currentWidth) / 2);
				iconSizes[index + range] += Math.ceil((maximumWidth - currentWidth) / 2);
			}
			for (var i = 0; i < iconNodes.length; i++) updateIconProperties(i);
		}
	}
	
	function processMouseOut(e)
	{
		/*if (!closeTimeout && !closeInterval)
		{
			closeTimeout = window.setTimeout(
				function()
				{
					closeTimeout = null;
					if (openInterval)
					{
						window.clearInterval(openInterval);
						openInterval = null;
					}
					closeInterval = window.setInterval(
						function()
						{
							if (scale > 0) scale -= 0.125;
							if (scale <= 0)
							{
								scale = 0;
								window.clearInterval(closeInterval);
								closeInterval = null;
							}
							for (var i = 0; i < iconNodes.length; i++)
							{
								updateIconProperties(i);
							}
						},
						20
					);
				},
				100
			);  
		}*/
	}
	
	$( generalBlock ).mousemove(
		function( event )
		{
			var across = event.clientY - $( this ).position().top;
			checkMoving = false;
			if( across > ( ( gHeight / 2 ) + 30 ) )
			{
				//if( lastMousePosition.y < across )
				//{
					gDirection = - ( across - ( gHeight / 2 ) - 30 );
					gDirection = gDirection / 30;
					checkMoving = true;
				//}
		
			}

			if( across < ( ( gHeight / 2 ) - 30 ) )
			{
				//if( lastMousePosition.y > across )
				//{
					gDirection = ( gHeight / 2 ) - 30 - across;
					gDirection = gDirection / 30;
					checkMoving = true;
				//}
			}
			lastMousePosition.y = across;
		}
	);
	
	$( generalBlock ).mouseenter(
		function( event )
		{
			gMouseEntered = true;
			window.clearInterval(gOpenInterval);
			gOpenInterval = window.setInterval(
				function()
				{
					if( checkMoving )
					{
						if( iconNodes.length > 4 )
						{
							gTop += gDirection;
						
							if( gTop > 0 )
							{
								gTop = 0;
							}
							if( gTop < ( gHeight - $( node ).height() ) )
							{
								gTop = gHeight - $( node ).height();
							}
						}
						else
						{
							gTop = ( gHeight - $( node ).height() ) / 2;
						}
						$( node ).css( 'top', gTop );
					
						var top = 0;
						var height = 0;
						var currentMouseY = lastMousePosition.y - gTop;
						var currentIndex = 0;
						$.each( iconNodes,
							function( index, item )
							{
								top = $( item ).position().top;
								height = $( item ).height();
								if( currentMouseY >= top && currentMouseY < ( top + height + 20 ) )
								{
									currentIconNode = item;
									currentMouseY = ( height + 20 ) - ( ( top + height + 20 ) - currentMouseY );
								}
							}
						);
						eventNow = { 'target': currentIconNode, 'layerY': currentMouseY };
						processMouseMove( eventNow );
					}
				},
				20
			);
		}
	);
	
	$( generalBlock ).mouseleave(
		function( event )
		{
			if( latestIndexContent != currentNodeIndex && currentNodeIndex != -1 )
			{
				//lastSRC = $( activedImages[currentNodeIndex] ).attr( 'src' );
				//$( activedImages[currentNodeIndex] ).attr( 'src', $( iconNodes[currentNodeIndex] ).attr( 'src' ) );
				$( iconNodes[currentNodeIndex] ).attr( 'src', $( childrenNodeClone[currentNodeIndex] ).attr( 'src' ) );
				$( iconNodes[currentNodeIndex] ).css( 'right', '0px' );
			}
			currentNodeIndex = -1;
			gMouseEntered = false;
			window.clearInterval(gOpenInterval);
		}
	);
	
	$.each( childrenNode,
		function( index, item )
		{
			$( item ).click(
				function( event )
				{
					if( latestIndexContent != index )
					{
						$( contents[ latestIndexContent ] ).fadeOut( 500 );
						$( contents[ index ] ).fadeIn( 500 );
						latestIndexContent = index;
						latestIndexContentChanged = false;
					}
				}
			);
		}
	);
	
}

