var margem = 10;
var margemD = 50;
//var idbloco= "";

abreDescri = function(id){
	idbloco = id;
	var teste = $GEBId(id).style.marginTop;
	if($GEBId(id).style.marginTop == "49px"){
		//alert("desandar");
		$GEBId("b"+id).className = "boxbot";
		setTimeout("desandar('"+id+"')",5);
	}else{
		//alert("andar");
		desandarOutros(id);
		$GEBId("b"+id).className = "boxbotover";
		setTimeout("andar('"+id+"')",10);
	}
}

andar = function(id){
	margem++;
	$GEBId(id).style.marginTop = margem+"px";
	if(margem < 49){	
	
		$GEBId("b"+id).className = "boxbotover";
		setTimeout("andar('"+id+"')",10);
	}else{
		mostrarDescri(id);
		margem = 10;
	}
}

desandar = function(id){
//	desmostrarDescri(id);	
	var marg = $GEBId(id).style.marginTop;
	//alert(marg);
	marg = marg.split("px");
	var marge = marg[0]-1; 
	//alert(marg[0]);
	var des = "";
	if(marge > 10){
		$GEBId(id).style.marginTop = marge+"px";
		
		$GEBId("b"+id).className = "boxbot";
		setTimeout("desandar('"+id+"')",5);
	}else{
		if(id >3)des = 1;
		$GEBId("descric"+des).style.display = "none";
		$GEBId("descr"+id).style.display = "none"; 
	}
}

mostrarDescri = function(id){
	var des = ""
	if(id >3)des = 1;
	for(var i = 1; i < 7; i++){
		$GEBId("descric"+des).style.display = "none";
		$GEBId("descr"+i).style.display = "none"; 
	}
	setTimeout("abre('"+des+"')",1000);
//	$GEBId("descric"+des).style.display = "";
	$GEBId("descr"+id).style.display = ""; 
	
}

desmostrarDescri = function(id){
	var des = ""
	if(id >3)des = 1;
	$GEBId("descric"+des).style.display = "none";
	$GEBId("descric"+des).style.height = "0px";
	$GEBId("descr"+id).style.display = "none"; 
	
}
desandarOutros = function(id){
	for(var i = 1; i < 7; i++){
	if(i != id)	setTimeout("desandar('"+i+"')",5);
	}
	
}

abre = function(id){
	
	var alt = $GEBId("descric"+id).style.height;
	alt = alt.split("px");
	var marge = (alt[0]*1)+2; 
//	alert(marge)

	if($GEBId("descric"+id).style.display=="none"){
		$GEBId("descric"+id).style.height = "0px";
		$GEBId("descric"+id).style.display = "";
		marge = 0;
	}
//alert($GEBId("descric"+id).style.height);
	$GEBId("descric"+id).style.height = marge+"px";
	if(marge < 177){
		setTimeout("abre('"+id+"')",20);
	}
}




var bannerNum = 1;
var tempo;

chgBannerAuto = function(){
	for(var i = 1; i < 8; i++){
		$GEBId("b"+i).src="img/bot2.png";
		$GEBId("banner_main"+i).style.display = "none";
	}
	
//	$GEBId("banner_main").src="img/banner"+bannerNum+".png";
	$GEBId("banner_main"+bannerNum).style.display = "";
	$GEBId("b"+bannerNum).src="img/bot1.png";
	
	if(bannerNum < 7)bannerNum++;
	else bannerNum = 1;
	
	
	
	tempo = setTimeout("chgBannerAuto()", 4000);
}

chgButton = function(x){
	clearTimeout(tempo);
	bannerNum = x;
	chgBannerAuto();
}



function chgBanner(num){
	bannerNum = num;
		$GEBId("banner_main").src="img/banner"+bannerNum+".png";
	
}

mudaparceiro = function(id){
	var nid = id.split("_");
	
	if(nid[1]=="0"){
		$GEBId(nid[0]+"_0").style.display = "none";
		$GEBId(nid[0]+"_1").style.display = "";	
	}else{
		$GEBId(nid[0]+"_1").style.display = "none";
		$GEBId(nid[0]+"_0").style.display = "";	
	}
}


/*prod = function(div, id){
	var tot = 0;
	if(div =="hardware"){
		$GEBId("software").style.display = "none"; tot=11;
	}else{
		if(div =="software"){
		$GEBId("hardware").style.display = "none"; tot=10;
		for(var i=1;i<=tot;i++){
			$GEBId(div +"-"+i).style.display = "none";
			}
			$GEBId(div+"-"+id).style.display = "";
		}
	}
}*/



prod = function(div, id, tit){
	
	$GEBId("titulo").innerHTML = tit;
	
	
		
		var divs = $GEBTn("div");
		
		//alert(divs.length);
		//for(var i=0; i<ct; i++){
		if(div == "hardware"){	
			for(var x=0; x < divs.length; x++){
			if(divs[x].id.match(/soft/)) divs[x].style.display = "none";  
				if(divs[x].id.match(/hard/) && divs[x].title == id) divs[x].style.display = "";
				else if(divs[x].id.match(/hard/)) divs[x].style.display = "none"; 
			
			}
			
			
		}else{
			
			for(var x=0; x < divs.length; x++){
			if(divs[x].id.match(/hard/)) divs[x].style.display = "none"; 
				if(divs[x].id.match(/soft/) && divs[x].title == id) divs[x].style.display = "";
				else if(divs[x].id.match(/soft/)) divs[x].style.display = "none";  
			
			}
			
		}
		
		
		
	
	
}







