function start_home() {
	
	var botoes = document.getElementById("menu_home").getElementsByTagName('IMG');
	
	for(i=0;i<botoes.length;i++) {
		botoes[i].onmouseover = function() {
			this.src = String(this.src).replace('b_','bon_');
		}
		botoes[i].onmouseout = function() {
			this.src = String(this.src).replace('bon_','b_');
		}
		
		if(botoes[i].alt != "imagens") {		
			botoes[i].onclick = function() {
				document.location = this.alt + '.asp';	
			}
		}else {
			botoes[i].onclick = function() {
				window.open(this.alt + '.asp');		
			}	
		}		
		
		botoes[i].title = "";
		botoes[i].style.cursor = "pointer";	
		
	}
}

function $id(str) {
	return document.getElementById(str)	
}

function load_imgs() {
	var comb1 = [ 
		["1/1_1.jpg", ""],
		["2/2_1.jpg", "Oficina \"Casa dos Sentidos\" /2008"],
		["4/4_1.jpg", "Oficina de Moda - Jun Nakao /2006"],
		["5/5_1.jpg", ""],
		["6/6_1.jpg", "Oficina \"Casa dos Sentidos\" /2008"],
		["7/7_1.jpg", ""]
	]
		
	var comb2 = [
		["1/1_2.jpg", ""],
		["2/2_2.jpg", "Oficina de pintura /2008"],
		["4/4_2.jpg", "Figurino - \"Bailado do Deus Morto\" /2004"],
		["5/5_2.jpg", ""],
		["6/6_2.jpg", "Instalação \"Casa da árvore\" /2008"],
		["7/7_2.jpg", ""]		
	]
		
	var comb3 = [
		["1/1_3.jpg", ""],
		["2/2_3.jpg", "Represa Jaguari-Jacareí"],
		["4/4_3.jpg", "Instalação /2004"],
		["5/5_3.jpg", ""],
		["6/6_3.jpg", "Oficina de moda /2005"],
		["7/7_3.jpg", ""]		
	]
		
	var comb4 = [
		["1/1_4.jpg", ""],
		["2/2_4.jpg", "Instalação - O Grande Labirinto"],
		["4/4_4.jpg", "\"Bailado do Deus Morto\" /2004"],
		["5/5_4.jpg", ""],
		["6/6_4.jpg", "\"A Canção de Baal\" /2006"],
		["7/7_4.jpg", ""]		
	]
		
		//var writ = comb1
			
		var rand = Math.ceil(Math.random()*4)
		
		if(rand <1 || rand > 4) {
			rand = 1
		}
		
		var writ = eval("comb"+rand)
		//var writ = comb2;
			
		$id('slot1').firstChild.src = '_imgs/' + writ[0][0]
		$id('slot2').firstChild.src = '_imgs/' + writ[1][0]
		$id('slot4').firstChild.src = '_imgs/' + writ[2][0]
		$id('slot5').firstChild.src = '_imgs/' + writ[3][0]
		$id('slot6').firstChild.src = '_imgs/' + writ[4][0]
		$id('slot7').firstChild.src = '_imgs/' + writ[5][0]
			
		$id('slot1').childNodes[2].firstChild.nodeValue = writ[0][1]
		$id('slot2').childNodes[2].firstChild.nodeValue = writ[1][1]
		$id('slot4').childNodes[2].firstChild.nodeValue = writ[2][1]
		$id('slot5').childNodes[2].firstChild.nodeValue = writ[3][1]
		$id('slot6').childNodes[2].firstChild.nodeValue = writ[4][1]
		$id('slot7').childNodes[2].firstChild.nodeValue = writ[5][1]	
}



function preload_home() {
	var l = new Array('bon_01','bon_02','bon_03','bon_04','bon_05','bon_06','bon_07','bon_08','bon_09','bon_10','bon_11','bon_12','bon_13')
	
	for(i=0;i<l.length;i++) {
		prel = new Image()
		prel.src = "_imgs/" + l[i] + ".gif"
		eval("var foto" + i + " = new Image()")
		eval("foto" + i + ".src = '_imgs/" + l[i] + ".gif'")
	}	
}

function preload_int() {
	var l = new Array('binteron_01','bbinteron_02','binteron_03','binteron_04','binteron_05','binteron_06','binteron_07','binteron_08','binteron_09','binteron_10','binteron_11','binteron_12','binteron_13')
	
	for(i=0;i<l.length;i++) {
		prel = new Image()
		prel.src = "_imgs/" + l[i] + ".gif"
		eval("var foto" + i + " = new Image()")
		eval("foto" + i + ".src = '_imgs/" + l[i] + ".gif'")
	}	
}

function start_int(sessao) {

	var botoes = document.getElementById("menu_home").getElementsByTagName('IMG');
	
	
	
	for(i=0;i<botoes.length-1;i++) {
		
		if(botoes[i].alt == sessao) {
			botoes[i].src = String(botoes[i].src).replace('binter','binteron');
		}else{
		
			botoes[i].onmouseover = function() {
				this.src = String(this.src).replace('binter','binteron');
			}
			botoes[i].onmouseout = function() {
				this.src = String(this.src).replace('binteron','binter');
			}
			
			if(botoes[i].alt != "imagens") {		
				botoes[i].onclick = function() {
					document.location = this.alt + '.asp';	
				}
			}else{
				botoes[i].onclick = function() {
					window.open(this.alt + '.asp');		
				}	
			}
					
			botoes[i].title = "";
			botoes[i].style.cursor = "pointer";	
		}	
	}	
}

function start_over(_id) {
	var botoes = document.getElementById(_id).getElementsByTagName('IMG');
	
	for(i=0;i<botoes.length;i++) {
		botoes[i].onmouseover = function() {
			this.src = String(this.src).replace('binter','binteron');
		}
		botoes[i].onmouseout = function() {
			this.src = String(this.src).replace('binteron','binter');
		}
		/*botoes[i].onclick = function() {
			document.location = this.alt + '.html';	
		}*/
		botoes[i].title = "";
		botoes[i].style.cursor = "pointer";	
		
	}
}

function mostra_legendas(_div) {
	var bg = _div.childNodes[1]
	var cont = _div.childNodes[2]
		
	bg.style.visibility = 'visible'
	cont.style.visibility = 'visible'
}

function oculta_legendas(_div) {
	var bg = _div.childNodes[1]
	var cont = _div.childNodes[2]
		
	bg.style.visibility = 'hidden'
	cont.style.visibility = 'hidden'
}