﻿$(function(){
	// cache
	jCache.main = $('div#main');
	jCache.top = jCache.main.find('div#top');
	jCache.bottom = jCache.main.find('div#bottom');
	jCache.topLeft = jCache.top.find('div#t_left');
	jCache.topRight = jCache.top.find('div#t_right');
	jCache.topRightTop = jCache.topRight.find('div#t_right_top');
	jCache.bottomLeft = jCache.bottom.find('div#b_left');
	jCache.bottomRight = jCache.bottom.find('div#b_right');
	jCache.logo = jCache.topLeft.find('img');
	jCache.data = jCache.bottomLeft.find('div#data');

	// resize
	var resizeListener = new Object();
	resizeListener.onresize = function(size)
	{
		// main
		jCache.main.width(size.width).height(size.height);
		// level 1
		jCache.top.height(size.marginV + 310);
		jCache.bottom.height(size.height - size.marginV - 310 - 1);
		// level 2
		jCache.topLeft.width(size.marginH + 380);
		jCache.topRight.width(size.width - size.marginH - 380 - 1);
		jCache.bottomLeft.width(size.marginH + 507);
		jCache.bottomRight.width(size.width - size.marginH - 507 - 1);
		// level 3
		jCache.topRightTop.height(size.marginV + 127);
		// logo
		jCache.logo.css('margin-left', size.marginH + 30);
		jCache.logo.css('margin-top', size.marginV + 242);
		jCache.data.css('margin-left', size.marginH + 30);
	};
	resizeManager.addListener(resizeListener);
	resizeListener.onresize(resizeManager.getSize());

	// animation
	//jCache.main.css('opacity', 0.0);
	//jCache.main.animate({'opacity':1.0}, {duration:settings.animSlow, complete:function(){$(this).css('opacity', '')}});
});
