var Uteis = {
	get_flash: function(arquivo, largura, altura, bgcolor, id, qualidade, alinhamento,transparente,pgphp){
		var obj = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+largura+'" height="'+altura+'" id="'+id+'" align="'+alinhamento+'">';
		obj+= '<param name="allowScriptAccess" value="sameDomain" />';
		obj+= '<param name="movie" value="'+arquivo+'" />';
		obj+= '<param name="quality" value="'+qualidade+'" />';
		if(transparente == true) {
			obj+= '<param name="wmode" value="transparent" />';
		}
		obj+= '<param name="bgcolor" value="'+bgcolor+'" />';
		obj+= '<param name="FlashVars" value="pg='+pgphp+'" />';
		obj+= '<embed src="'+arquivo+'" '+((transparente==true)?'wmode="transparent"':'')+'" quality="'+qualidade+'" bgcolor="'+bgcolor+'" FlashVars="pg='+pgphp+'" width="'+largura+'" height="'+altura+'" name="'+id+'" align="'+alinhamento+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
		obj+= '</object>';
		document.write(obj);
	},
	url: function(_url){
		document.location.href = _url;
	},
	urlBlank: function(_url){
		window.open(_url);
	},
	popup : function(url, width, height){
		var features = 'width='+width+',height='+height+',scrollbars=1,resizable=1';
		window.open(url, 'popup', features);
	},
	ge : function(elementId){
		var element = document.getElementById(elementId);
		return element;
	},
	ga : function(elementsTag){
		var elements = document.getElementsByTagName(elementsTag);
		return elements;
	},
	format: function (src, mask) {
		var i = src.value.length;
		var saida = mask.substring(0,1);
		var texto = mask.substring(i)
		if (texto.substring(0,1) != saida) {
			src.value += texto.substring(0,1);
		}
	},
	limpaInput : function(element){
		if(element.value == 'busca'){element.value = '';}
	},
	submitOnChange : function(id){
		window.location = "index.php?id=/fotos&cd_matia="+id;
	}
};

//-----------------------------------------------------------------------//

formFocus = function(id){
	if(document.getElementById(id).className == 'form1'){
		document.getElementById(id).className = 'form2';
	} else{
		document.getElementById(id).className = "form1";
	}
}




function formatar(src, mask) {
	var i = src.value.length;
	var saida = mask.substring(0,1);
	var texto = mask.substring(i)

	if (texto.substring(0,1) != saida) {
		src.value += texto.substring(0,1);
	}
}

function doDate(pStr)
{

 var reDate5 = /^((0[1-9]|[12]\d)\/(0[1-9]|1[0-2])|30\/(0[13-9]|1[0-2])|31\/(0[13578]|1[02]))\/\d{4}$/;

	if (reDate5.test(pStr)) {
		
	} else if (pStr != null && pStr != "") {
		alert("DATA DE NASCIMENTO não é válida!\n"+pStr);
		window.document.getElementById("tra_nascimento").value = "";
	} 
}

function marca(id){
	window.document.getElementById('cinza').className='cinza';
	window.document.getElementById('amarelo').className='amarelo';
	window.document.getElementById('azul').className='azul';
	window.document.getElementById('verde').className='verde';
	window.document.getElementById('rosa').className='rosa';
	window.document.getElementById(id).className=id+'Ativo';
}
function formFocus(id){
	if((document.getElementById(id).className) == "formInput2"){
		document.getElementById(id).className="formInput";
	}else{
		document.getElementById(id).className="formInput2";
	}
}
function formMultFocus(id){
	if((document.getElementById(id).className) == "formMulInput2"){
		document.getElementById(id).className="formMulInput";
	}else{
		document.getElementById(id).className="formMulInput2";
	}
}


function abre(id) {
	if(window.document.getElementById(id).style.display == 'none') { 
		window.document.getElementById(id).style.display = '';
		window.document.getElementById("img_"+id).src = '/checkupimagens/seta_up.gif';
	} else { 
		window.document.getElementById(id).style.display = 'none'; 
		window.document.getElementById("img_"+id).src = '/checkupimagens/seta_down.gif';
	}
}

function escondeAbasArgalit(){
	document.getElementById('qualidade').style.display = 'none';
	document.getElementById('diferenciais').style.display = 'none';
	//document.getElementById('ficha').style.display = 'none';
	document.getElementById('responsabilidade').style.display = 'none';
}

function mostraAbas(id){
	window.document.getElementById('qualidade').style.display = 'none';
	document.getElementById('qualidade_li').className = '';
	document.getElementById('diferenciais').style.display = 'none';
	document.getElementById('diferenciais_li').className = '';
	//document.getElementById('ficha').style.display = 'none';
	//document.getElementById('ficha_li').className = '';
	document.getElementById('responsabilidade').style.display = 'none';
	document.getElementById('responsabilidade_li').className = '';
	document.getElementById('apresentacao').style.display = 'none';
	document.getElementById('apresentacao_li').className = '';
	document.getElementById(id).style.display = '';
	document.getElementById(id+'_li').className = 'ativo';
}

function validaNews(){
	var msg = "";
	if((window.document.formNews.ds_nome.value == 'Nome completo') || (window.document.formNews.ds_nome.value == '')){
		msg = " - Seu nome!\n";
	}
	if((window.document.formNews.ds_email.value == 'E-mail') || (window.document.formNews.ds_email.value == '')){
		msg = msg + " - Seu email!\n";
	}
	
	if(msg == ""){
		return true;
	}else{
		alert("Preencha os campos corretamente.");
		return false;
	}
}


function validaBusca(){
	var msg = "";
	if((window.document.formBusca.ds_busca.value == 'Palavra chave') || (window.document.formBusca.ds_busca.value == '')){
		msg = " - Seu nome!\n";
	}

	if(msg == ""){
		return true;
	}else{
		alert("Digite uma palavra chave.");
		return false;
	}
}


function ordena(pag, tipo, mod){
	document.location.href = "../produtos/?pg="+pag+"&mod="+mod+"&tipo="+tipo;
	marcaClasseProdutos(tipo);
}


function marcaClasseProdutos(tipo){
	document.getElementById("todos_li").className = "";
	document.getElementById("tintas_li").className = "";
	document.getElementById("solventes_li").className = "";
	document.getElementById("massa_li").className = "";
	document.getElementById("argamassa_li").className = "";
	document.getElementById(tipo+"_li").className = "ativo";
}

// Função Link da paginação (fiveedit linha:)
function Page(cd_sesit, p, tipo, pag, mod){
	document.location.href = "?cd_sesit="+cd_sesit+"&p="+p+"&tipo="+tipo+"&pg="+pag+"&mod="+mod;
}

// Função Link de matérias (fiveedit linha:)
function Url(url, cd_matia, cd_site){
	document.location.href = url+"?cd_matia="+cd_matia+"&cd_site="+cd_site;
}

function url(url){
	document.location.href = url;
}


function escondeAbasGuiaProd(){
	document.getElementById('cromoterapia').style.display = 'none';
	document.getElementById('cores_cor').style.display = 'none';
	document.getElementById('fengshui').style.display = 'none';
	document.getElementById('galeria').style.display = 'none';
	document.getElementById('duvidas').style.display = 'none';
}

function mostraAbasGuiaProd(id){
	document.getElementById('dicas').style.display = 'none';
	document.getElementById('dicas_li').className = '';
	document.getElementById('cromoterapia').style.display = 'none';
	document.getElementById('cromoterapia_li').className = '';
	document.getElementById('cores_cor').style.display = 'none';
	document.getElementById('cores_cor_li').className = '';
	document.getElementById('fengshui').style.display = 'none';
	document.getElementById('fengshui_li').className = '';
	document.getElementById('galeria').style.display = 'none';
	document.getElementById('galeria_li').className = '';
	document.getElementById('duvidas').style.display = 'none';
	document.getElementById('duvidas_li').className = '';
	document.getElementById(id).style.display = '';
	document.getElementById(id+'_li').className = 'ativo';
}

    
function dicasAbas(id){
	if(document.getElementById(id).style.display == 'none'){
		document.getElementById(id).style.display = '';
		document.getElementById(id+"_li").className = 'ativo';
	}else{
		document.getElementById(id).style.display = 'none';
		document.getElementById(id+"_li").className = '';
	}
}

function dicasAbasProd(id){
	if(document.getElementById(id).style.display == 'none'){
		document.getElementById(id+"_corpo").style.display = '';
		document.getElementById(id+"_li").className = 'ativo';
	}else{
		document.getElementById(id+"_corpo").style.display = 'none';
		document.getElementById(id+"_li").className = '';
	}
}

function Dicas(id){
	if(document.getElementById(id).style.display == ""){
		document.getElementById(id).style.display = "none";
		document.getElementById(id+"_tit").className = "barBtn";
	}else{
		document.getElementById(id).style.display = "";
		document.getElementById(id+"_tit").className = "barBtnAtivo";
	}
}

    
function ativaAbaCores(){
	document.getElementById('dicas').style.display = "none";
	document.getElementById('dicas_li').className = "";
	document.getElementById('cores_cor').style.display = "";
	document.getElementById('cores_cor_li').className = "ativo";
}  

    
function mudaAbaFaleConosco(id){
		window.document.getElementById("formContato").style.display = "none";
		window.document.getElementById("formContato_li").className = "";
		window.document.getElementById("formTrabalhe").style.display = "none";
		window.document.getElementById("formTrabalhe_li").className = "";
		window.document.getElementById(id).style.display = "";
		window.document.getElementById(id+"_li").className = "ativo";
} 

    
function abasClasses(id){
	if(document.getElementById(id).style.display == ''){
		document.getElementById(id+"_t").className = 'barBtn';
		document.getElementById(id).style.display = 'none';
	}else{	
		document.getElementById(id+"_t").className = 'barBtnAtivo';
		document.getElementById(id).style.display = '';
	}
} 

function escondeAbas(){
	document.getElementById('produtos_relacionados').style.display = 'none';
	document.getElementById('duvidas_frequentes').style.display = 'none';
	document.getElementById('dicas').style.display = 'none';
	document.getElementById('rendimentos').style.display = 'none';
} 

function Voltar(){
	document.getElementById('matiaProximo_img').src = 'imagens/btn_prod_pro_off.gif';
	document.getElementById('matiaProximo').href = 'javascript:;';
	
}

function Ir(){
	document.getElementById('matiaProximo_img').src = 'imagens/btn_prod_pro.gif';
	document.getElementById('matiaAnterior').href = 'javascript:prodAnt();';
}

function Ir_ant(){
	document.getElementById('matiaAnterior_img').src = 'imagens/btn_prod_ant_off.gif';
	document.getElementById('matiaAnterior').href = 'javascript:;';
	//alert('ok');
}

function Voltar_ant(){
	document.getElementById('matiaAnterior_img').src = 'imagens/btn_prod_ant.gif';
	//document.getElementById('matiaProximo').href = 'javascript:prodProx();';
	
	//alert('ok');
}

function enviarFotos(){
	if(document.getElementById('enviarFotos').style.display == ""){
		document.getElementById('enviarFotos').style.display = "none";
	}else{
		document.getElementById('enviarFotos').style.display = "";
	}
}
//---------------------------- FUNÇÃO CHECA FORM Concurso-------------------------------------------//
function Concurso() {
	
	var msg = "";
	
	if(window.document.getElementById('nome').value == ""){
		msg = msg + " - Informe seu Nome;\n";
	}
	if(window.document.getElementById('empresa').value == ""){
		msg = msg + " - Informe sua Empresa;\n";
	}
	
	if(window.document.getElementById('matricula').value == ""){
		msg = msg + " - Informe sua Matrícula;\n";
	}
	
	if(window.document.getElementById('tel_cel').value == ""){
		msg = msg + " - Informe seu Telefone ou Celular;\n";
	}
	
	if(window.document.getElementById('telempresa').value == ""){
		msg = msg + " - Informe seu Telefone da Empresa;\n";
	}

	if(window.document.getElementById('email').value == ""){
		msg = msg + " - Informe seu E-mail;\n";
	}
	
	if(window.document.getElementById('titulo1').value == ""){
		msg = msg + " - Informe o Titulo da descrição da fotografia 1;\n";
	}
	
	if(window.document.getElementById('local_data1').value == ""){
		msg = msg + " - Informe o local e data da descrição da fotografia 1;\n";
	}
	
	if(window.document.getElementById('foto1').value == ""){
		msg = msg + " - faça a Busca da sua imagem.\n";
	}
	
	if(msg){
		alert("Atenção!\n\n" + msg);
		return false;
	}else
		document.formConcurso.submit();

}
//---------------------------- FUNÇÃO CHECA FORM CONTATO-------------------------------------------//
function checaContato() {
	
	var msg = "";
	
		if(window.document.getElementById('nome').value == ""){
		msg = msg + " - Informe seu nome;\n";
	}
	
		if(window.document.getElementById('email').value == ""){
		msg = msg + " - Informe seu email;\n";
	}	

		if(window.document.getElementById('endereco').value == ""){
		msg = msg + " - Informe seu endereco;\n";
	}
	
		if(window.document.getElementById('telefone').value == ""){
		msg = msg + " - Informe seu telefone;\n";
	}
	

	if(window.document.getElementById('mensagem').value == ""){
		msg = msg + " - Digite sua mensagem.\n";
	}
	
	
	
	
	if(msg){
		alert("Atenção!\n\n" + msg);
		return false;
	}else
		document.formContato.submit();

}

//---------------------------- FUNÇÃO CHECA FORM CONTATO IDIOMA INGLES-------------------------------------------//
function checaContato2() {
	
	var msg = "";
	
		if(window.document.getElementById('nome').value == ""){
		msg = msg + " - Enter your name;\n";
	}
	
		if(window.document.getElementById('email').value == ""){
		msg = msg + " - Enter your email;\n";
	}	

		if(window.document.getElementById('endereco').value == ""){
		msg = msg + " - Enter your address;\n";
	}
	
		if(window.document.getElementById('telefone').value == ""){
		msg = msg + " - Enter your phone;\n";
	}
	

	if(window.document.getElementById('mensagem').value == ""){
		msg = msg + " - Enter your menssage.\n";
	}
	
	
	
	
	if(msg){
		alert("Attention!\n\n" + msg);
		return false;
	}else
		document.formContato.submit();

}
//---------------------------- FUNÇÃO CHECA FORM ARTIGOS TECNICOS-------------------------------------------//
function checaArtigo() {
	
	var msg = "";
	
		if(window.document.getElementById('nome').value == ""){
		msg = msg + " - Informe seu nome;\n";
	}
	
		if(window.document.getElementById('sobrenome').value == ""){
		msg = msg + " - Informe seu sobrenome;\n";
	}	

		if(window.document.getElementById('empresa').value == ""){
		msg = msg + " - Informe sua empresa;\n";
	}
	
		if(window.document.getElementById('cargo').value == ""){
		msg = msg + " - Informe seu cargo;\n";
	}
	
		if(window.document.getElementById('endereco').value == ""){
		msg = msg + " - Informe seu endereço;\n";
	}
	
		if(window.document.getElementById('cidade').value == ""){
		msg = msg + " - Informe sua cidade;\n";
	}

		if(window.document.getElementById('estado').value == ""){
		msg = msg + " - Informe seu estado;\n";
	}

		if(window.document.getElementById('pais').value == ""){
		msg = msg + " - Informe seu pais;\n";
	}

		if(window.document.getElementById('cep').value == ""){
		msg = msg + " - Informe seu cep;\n";
	}

		if(window.document.getElementById('telefone').value == ""){
		msg = msg + " - Informe seu telefone;\n";
	}

		if(window.document.getElementById('fax').value == ""){
		msg = msg + " - Informe seu fax;\n";
	}

		if(window.document.getElementById('email').value == ""){
		msg = msg + " - Informe seu email;\n";
	}
	

	
	
	if(msg){
		alert("Atenção!\n\n" + msg);
		return false;
	}else
		document.formContato.submit();

}

//---------------------------- FUNÇÃO CHECA FORM ARTIGOS TECNICOS IDIOMA INGLES -------------------------------------------//
function checaArtigo2() {
	
	var msg = "";
	
		if(window.document.getElementById('nome').value == ""){
		msg = msg + " - Enter your name;\n";
	}
	
		if(window.document.getElementById('sobrenome').value == ""){
		msg = msg + " - Enter your last name;\n";
	}	

		if(window.document.getElementById('empresa').value == ""){
		msg = msg + " - Enter your company;\n";
	}
	
		if(window.document.getElementById('cargo').value == ""){
		msg = msg + " - Enter your position;\n";
	}
	
		if(window.document.getElementById('endereco').value == ""){
		msg = msg + " - Enter your address;\n";
	}
	
		if(window.document.getElementById('cidade').value == ""){
		msg = msg + " - Enter your city;\n";
	}

		if(window.document.getElementById('estado').value == ""){
		msg = msg + " - Enter your state;\n";
	}

		if(window.document.getElementById('pais').value == ""){
		msg = msg + " - Enter your country;\n";
	}

		if(window.document.getElementById('cep').value == ""){
		msg = msg + " - Enter your zip code;\n";
	}

		if(window.document.getElementById('telefone').value == ""){
		msg = msg + " - Enter your phone;\n";
	}

		if(window.document.getElementById('fax').value == ""){
		msg = msg + " - Enter your fax;\n";
	}

		if(window.document.getElementById('email').value == ""){
		msg = msg + " - Enter your email;\n";
	}
	

	
	
	if(msg){
		alert("Attention!\n\n" + msg);
		return false;
	}else
		document.formContato.submit();

}
//---------------------------- FUNÇÃO LIBERA CAMPOS-------------------------------------------//

function LiberaCampo(valor){
	if(valor == "Sim"){
		document.getElementById('tiposCarteria').style.display = '';
	}else{
		document.getElementById('tiposCarteria').style.display = 'none';
	}
}

//---------------------------- FUNÇÃO FORM AREA RESTRITA E NEWSLETTER-------------------------------------------//
function arearestrita(divAtual) {
    var divs = new Array('AbaAreaRestrita','AbaNewsteller');
    for (div in divs) {
    	document.getElementById(divs[div]).style.display = 'none';
    }	
    document.getElementById(divAtual).style.display = 'block';
}

/*-------------------------- FUNÇÃO AUMENTA FONTE ---------------------------------*/

Comportamento = {
		
	zoomLetra: 
	
		function(classe, tipo){
			
			var tags = Array("p","h1","a","h2","h3","strong","span");
			
			for (tag in tags) {
				size = new String($("."+classe+ " " + tags[tag]).css("font-size"));
				var fonte = size.replace('px', '');
				
				if (fonte == "") {
					fonte = "12";
				}
				
				fonte = parseInt(fonte);
				
				if ((tipo == "+") && (fonte < 18) && (tags[tag] == "p")) {
					fonte += 1;
					$(".noticiasTexto p").css("font-size",fonte+"px");
					$(".noticiasTexto p").css("line-height","20px");
					$(".noticiasTexto a").css("font-size",fonte+"px");
					$(".noticiasTexto a").css("line-height","20px");
					$(".noticiasTexto h1").css("font-size",fonte+"px");
					$(".noticiasTexto h1").css("line-height","20px");
					$(".noticiasTexto h2").css("font-size",fonte+"px");
					$(".noticiasTexto h2").css("line-height","20px");
					$(".noticiasTexto h3").css("font-size",fonte+"px");
					$(".noticiasTexto h3").css("line-height","20px");
					$(".noticiasTexto strong").css("font-size",fonte+"px");
					$(".noticiasTexto strong").css("line-height","20px");
				} else if ((tipo == "+") && (fonte < 28) && (tags[tag] != "p")) {
					fonte += 1;
					$(".noticiasTexto"+tags[tag]).css("font-size",fonte+"px");
					$(".noticiasTexto"+tags[tag]).css("line-height","12px");

				}
				
				if ((tipo == "-") && (fonte > 12) && (tags[tag] == "p")) {
					fonte -= 1;				
					$(".noticiasTexto p").css("font-size",fonte+"px");
					$(".noticiasTexto p").css("line-height","20px");
					$(".noticiasTexto a").css("font-size",fonte+"px");
					$(".noticiasTexto a").css("line-height","20px");
					$(".noticiasTexto h1").css("font-size",fonte+"px");
					$(".noticiasTexto h1").css("line-height","20px");
					$(".noticiasTexto h2").css("font-size",fonte+"px");
					$(".noticiasTexto h2").css("line-height","20px");
					$(".noticiasTexto h3").css("font-size",fonte+"px");
					$(".noticiasTexto h3").css("line-height","20px");
					$(".noticiasTexto strong").css("font-size",fonte+"px");
					$(".noticiasTexto strong").css("line-height","20px");
				} else if ((tipo == "-") && (fonte > 28) && (tags[tag] != "p")) {
					fonte -= 1;
					$(".noticiasTexto"+tags[tag]).css("font-size",fonte+"px");
					$(".noticiasTexto"+tags[tag]).css("line-height","20px");

				}
				
			}
	}
	
};

/*-------------------------- FUNÇÃO AUMENTA TEXTO ---------------------------------*/
var Texto = {
	// variáveis privadas
	_target : null,
	_p : null, // array contendo todos os elementos P
	_tam : null, // tamanho do array
	_fonteMin : 0.8, // tamanho mínimo da fonte (em)
	_fonteMax : 2.0, // tamanho máximo da fonte (em)
	_fonteAtual : 1.2, // tamanho atual da fonte (para esse projeto o padrão é 1.2)
	/**
	 * Função que aumenta o tamanho da fonte
	 * os elementos afetados são os parágrafos
	 */
	maior : function(target){
		
		this._target = target;
		this.getVars();
		if(this._fonteAtual+0.1 < this._fonteMax){
			while(this._tam--){
				this._p[this._tam].style.fontSize = this._fonteAtual + 0.1 + 'em';
			}
			this._fonteAtual += 0.1;
		}
	},
	/**
	 * Função que diminui o tamanho da fonte
	 * os elementos afetados são os parágrafos
	 */
	menor : function(target){
		this._target = target;
		this.getVars();
		if(this._fonteAtual-0.1 > this._fonteMin){
			while(this._tam--){
				this._p[this._tam].style.fontSize = this._fonteAtual - 0.1 + 'em';
			}
			this._fonteAtual -= 0.1;
		}
	},
	/**
	 * Função que coleta as informações sobre os parágrafos
	 * e inicializa todas as variáveis.
	 */
	getVars : function(){
		this._p = jQuery(this._target);
		this._tam = this._p.length;
		if(this._p[0].style.fontSize != ''){
			this._fonteAtual = parseFloat(this._p[0].style.fontSize);
		}
	}
};



/*------------------------------- SUBMENU --------------------------------------*/
function submenu(id){
	if(document.getElementById("info_"+id).style.display == ""){
		document.getElementById("info_"+id).style.display = "none";

	}else{
		document.getElementById("info_"+id).style.display = "";
	}
}


/*------------------------------- SUBMENU --------------------------------------*/

var Menu = {
	submenu : function(elem){
		//alert(elem.className);
		if(elem.className == 'aberto'){
			elem.className = 'pai';
		}else{
			elem.className = 'aberto';
		}
	},
	submenu_h_show : function(elem){
		sub = elem.getElementsByTagName('ul')[0];
		if(sub.style.display == '' || sub.style.display == 'none'){
			sub.style.display = 'block';
		}
	},
	submenu_h_hide : function(elem){
		sub = elem.getElementsByTagName('ul')[0];
		sub.style.display = 'none';
	}
};

function abreMenu2(id, status){
	window.document.getElementById("submenu"+id).style.visibility=status;

}


function abreMenu(id, status){
	window.document.getElementById("submenu"+id).style.visibility=status;
	window.document.getElementById("0"+id).style.color = "#bc0501";
	window.document.getElementById("0"+id).style.background = "#FFF";
}

function Marca(id){
	window.document.getElementById(id).style.color = "#bc0501";
	window.document.getElementById(id).style.background = "#FFF";

}

function Desmarca(id){
	window.document.getElementById(id).style.background = "";
	window.document.getElementById(id).style.color = "#1d2a3e";

}

//---------------------------- FUNÇÃO ABRE ABA SIMPLES-------------------------------------------//
function abasimples(id){
	if(document.getElementById("aba_"+id).style.display == ""){
		document.getElementById("aba_"+id).style.display = "none";

	}else{
		document.getElementById("aba_"+id).style.display = "";
	}
}


function start(){
		
		if ($('kwick')) parseKwicks();
		
		
}
//---------------------------- FUNÇÃO Kwicks-------------------------------------------//	

function parseKwicks(){
		var kwicks = $$('#kwick .kwick');
		var fx = new Fx.Elements(kwicks, {wait: false, duration: 300, transition: Fx.Transitions.Sine.easeOut});
		kwicks.each(function(kwick, i){
			kwick.addEvent('mouseenter', function(e){
				var obj = {};
				obj[i] = {
					'width': [kwick.getStyle('width').toInt(), 285]
				};
				kwicks.each(function(other, j){
					if (other != kwick){
						var w = other.getStyle('width').toInt();
						if (w != 98) obj[j] = {'width': [w, 98]};
					}
				});
				fx.start(obj);
			});
		});
		
		$('kwick').addEvent('mouseleave', function(e){
			var obj = {};
			kwicks.each(function(other, j){
				obj[j] = {'width': [other.getStyle('width').toInt(), 160]};
			});
			fx.start(obj);
		});
	}

window.onload = function()  { start(); }  


/**
Classe com as principais funções de controle de matérias.
- submitIndicar(IdDoFormulário) => envio do formulário de indicar matéria
- submitComunicar(IdDoFormulário) => envio do formulário de comunicar erro
- show(IdDoFormulário) => mostrar o formulário de acordo com o botão clicado
- resposta(dados) => Essa é a função que será executada logo após o formulário ser enviado por ajax.
- print(localDoArquivoPhp, códigoDaMatéria, Largura, Altura) => abre o popup com o conteúdo pronto para impressão
*/
var Controles = {
	/* variáveis privadas */
	_msg:'',
	_form:null,
	_data:null,
	/* envia o formulário 'indicar matéria' */
	submitIndicar:function(formName){
		// cria um array com o tamanho dos elementos do formulário
		this._data = new Array(6);
		// faz a validação do formulário
		this._form = document.getElementById(formName);
		this._msg += Validate.inputs(this._form);
		this._msg += Validate.textareas(this._form);
		// verifica se o formulário é válido ou não
		if(this._msg == ''){
			//verificamos se o jQuery está instalado
			if(typeof($) == 'function'){
				// preenchemos o array _data, que será enviado para o php pelo ajax
				for(i=0;i<5;i++){
					this._data[i] = this._form[i];
				}
				// envia o formulário por ajax
				$.post('/?id=/includes/paginas/ajaxforms.php',this._data, function(data){ Controles.resposta(data); });
			}else{
				alert('Error: A biblioteca jQuery não está instalada.');
			}
		}else{
			alert(this._msg);
			this._msg = '';
		}
	},
	/* envia o formulário 'comunicar erro' */
	submitComunicar:function(formName){
		// cria um array com o tamanho dos elementos do formulário
		this._data = new Array(5);
		// faz a validação do formulário
		this._form = document.getElementById(formName);
		this._msg += Validate.inputs(this._form);
		this._msg += Validate.textareas(this._form);
		// verifica se o formulário é válido ou não
		if(this._msg == ''){
			//verificamos se o jQuery está instalado
			if(typeof($) == 'function'){
				// preenchemos o array _data, que será enviado para o php pelo ajax
				for(i=0;i<5;i++){
					this._data[i] = this._form[i];
				}
				// envia o formulário por ajax
				$.post('/?id=/includes/paginas/ajaxforms.php',this._data, function(data){ Controles.resposta(data); });
			}else{
				alert('Error: A biblioteca jQuery não está instalada.');
			}
		}else{
			alert(this._msg);
			this._msg = '';
		}
	},
	/* mostra o formulário escolhido */
	show:function(formName){
		var forms = document.getElementById('controles_container').getElementsByTagName('form');
		var tam = forms.length;
		while(tam--){
			forms[tam].style.display = 'none';
		}
		document.getElementById(formName).style.display = '';
	},
	/* tabalha com a esposta do ajax */
	resposta:function(data){
		//alert(data);
		this._form.innerHTML = data;
	},
	/* abre o popup com o conteúdo pronto para impressão */
	print:function(arquiv, cd_matia, width, height){
		var opcoes = 'width='+width+',height='+height+',scrollbars=1,resizable=1';
		window.open('http://'+window.location.host+'?id='+arquiv+'&cd_matia='+cd_matia,'Imprimir',opcoes);
	}
};