//tab
function tab(divTabBar, divTabContent){
	this.divTabBar = divTabBar
	this.divTabContent = divTabContent
	this.cargado = false
	this.imagenes = new Array()
	
	this.setEnabled = tabSetEnabled
	this.setDisabled = tabSetDisabled
	this.cargarImagenes = tabCargarImagenes
}

function tabSetEnabled(){
	this.divTabBar.className = 'pesActiva'
	this.divTabContent.className = 'tabVisible'
	if(!this.cargado){
		this.cargarImagenes()
		this.cargado = true
	}
}

function tabSetDisabled(){
	this.divTabBar.className = 'pes'
	this.divTabContent.className = 'tabHidden'
}

function tabCargarImagenes(){
	for(i=0; i<this.imagenes.length; i++){
		img = document.getElementById(this.imagenes[i].id)
		if (img != null)
			img.src = this.imagenes[i].src
	}
}


//tabbar
function tabbar(){
	this.tabs = new Array()
	
	this.addTab = tabbarAddTab
	this.changeTab = tabbarChangeTab
}

function tabbarAddTab(tab){
	this.tabs[tabs.length] = tab
}

function tabbarChangeTab(index){
	for(i=0; i<this.tabs.length; i++){
		this.tabs[i].setDisabled()
	}
	
	this.tabs[index].setEnabled()
}

//imagen
function imagen(id, src){
	this.id = id
	this.src = src
}

