
	
	function abreIntitucional(){
		document.getElementById('institucional').style.color = '#4555AC';
		document.getElementById('consumo').style.color = '#B2BEFF';
		document.getElementById('funcional').style.color = '#B2BEFF';
		document.getElementById('sub_institucional').style.display = '';		
		document.getElementById('sub_consumo').style.display = 'none';		
		document.getElementById('sub_funcional').style.display = 'none';		
		document.getElementById('subsub_casa').style.display = 'none';
		
		
		document.getElementById('casa').style.color = '#4555AC';
		document.getElementById('profissional').style.color = '#4555AC';
		document.getElementById('b2b').style.color = '#4555AC';
		document.getElementById('subsub_contato').style.display = 'none';
		document.getElementById('busca').style.color = '#4555AC';
		document.getElementById('subsub_b2b').style.display = 'none';	
		
		/*clearInterval(intInstitucional);*/
	}
	function abreFuncional(){
		document.getElementById('institucional').style.color = '#B2BEFF';
		document.getElementById('consumo').style.color = '#B2BEFF';
		document.getElementById('funcional').style.color = '#4555AC';
		document.getElementById('sub_institucional').style.display = 'none';		
		document.getElementById('sub_consumo').style.display = 'none';		
		document.getElementById('sub_funcional').style.display = '';		
		document.getElementById('subsub_casa').style.display = 'none';
		
		document.getElementById('casa').style.color = '#4555AC';
		document.getElementById('profissional').style.color = '#4555AC';
		document.getElementById('b2b').style.color = '#4555AC';
		document.getElementById('busca').style.color = '#4555AC';
		document.getElementById('subsub_contato').style.display = 'none';
		document.getElementById('subsub_b2b').style.display = 'none';	

	}
	function abreConsumo(){
		document.getElementById('institucional').style.color = '#B2BEFF';
		document.getElementById('consumo').style.color = '#4555AC';
		document.getElementById('funcional').style.color = '#B2BEFF';
		document.getElementById('sub_institucional').style.display = 'none';		
		document.getElementById('sub_consumo').style.display = '';		
		document.getElementById('sub_funcional').style.display = 'none';		
		document.getElementById('subsub_casa').style.display = 'none';						
		
		document.getElementById('casa').style.color = '#4555AC';
		document.getElementById('profissional').style.color = '#4555AC';
		document.getElementById('b2b').style.color = '#4555AC';
		document.getElementById('busca').style.color = '#4555AC';
		document.getElementById('subsub_contato').style.display = 'none';
		document.getElementById('subsub_b2b').style.display = 'none';	

	}
	function abreCasa(){
		document.getElementById('institucional').style.color = '#B2BEFF';
		document.getElementById('consumo').style.color = '#4555AC';
		document.getElementById('funcional').style.color = '#B2BEFF';

		document.getElementById('sub_institucional').style.display = 'none';		
		document.getElementById('sub_consumo').style.display = '';		
		document.getElementById('sub_funcional').style.display = 'none';		
		document.getElementById('subsub_casa').style.display = '';
		document.getElementById('subsub_contato').style.display = 'none';		
		document.getElementById('casa').style.color = '#4555AC';
		document.getElementById('profissional').style.color = '#B2BEFF';
		document.getElementById('b2b').style.color = '#B2BEFF';
		document.getElementById('busca').style.color = '#B2BEFF';
		document.getElementById('subsub_b2b').style.display = 'none';	
	}
	function abreContato(){
		document.getElementById('institucional').style.color = '#B2BEFF';
		document.getElementById('consumo').style.color = '#B2BEFF';
		document.getElementById('funcional').style.color = '#4555AC';

		document.getElementById('sub_institucional').style.display = 'none';		
		document.getElementById('sub_consumo').style.display = 'none';		
		document.getElementById('sub_funcional').style.display = 'none';		
		document.getElementById('subsub_casa').style.display = 'none';
		document.getElementById('subsub_contato').style.display = '';
		document.getElementById('casa').style.color = '#4555AC';
		document.getElementById('profissional').style.color = '#B2BEFF';
		document.getElementById('b2b').style.color = '#B2BEFF';
		document.getElementById('busca').style.color = '#B2BEFF';
		document.getElementById('subsub_b2b').style.display = 'none';	
	}
	function abreProfissional(){
		document.getElementById('casa').style.color = '#B2BEFF';
		document.getElementById('profissional').style.color = '#4555AC';
		document.getElementById('b2b').style.color = '#B2BEFF';
		document.getElementById('busca').style.color = '#B2BEFF';
		document.getElementById('subsub_casa').style.display = 'none';
		document.getElementById('subsub_contato').style.display = 'none';		
		document.getElementById('subsub_b2b').style.display = 'none';	
	}
	
	function abreB2B(){
		document.getElementById('casa').style.color = '#B2BEFF';
		document.getElementById('profissional').style.color = '#B2BEFF';
		document.getElementById('b2b').style.color = '#4555AC';
		document.getElementById('busca').style.color = '#B2BEFF';
		document.getElementById('subsub_casa').style.display = 'none';	
		document.getElementById('subsub_contato').style.display = 'none';		
		document.getElementById('subsub_b2b').style.display = '';	
	}
	
	function abreBusca(){
		document.getElementById('casa').style.color = '#B2BEFF';
		document.getElementById('profissional').style.color = '#B2BEFF';
		document.getElementById('b2b').style.color = '#B2BEFF';
		document.getElementById('busca').style.color = '#4555AC';
		document.getElementById('subsub_casa').style.display = 'none';
		document.getElementById('subsub_contato').style.display = 'none';		
		document.getElementById('subsub_b2b').style.display = 'none';	
	}
	var x;
	function abre_thumb(obj){
		
		if(x!=undefined)
			x.close();
		
		x = window.open("","","width=500,height=500, scrollbars=0, resizable=0, left="+(screen.availWidth/2-250)+",top="+(screen.availHeight/2-250));
		str = "<html><head><title>Zoom</title>"; 
		str = str + "<script>"; 
		str = str + "function resizeimg(){"; 
		str = str + "	resizeBy(parseInt(document.images['zoom'].width) - parseInt(document.body.clientWidth),parseInt(document.images['zoom'].height) - parseInt(document.body.clientHeight));		"; 
		str = str + "}"; 
		str = str + "</script>"; 
		str = str + "</head><body  marginheight=\"0\" marginwidth=\"0\" bottommargin=\"0\" topmargin=\"0\" leftmargin=\"0\" rightmargin=\"0\"  ><img src=\"" + obj.src.replace("thumb","zoom") + "\" id=\"zoom\" onLoad=\"resizeimg()\"></body></html>";



		x.document.write(str);
		
		str_tmp = obj.src.replace("thumb","img_grd");
		result = str_tmp.split("/")
		result = result[result.length-1];
		

		
		
//		x.document.images['zoom'].onLoad = resizeimg(x);
		//x.onLoad = resizeimg(x);
		
		
			
/*		
		if(result == "1838.jpg"){
			x.resizeBy(650-x.document.body.clientWidth,500-x.document.body.clientHeight)
		}
		if(result == "1238.jpg"){
			x.resizeBy(650-x.document.body.clientWidth,500-x.document.body.clientWidth)
		}
		if(result == "1245.jpg"){
			x.resizeBy(650-x.document.body.clientWidth,500-x.document.body.clientWidth)
		}
		if(result == "7700-borboletas.jpg"){
			x.resizeBy(650-x.document.body.clientWidth,500-x.document.body.clientWidth)
		}
		if(result == "7204-butterfly.jpg"){
			x.resizeBy(650-x.document.body.clientWidth,500-x.document.body.clientWidth)
		}
		if(result == "5900-butterfly.jpg"){
			x.resizeBy(650-x.document.body.clientWidth,500-x.document.body.clientWidth)
		}
		if(result == "7700-borboletas.jpg"){
			x.resizeBy(650-x.document.body.clientWidth,500-x.document.body.clientWidth)
		}
		if(result == "7204-borboletas.jpg"){
			x.resizeBy(650-x.document.body.clientWidth,500-x.document.body.clientWidth)
		}
		if(result == "5900-borboletas.jpg"){
			x.resizeBy(650-x.document.body.clientWidth,500-x.document.body.clientWidth)
		}
		if(result == "7700-polpadefruta.jpg"){
			x.resizeBy(650-x.document.body.clientWidth,500-x.document.body.clientWidth)
		}
		if(result == "7700-aqua.jpg"){
			x.resizeBy(650-x.document.body.clientWidth,500-x.document.body.clientWidth)
		}
		if(result == "7700-bichos.jpg"){
			x.resizeBy(650-x.document.body.clientWidth,500-x.document.body.clientWidth)
		}
		if(result == "7732-hobby.jpg"){
			x.resizeBy(650-x.document.body.clientWidth,500-x.document.body.clientWidth)
		}
		if(result == "7109-pilsen.jpg"){
			x.resizeBy(650-x.document.body.clientWidth,500-x.document.body.clientWidth)
		}
		if(result == "7701-ases.jpg"){
			x.resizeBy(650-x.document.body.clientWidth,500-x.document.body.clientWidth)
		}
		if(result == "7800-fitness.jpg"){
			x.resizeBy(650-x.document.body.clientWidth,500-x.document.body.clientWidth)
		}
		if(result == "5900-fitness.jpg"){
			x.resizeBy(650-x.document.body.clientWidth,500-x.document.body.clientWidth)
		}
		if(result == "3209-frutas.jpg"){
			x.resizeBy(650-x.document.body.clientWidth,500-x.document.body.clientWidth)
		}
		if(result == "3209-flores.jpg"){
			x.resizeBy(650-x.document.body.clientWidth,500-x.document.body.clientWidth)
		}
		if(result == "3209-peixes.jpg"){
			x.resizeBy(650-x.document.body.clientWidth,500-x.document.body.clientWidth)
		}
		if(result == "3209-mensage.jpg"){
			x.resizeBy(650-x.document.body.clientWidth,500-x.document.body.clientWidth)
		}
		if(result == "3209-listras.jpg"){
			x.resizeBy(650-x.document.body.clientWidth,500-x.document.body.clientWidth)
		}*/
	}
 	function resizeimg(x){
			x.resizeBy(parseInt(x.document.images['zoom'].width) - parseInt(x.document.body.clientWidth),parseInt(x.document.images['zoom'].height) - parseInt(x.document.body.clientHeight))		
			alert(parseInt(x.document.images['zoom'].width));
	}
	
	/*
	function DetectImageSize(picName,picTitle){
      picURL=picName.src
      
	  newWindow=window.open(picURL,'newWin','toolbar=no,
         width='+picName.width+',height='+picName.height)
      
	  newWindow.document.write('<html><head><title>'+picTitle+'
         <\/title><\/head><body background="'+picURL+'"><\/body><\/html>')
      
	  newWindow.resizeBy(picName.width-newWindow.document.body.clientWidth,
         picName.height-newWindow.document.body.clientHeight)
      newWindow.focus()
   } 
	*/
	
	
	
	function resize() {
		w = screen.availWidth;
/*		h = screen.availHeight;*/

		if(w >= 1000){
			document.getElementById('main2').style.width = '950px';
			document.getElementById('main2').style.height = '500px';
			
			document.getElementById('main2').style.Left = '50%';
			document.getElementById('main2').style.Top = '50%';			
			
			document.getElementById('main2').style.marginLeft = '-495px';
			document.getElementById('main2').style.marginTop = '-250px';
			document.getElementById('content2').style.height = '410px';
			
			if(document.getElementById('img_special')){
				document.getElementById('img_special').src="images/consumo_1024.jpg"		
			}
			if(document.getElementById('img_special2')){
				document.getElementById('img_special2').src="images/institucional_1024.jpg"		
			}
			if(document.getElementById('img_special3')){
				document.getElementById('img_special3').src="images/missao_1024.jpg"		
			}
			changecss('.fotos','width','150px')
			changecss('.fotos','marginLeft','30px')
		}else{
			
			
			document.getElementById('main2').style.width = '750px';
			document.getElementById('main2').style.height = '400px';
			document.getElementById('content2').style.height = '410px';


			document.getElementById('main2').style.Left = '50%';
			document.getElementById('main2').style.Top = '50%';			

			document.getElementById('main2').style.marginLeft = '-375px';
			document.getElementById('main2').style.marginTop = '-200px';


			if(document.getElementById('img_special')){
				document.getElementById('img_special').src="images/consumo_800.jpg"		
			}
			if(document.getElementById('img_special2')){
				document.getElementById('img_special2').src="images/institucional_800.jpg"		
			}
			if(document.getElementById('img_special3')){
				document.getElementById('img_special3').src="images/missao_800.jpg"		
			}
		}
	}
	
	
	