﻿var currentTab

function setFirstTab(){
	if (currentTab == null || currentTab =='') {
		currentTab = 0;
	}
	dTab(currentTab);
}

function dTab(whichTab) {
	oldTab = currentTab;
	currentTab = whichTab;
	for(i=0; i<2; i++){
		theTab = 'dTab' + i;
		theSec = 'sec' + i;
		if(i == whichTab) {
			changeCss(theTab,'active');
		} else {
			changeCss(theTab,'a');
		}
	}
	
	hideElements(contents);
	showElements(contents[whichTab]);
	
	return false;
}

function changeCss(id,style) {
        document.getElementById(id).className = style;
}

function showElements() {
	var a = showElements.arguments;
	for (var i = 0; i < a.length; i ++) {
		if (typeof a[i] == 'string') {
			if (document.getElementById(a[i]) != null) {
				t = document.getElementById(a[i]).tagName;
				d = (t == 'A' || t == 'SPAN' || t == 'IMG') ? 'inline' : 'block';
				document.getElementById(a[i]).style.display = d;
			}
		} else {
			for (var j = 0; j < a[i].length; j ++) {
				showElements(a[i][j]);
			}
		}
	}
}

function hideElements() {
	var a = hideElements.arguments;
	for (var i = 0; i < a.length; i ++) {
		if (typeof a[i] == 'string') {
			if (document.getElementById(a[i]) != null) {
				document.getElementById(a[i]).style.display = "none";
			}
		} else {
			for (var j = 0; j < a[i].length; j ++) {
				hideElements(a[i][j]);
			}
		}
	}
}


var contents = new Array();
contents[1] = new Array('next');
contents[0] = new Array('now');

