function twoColumnLayout() {
}

twoColumnLayout.add = function (item,leftColumn,rightColumn,switchToOneColumn) {
	var currentColumn = twoColumnLayout.getColumn(leftColumn,rightColumn,switchToOneColumn);
	currentColumn.append(item);
	currentColumn.children().last().show();
};

twoColumnLayout.addAd = function (item,leftColumn,rightColumn,switchToOneColumn) {
	var currentColumn = rightColumn;
	if (!rightColumn.is(':visible')) currentColumn = leftColumn;
	if (currentColumn) {
		if (item.hasClass('genBigBox')) item.html(getFramedAd('bigbox_content'));
		if (currentColumn.width() >= 295) currentColumn.append(item);
		currentColumn.children().last().show();
	}
};

twoColumnLayout.addToTop = function (item,leftColumn,rightColumn,switchToOneColumn) {
	var currentColumn = twoColumnLayout.getColumn(leftColumn,rightColumn,switchToOneColumn);
	currentColumn.prepend(item);
	currentColumn.children().first().show();
};

twoColumnLayout.addAdToTop = function (item,leftColumn,rightColumn,switchToOneColumn) {
	var currentColumn = rightColumn;
	if (!rightColumn.is(':visible')) currentColumn = leftColumn;
	if (currentColumn) {
		if (item.hasClass('genBigBox')) item.html(getFramedAd('bigbox_content'));
		if (currentColumn.width() >= 295) currentColumn.prepend(item);
		currentColumn.children().first().show();
	}
};

twoColumnLayout.getColumn = function (leftColumn,rightColumn,switchToOneColumn) {
	if (leftColumn.width() < switchToOneColumn ) {
		rightColumn.hide();
		leftColumn.width('100%');
		return leftColumn;
	}
	if (leftColumn.height() > rightColumn.height() && rightColumn.is(':visible')) {
		return rightColumn;
	}else {
		return leftColumn;
	}
};

twoColumnLayout.getDefaultColumns = function () {
	return "<div class='tcl_left tcl_column'></div><div class='tcl_right tcl_column'></div>";
};