<!-- Coments for explorers under 4 versions
/****************************************************
	
	Author: Daniel Segovia
	Company: RENOVATIO COMUNICACION feat STORM
			 www.renovatio-comunicacion.com

*****************************************************/

/*####################################################################

	Funciones para DIV Objects

#####################################################################*/
	

	/*-----------------------------------------------
		Function para determinar la visibilidad de un DIV
	-----------------------------------------------*/
	var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
	
	$(document).ready(function() {
		//Inicializamos tamaņos
		if(document.getElementById('sub01')){
			e_sub01=document.getElementById("sub01")
			var tamSub01=e_sub01.offsetHeight
			if(is_chrome){tamSub01+=50}
			e_sub01.style.height=0;
			$("#aLink1").click(function(e){
				e.preventDefault();
				if(parseInt(e_sub01.style.height)>=tamSub01){
					$('#sub01').animate({height:0}, {duration: 500});
				}else{
					$('#sub01').animate({height:tamSub01}, {duration: 500});
				}	
			});
			toggle_style('read01')
			//$('#sub01').animate({height:tamSub01}, {duration: 500});
		}
		
		if(document.getElementById('sub02')){
			e_sub02=document.getElementById("sub02")
			var tamSub02=e_sub02.offsetHeight
			if(is_chrome){tamSub02+=50}
			e_sub02.style.height=0;
			$("#aLink2").click(function(e){
				e.preventDefault();
				if(parseInt(e_sub02.style.height)>=tamSub02){
					$('#sub02').animate({height:0}, {duration: 500});
				}else{
					$('#sub02').animate({height:tamSub02}, {duration: 500});
				}	
			});
			toggle_style('read02')
		}
	
		if(document.getElementById('sub03')){
			e_sub03=document.getElementById("sub03")
			var tamSub03=e_sub03.offsetHeight
			if(is_chrome){tamSub03+=50}
			e_sub03.style.height=0;
			$("#aLink3").click(function(e){
				e.preventDefault();
				if(parseInt(e_sub03.style.height)>=tamSub03){
					$('#sub03').animate({height:0}, {duration: 500});
				}else{
					$('#sub03').animate({height:tamSub03}, {duration: 500});
				}	
			});
			toggle_style('read03')
		}
		
		if(document.getElementById('sub04')){
			e_sub04=document.getElementById("sub04")
			var tamSub04=e_sub04.offsetHeight
			if(is_chrome){tamSub04+=50}
			e_sub04.style.height=0;
			$("#aLink4").click(function(e){
				e.preventDefault();
				if(parseInt(e_sub04.style.height)>=tamSub04){
					$('#sub04').animate({height:0}, {duration: 500});
				}else{
					$('#sub04').animate({height:tamSub04}, {duration: 500});
				}	
			});
			toggle_style('read04')
		}
		
		if(document.getElementById('sub05')){
			e_sub05=document.getElementById("sub05")
			var tamSub05=e_sub05.offsetHeight
			if(is_chrome){tamSub05+=50}
			e_sub05.style.height=0;
			$("#aLink5").click(function(e){
				e.preventDefault();
				if(parseInt(e_sub05.style.height)>=tamSub05){
					$('#sub05').animate({height:0}, {duration: 500});
				}else{
					$('#sub05').animate({height:tamSub05}, {duration: 500});
				}	
			});
			toggle_style('read05')
		}
		
		if(document.getElementById('sub06')){
			e_sub06=document.getElementById("sub06")
			var tamSub06=e_sub06.offsetHeight
			if(is_chrome){tamSub06+=50}
			e_sub06.style.height=0;
			$("#aLink6").click(function(e){
				e.preventDefault();
				if(parseInt(e_sub06.style.height)>=tamSub06){
					$('#sub06').animate({height:0}, {duration: 500});
				}else{
					$('#sub06').animate({height:tamSub06}, {duration: 500});
				}	
			});
			toggle_style('read06')
		}
		
		
		if(document.getElementById('sub07')){
			e_sub07=document.getElementById("sub07")
			var tamSub07=e_sub07.offsetHeight
			if(is_chrome){tamSub07+=50}
			e_sub07.style.height=0;
			$("#aLink7").click(function(e){
				e.preventDefault();
				if(parseInt(e_sub07.style.height)>=tamSub07){
					$('#sub07').animate({height:0}, {duration: 500});
				}else{
					$('#sub07').animate({height:tamSub07}, {duration: 500});
				}	
			});
			toggle_style('read07')
		}
		
		if(document.getElementById('sub08')){
			e_sub08=document.getElementById("sub08")
			var tamSub08=e_sub08.offsetHeight
			if(is_chrome){tamSub08+=50}
			e_sub08.style.height=0;
			$("#aLink8").click(function(e){
				e.preventDefault();
				if(parseInt(e_sub08.style.height)>=tamSub08){
					$('#sub08').animate({height:0}, {duration: 500});
				}else{
					$('#sub08').animate({height:tamSub08}, {duration: 500});
				}	
			});
			
			toggle_style('read08')
		}
		
		if(document.getElementById('sub09')){
			e_sub09=document.getElementById("sub09")
			var tamSub09=e_sub09.offsetHeight
			if(is_chrome){tamSub09+=50}
			e_sub09.style.height=0;
			$("#aLink9").click(function(e){
				e.preventDefault();
				if(parseInt(e_sub09.style.height)>=tamSub09){
					$('#sub09').animate({height:0}, {duration: 500});
				}else{
					$('#sub09').animate({height:tamSub09}, {duration: 500});
				}	
			});
			
			toggle_style('read09')
		}
		if(document.getElementById('sub10')){
			e_sub10=document.getElementById("sub10")
			var tamSub10=e_sub10.offsetHeight
			if(is_chrome){tamSub10+=50}
			e_sub10.style.height=0;
			$("#aLink10").click(function(e){
				e.preventDefault();
				if(parseInt(e_sub10.style.height)>=tamSub10){
					$('#sub10').animate({height:0}, {duration: 500});
				}else{
					$('#sub10').animate({height:tamSub10}, {duration: 500});
				}	
			});
			
			toggle_style('read10')
		}
		if(document.getElementById('sub11')){
			e_sub11=document.getElementById("sub11")
			var tamSub11=e_sub11.offsetHeight
			if(is_chrome){tamSub11+=50}
			e_sub11.style.height=0;
			$("#aLink11").click(function(e){
				e.preventDefault();
				if(parseInt(e_sub11.style.height)>=tamSub11){
					$('#sub11').animate({height:0}, {duration: 500});
				}else{
					$('#sub11').animate({height:tamSub11}, {duration: 500});
				}	
			});
			
			toggle_style('read11')
		}
		if(document.getElementById('sub12')){
			e_sub12=document.getElementById("sub12")
			var tamSub12=e_sub12.offsetHeight
			if(is_chrome){tamSub12+=50}
			e_sub12.style.height=0;
			$("#aLink12").click(function(e){
				e.preventDefault();
				if(parseInt(e_sub12.style.height)>=tamSub12){
					$('#sub12').animate({height:0}, {duration: 500});
				}else{
					$('#sub12').animate({height:tamSub12}, {duration: 500});
				}	
			});
			
			toggle_style('read12')
		}		
		
	});
	
	/*-----------------------------------------------
			Variables definidas
	-----------------------------------------------*/

	classN1='ampliarTexto3'
	classN2='ampliarTexto_off'

	/*-----------------------------------------------
		Function para determinar la visibilidad de un DIV
	-----------------------------------------------*/

	var lastId;
    function toggle_visibility(id,scrolear) {
       var e = document.getElementById(id);
       if(e.style.display == 'block'){
          e.style.display = 'none';
		  if(lastId!=undefined) lastId.style.display = 'none';
       }else{
	     e.style.display = 'block';
         if(lastId!=undefined){
			 if(lastId==e){lastId.style.display = 'block';}
			 else{lastId.style.display = 'none';}
		 }
	   }
	
	lastId=e;
    if(scrolear)scrolea();
    }

	/*-----------------------------------------------
		Function para cambiar estilo en un DIV
	-----------------------------------------------*/
	
	var lastId2;
	var classN1;
	var classN2;
  
    function toggle_style(id) {
       var x = document.getElementById(id);
	   if(x){
		   if(x.className == classN2){
			  x.className = classN1;
			  if(lastId2!=undefined) lastId2.className = classN1;
		   }else{
			 x.className = classN2;
			 if(lastId2!=undefined){ 
				if(lastId2==x){lastId2.className = classN2;}
				else{lastId2.className = classN1;}
			 }
		   }
		   lastId2=x;
	   }
    }
	
//-->
