/**
 * @author Yuji
 */

/**
 * The initialization procedure
 */
function init( )
{
		createGradient( document.getElementById( "dateGradient" ), "285px" );
		createGradient( document.getElementById( "contactGradient" ), "471px" );
		createGradient( document.getElementById( "menuGradient" ), "170px" );
		createGradient( document.getElementById( "contentGradient" ), "947px" );
		createGradient( document.getElementById( "footbarGradient" ), "947px" );
		setDate( );	
}

/**
 * Create a gradient
 * @param {Object} div Dom object
 * @param {Object} width Desired with of the passed with
 */
function createGradient( div, width )
{
		var newDiv = null;
		var colorValue = 0;
	
		for ( i = 0; i < 20; i++ )
		{
				newDiv = document.createElement( "div" );
				newDiv.setAttribute( "id", "d" + i  );
				colorValue = 235 + i;					
				newDiv.style.backgroundColor = "RGB( " + colorValue + "," + colorValue + "," + colorValue + " )";
				newDiv.style.width = width;
				newDiv.style.height = "1px";
				newDiv.style.position = "relative";
				newDiv.style.zIndex = "0";
				div.appendChild( newDiv );
		}
}

function verticalGradient( div, width )
{
		var newDiv = null;
		var colorValue = 0;
	
		for ( i = 0; i < 20; i++ )
		{
				newDiv = document.createElement( "div" );
				newDiv.setAttribute( "id", "d" + i  );
				colorValue = 235 + i;					
				newDiv.style.backgroundColor = "RGB( " + colorValue + "," + colorValue + "," + colorValue + " )";
				newDiv.style.width = width;
				newDiv.style.height = "1px";
				newDiv.style.position = "relative";
				newDiv.style.zIndex = "0";
				div.appendChild( newDiv );
		}	
}
