/**
 * preference
 */
if ( typeof colors == 'undefined' )
{
	var colors = {
		'taskbar': { 'border': '2px solid black', 'background': '#eee' },
		'startmenu': { 'border': '2px solid black', 'background': 'white' },
		'container': { 'border': '2px solid black', 'background': 'white' },
		'window': {
			'background': 'white',
			'border': '1px solid black',
			'title': 'skyblue',
			'status': 'gray'
		}
	};
}
if ( typeof preference == 'undefined' )
{
	var preference = {
		'container' : { 'styles': {} },
		'window': {
			'size': { 'width': 200, 'height': 200 },
			'styles': {
				'position': 'absolute',
				'left': 100,
				'top': 100,
				'display': 'block',
				'border': colors.window.border,
				'background': colors.window.background
			},
			'title': {
				'styles': { 
					'position': 'relative',
					'display': 'block',
					'height': skins.window.titlebar.left.height,
					'color': 'white',
					'border-bottom': colors.window.border,
					'background': colors.window.title,
					'cursor': 'move'
				}
			},
			'content': {
				'styles': {
					'overflow': 'hidden'
				}
			},
			'status': {
				'styles': {
					'height': skins.window.statusbar.left.height,
					'border-top': colors.window.border,
					'color': 'white',
					'background': colors.window.status
				}
			},
			'buttons': {
				'visible': {
					'display': 'block',
					'float': 'right',
					'margin-top': 5,
					'margin-left': 3,
					'cursor': 'pointer'
				},
				'unvisible': {
					'display': 'none',
					'float': 'right',
					'margin-top': 5,
					'margin-left': 3,
					'cursor': 'pointer'
				}
			}			
		},
		'tools': {
			'taskbar': {
				'height': 24,
				'padding': 2,
				'border': colors.taskbar.border,
				'background': colors.taskbar.background
			},
			'startmenu': {
				'position': 'absolute',
				'z-index': 9999999,
				'width': 200,
				'height': 400,	
				'border': colors.startmenu.border,
				'background': colors.startmenu.background
			}
		},
		'bar': {
			'height': skins.window.titlebar.left.height + skins.window.statusbar.left.height
		},
		'nextPosition' : 50,
		'debug': true
	};
	
	preference.container.styles = { 
		'width': window.getWidth() - ( window.ie ? 17 : 0 ), 
		'height': window.getHeight() - preference.tools.taskbar.height - ( preference.tools.taskbar.padding * 2 ), 
		'border': colors.container.border
	};
}
if ( typeof windows == 'undefined' )
{
	var windows = new Object;
}
if ( typeof windowsIndex == 'undefined' )
{
	var windowsIndex = new Array;
	windowsIndex.push( 'desktop' );
}

/**
 * event
 */
if ( typeof events == 'undefined' )
{
	var events = [];
}

/**
 * 인덱스 페이지 로딩시 데스크탑 레이어를 생성하기 위한 이벤트를 발생시킨다. 
 */

window.addEvent( 'domready', function () {
	
	if ( typeof skins.taskbar != 'undefined' ) { preference.tools.taskbar = skins.taskbar; }

	if ( window.ie6 )
	{
		preference.container.styles = { 
			'width': document.body.clientWidth + 4, 
			'height': document.body.clientHeight - preference.tools.taskbar.height - ( preference.tools.taskbar.padding * 2 ), 
			'border': colors.container.border
		};
    }
});


