// JavaScript Document
function over(id,w){
document.getElementById(id).style.width = w+"px";
}
function out(id,w){
document.getElementById(id).style.width = w+"px";
}


//fucao do alpha
function setOpacity(domId, val) {
	obj = document.getElementById(domId);
	obj.style.MozOpacity = val;
	obj.style.opacity = val/10;
	obj.style.filter = 'alpha(opacity=' + val*10 + ')';
};

function fade(domId){
	obj = document.getElementById(domId); //Get the Element
	//if(obj.style.display == "none") return false; //Return false if the element is already hidden
	var alpha = 0; //Set the initial value of alpha to 10 (Opaque)
	function f(){ //Internal function
		alpha++; //Decrememnt the alpha value
		setOpacity(domId, alpha); //Set the opacity of our element to the specified alpha
		if(alpha < 11){ //If alpha is still bigger than -1 then..
			setTimeout(f, 10); //..then call the function again after 100 milliseconds
		}
	}
	setTimeout(f, 10); //This is where we call the f() function for the first time
};


//fim funcao do alpha


//funcao para esconder ou aparecer menu
function menus(id,elemento,alp){

	if(elemento == "" && alp == ""){
		limpa();
		limpa_alpha();
		exibe(id);
	}else{
		limpa();
		exibe(id);
		exibe(elemento);
		limpa_alpha();
		alpha(alp);
	}

}
//fim funcao para esconder ou aparecer menu

//limpa elementos
function limpa(){
	var e = new Array(17)

	e[0] = "menu_colecoes";
	e[1] = "menu_onde";
	e[2] = "menu_servicos";
	e[3] = "dest_gabriel";
	e[4] = "dest_gabriel2";
	e[5] = "dest_shoppingdd";
	e[6] = "dest_rio_casa_shopping";
	e[7] = "dest_brasilia";
	e[8] = "dest_curitiba";
	e[9] = "sobre_nos";
	e[10] = "dest_lavagem";
	e[11] = "dest_restauro";
	e[12] = "dest_acarpetamento";
	e[13] = "eventos2";
	e[14] = "cadastro";
	e[15] = "contato2";
	e[16] = "arte_na_rua";
		
	for (i=0;i<17;i++){
	document.getElementById(e[i]).style.display = "none";
	}
}
//fim limpa elementos

//exibe
function exibe(id){
	document.getElementById(id).style.display = "block";
}
//exibe

//limpa alpha
function limpa_alpha(){
	
	var o = new Array(13)
	
	o[0] = "sobre_nos";
	o[1] = "dest_gabriel";
	o[2] = "dest_gabriel2";
	o[3] = "dest_shoppingdd";
	o[4] = "dest_rio_casa_shopping";
	o[5] = "dest_brasilia";
	o[6] = "dest_curitiba";
	o[7] = "dest_lavagem";
	o[8] = "dest_restauro";
	o[9] = "dest_acarpetamento";
	o[10] = "eventos2";
	o[11] = "cadastro";
	o[12] = "contato2";

	
	for (i=0;i<13;i++){
	obj = document.getElementById(o[i]);
	obj.style.MozOpacity = 0;
	obj.style.opacity = 0;
	obj.style.filter = 'alpha(opacity=0)';
	}
}
//fim limpa alpha

//alpha
function alpha(id){
	fade(id)
}
//fim aplpha

function menu(){

var get = window.location.search.substring(3);

	if(get == 1){
		exibe("menu_colecoes");
		alpha("menu_colecoes");
	}
	if(get == 2){
		exibe("sobre_nos");
		alpha("sobre_nos");
	}
	if(get == 3){
		exibe("menu_onde");
		alpha("menu_onde");
	}
	if(get == 4){
		exibe("menu_servicos");
		alpha("menu_servicos");
	}
	if(get == 5){
		exibe("eventos2");
		alpha("eventos2");
	}
	if(get == 6){
		exibe("cadastro");
		alpha("cadastro");
	}
	if(get == 7){
		exibe("contato2");
		alpha("contato2");
	}


	fade("menu");

}

function carregando(){
document.getElementById("carregando").style.display = "none"
}
