

//funcao de rollover imagem
function rollImage(el){
	strLink = $(el).src.split('/')
	strPartes = strLink[strLink.length - 1].split('.')
	var strPath = null;
	if(strPartes[0].indexOf('over') == -1){
		for(i = 2; i < strLink.length - 1; i++){
			if(i == 2){
				strPath = strLink[i] + "/";
			}else{
				strPath = strPath + strLink[i]+ "/";
			}
		}
		strPath = "http://" + strPath + strPartes[0] + "_over.gif"
	}else{
		for(i = 2; i < strLink.length - 1; i++){
			if(i == 2){
				strPath = strLink[i] + "/";
			}else{
				strPath = strPath + strLink[i]+ "/";
			}
		}
		strPartes[0] = strPartes[0].substr(0, strPartes[0].length - 5)
		strPath = "http://" + strPath + strPartes[0] + ".gif"
	}
	//mostra a imagem
	$(el).src = strPath;
}

//funcao que muda o sinal de + para -
function toggleAccordionImageShow(el) {
	var numero = el.id.substr(10,1)
	for(i=0;i<4;i++){
		if(i != numero){
				eval("document.getElementById('arrow" + i + "')").className = "s_ico_menos_leftOFF";
				eval("document.getElementById('arrow" + i + "b')").className = "s_ico_menos_rightOFF";
		}else{
			eval("document.getElementById('arrow" + i + "')").className = "s_ico_menos_leftON";
			eval("document.getElementById('arrow" + i + "b')").className = "s_ico_menos_rightON";
		}
	}
}

// Efeito sanfona na ficha técnica
try{
   window.onDomReady(
    	function(){
    		new Accordion($$("div.s_ficha_tecnica_troggler"), $$("div.s_ficha_tecnica"), 
    			{
    				opacity : true,
    				openClose : false,
    				itemsOpen:[0],
    				onActive : function(el){toggleAccordionImageShow(el)}
    				//onBackground : function(el){toggleAccordionImageHide(el)},
    			});
    	}
    ); 
}
catch(e){}
