var curView;
var curTab;

function switchTab(tabID) {
	if (curTabID != tabID) {
		var newTab = document.getElementById("tabContent" + tabID);
		var curTab = document.getElementById("tabContent" + curTabID);
		curTab.style.display = "none";

		newTab.style.display = "block";

                //
                // Change involved class names
                //
                var newHomePageTab = document.getElementById("homePageTabID" + tabID);
                var curHomePageTab = document.getElementById("homePageTabID" + curTabID);
                curHomePageTab.className = 'inactiveHomepageTab' + curTabID;
		curHomePageTab.childNodes[0].className = 'inactiveTabText';
                newHomePageTab.className = 'activeHomepageTab' + tabID;
		newHomePageTab.childNodes[0].className = 'activeTabText';

                curTabID = tabID;
		makeScrollbar( $('tabModuleWrap'), $('rightpane_scroll'), $('rightpane_handle') );
        }
}

function switchView(view) {
	if (view != curView) {
		switchActiveTab(view);
		var newTab = document.getElementById("newsBy" + view);
		var curTab = document.getElementById("newsBy" + curView);
		curTab.style.display = "none";

		newTab.style.display = "block";

		curView = view;
		createCookieLV("curTab", view, 5);
	}
}
		
function switchActiveTab(tab){
        //
        // Change involved class names
        //
        var newHomePageTab = document.getElementById("viewBy" + tab);
        var curHomePageTab = document.getElementById("viewBy" + curTab);
        curHomePageTab.className = 'inactiveViewTab';
	curHomePageTab.getElementsByTagName('a')[0].className = 'inactiveViewText';
        newHomePageTab.className = 'activeViewTab';
	newHomePageTab.getElementsByTagName('a')[0].className = 'activeViewText';

	curTab = tab;
}
