function setHeaderHeight()
{
	var header = header || document.getElementById('header');
	var holder = holder || document.getElementById('holder');
	setTimeout (function(){holder.style.height = header.offsetHeight;}, 10);
}

function setThumbHeight()
{
	var thumb = thumb || document.getElementById('thumb');
	thumb.descrs = thumb.getElementsByTagName('p');
	var w = 0;
	for (var q = 0, l = thumb.descrs.length; q < l; q++)
	{
		if (thumb.descrs[q].offsetHeight > w) w = thumb.descrs[q].offsetHeight;
	}
	document.write('<style>#thumb SPAN {margin-bottom: ' + (w+30) + 'px;}</style>');
}


var mmCurr = null;
function drr(target)	
{
	if (target == mmCurr) return;
	
	if (mmCurr != null) mmCurr.className = '';

// ajax request
//	if (!target.onLoad) getContent(target.getAttribute('id'));

//	var _ = document.getElementById('tab');
	var cont = common || document.getElementById('common');
	
//	Change.x(_, target.offsetLeft, .1, true, function() {});
//	Change.width(_, target.offsetWidth, .1, true, function() {});
	
	var contItem = document.getElementById('h'+target.getAttribute('id')).offsetLeft*-1;
	
	Change.x(cont, contItem, .3, true, function() {});
	
	mmCurr = target;
	mmCurr.className = 'sel';
}

window.onresize = function()
{
	if (mmCurr != null && mmCurr.getAttribute('id') != 'logo')
		document.getElementById('common').style.left = document.getElementById('h'+mmCurr.getAttribute('id')).offsetLeft*-1;
}

var Change = {
	'width': function(item, finalDestination, speed, stopping, postAction) {
		stopping = (stopping) ? true : false;
		item.changeWidthObj = this._createParams(finalDestination, speed, stopping, postAction);
		if (item.isChangingWidth) {
			clearInterval(item._chW);
			item.isChangingWidth = false;
		}
		item.isChangingWidth = false;
		item._chW = setInterval(function() {Change._width(item)}, 1);
	},
	'height': function(item, finalDestination, speed, stopping, postAction) {
		stopping = (stopping) ? true : false;
		item.changeHeightObj = this._createParams(finalDestination, speed, stopping, postAction);
		if (item.isChangingHeight) {
			clearInterval(item._chH);
			item.isChangingHeight = false;
		}
		item.isChangingHeight = false;
		item._chH = setInterval(function() {Change._height(item)}, 1);
	},
	'x': function(item, finalDestination, speed, stopping, postAction) {
		stopping = (stopping) ? true : false;
		item.changeXObj = this._createParams(finalDestination, speed, stopping, postAction);
		if (item.isChangingX) {
			clearInterval(item._chX);
			item.isChangingX = false;
		}
		item.isChangingX = false;
		item._chX = setInterval(function() {Change._x(item)}, 1);
	},
	'y': function(item, finalDestination, speed, stopping, postAction) {
		stopping = (stopping) ? true : false;
		item.changeYObj = this._createParams(finalDestination, speed, stopping, postAction);
		if (item.isChangingY) {
			clearInterval(item._chY);
			item.isChangingY = false;
		}
		item.isChangingY = false;
		item._chY = setInterval(function() {Change._y(item)}, 1);
	},
	'opacity': function(item, finalDestination, speed, stopping, postAction) {
		stopping = (stopping) ? true : false;
		item.changeOpacityObj = this._createParams(finalDestination, speed, stopping, postAction);
		if (item.isChangingOpacity) {
			clearInterval(item._chOpacity);
			item.isChangingOpacity = false;
		}
		item.isChangingOpacity = false;
		item._chOpacity = setInterval(function() {Change._opacity(item)}, 1);
	},

	_width: function(item) {
		item.isChangingWidth = true;
		var params = item.changeWidthObj;
		var _ = parseInt(item.style.width) || null;
		_ = this._do(item, _, params.finalDestination, params.speed, params.postAction);
		if (_) item.style.width = _ + "px";
		else if (params.stopping) {
			clearInterval(item._chW);
			item.isChangingWidth = false;
		}
	},
	_height: function(item) {
		item.isChangingHeight = true;
		var params = item.changeHeightObj;
		var _ = parseInt(item.style.height) || null;
		_ = this._do(item, _, params.finalDestination, params.speed, params.postAction);
		if (_) item.style.height = _ + "px";
		else if (params.stopping) {
			clearInterval(item._chH);
			item.isChangingHeight = false;
		}
	},
	_x: function(item) {
		item.isChangingX = true;
		var params = item.changeXObj;
		var _ = parseInt(item.style.left) || null;
		_ = this._do(item, _, params.finalDestination, params.speed, params.postAction);
		if (_) item.style.left = _ + "px";
		else if (params.stopping) {
			clearInterval(item._chX);
			item.isChangingX = false;
		}
	},
	_y: function(item) {
		item.isChangingY = true;
		var params = item.changeYObj;
		var _ = parseInt(item.style.top) || null;
		_ = this._do(item, _, params.finalDestination, params.speed, params.postAction);
		if (_) item.style.top = _ + "px";
		else if (params.stopping) {
			clearInterval(item._chY);
			item.isChangingY = false;
		}
	},
	_opacity: function(item) {
		item.isChangingOpacity = true;
		var params = item.changeOpacityObj;
		var _ = item.opacity || ((item.opacity == 0) ? 0 : 1);
		_ = this._do(item, _*100, params.finalDestination, params.speed, params.postAction);
		if (_) setOpacity(item, _/100);
		else if (params.stopping) {
			clearInterval(item._chOpacity);
			item.isChangingOpacity = false;
		}
	},
	
	_do: function(item, param, finalDestination, speed, postAction) {
		if (finalDestination.constructor == Function) finalDestination = finalDestination();
		speed = speed || .1;
		var D;
		if (finalDestination != param) {
			D = speed * (finalDestination - param);
			D = (D > 0) ? Math.ceil(D) : Math.floor(D);
			param += D;
			return param;
		} else {
			if (postAction) {postAction();}
			return null;
		}
	},
	_createParams: function(finalDestination, speed, stopping, postAction) {
		return {finalDestination: finalDestination, speed: speed, stopping: stopping, postAction: postAction}
	}
}


setOpacity = function(elem, value) {
	if(elem.runtimeStyle) {
		if(value == 1) elem.style.opacity = elem.style.filter = '';
		else elem.style.filter = elem.style.filter.replace(/alpha\([^)]*\)/,"") + "alpha(opacity=" + value * 100 + ")";
	}
	else {
		if(value == 1) elem.style.opacity = '';
		else elem.style.opacity = value;
	}
	elem.opacity = value;
}
getOpacity = function(elem) {
	return elem.opacity;
}