var gWidthP=0;
var gHeightP=0;
var gExpandirDivP;
var divExpandirP;
var gWidthMaxP=700;
var gHeightMaxP=448;
var gTamyActualAExpandirDivP;
var gTamxActualAExpandirDivP;
var gObjetoAExpandirDivP;
var gFuncionExpandirObjetoDivP;

function ExpandirDivP(divExpandirP)
{
	//alert(divExpandirP);
	var objetoP=document.getElementById(divExpandirP);
	//alert(2);
	if (objetoP.getAttribute('abierto')=='0')
	{
		//alert(3);
		if(objetoP.id!='servicioRapido')
			document.getElementById('txtRapido').setAttribute('class','');
		if(objetoP.id!='servicioGeneral')
			document.getElementById('txtGeneral').setAttribute('class','');
		if(objetoP.id!='servicioNeumaticos')
			document.getElementById('txtNeumaticos').setAttribute('class','');
		if(objetoP.id!='servicioIndicaciones')
			document.getElementById('txtGestiones').setAttribute('class','');
		if(objetoP.id=='servicioRapido')
			document.getElementById('txtRapido').setAttribute('class','active2');
		if(objetoP.id=='servicioGeneral')
			document.getElementById('txtGeneral').setAttribute('class','active2');
		if(objetoP.id=='servicioNeumaticos')
			document.getElementById('txtNeumaticos').setAttribute('class','active2');
		if(objetoP.id=='servicioIndicaciones')
			document.getElementById('txtGestiones').setAttribute('class','active2');
		document.getElementById('servicioRapido').style.height=0;
		document.getElementById('servicioGeneral').style.height=0;
		document.getElementById('servicioNeumaticos').style.height=0;
		document.getElementById('servicioIndicaciones').style.height=0;
		document.getElementById('servicioRapido').setAttribute('abierto','0');
		document.getElementById('servicioGeneral').setAttribute('abierto','0');
		document.getElementById('servicioNeumaticos').setAttribute('abierto','0');
		document.getElementById('servicioIndicaciones').setAttribute('abierto','0');
		gWidthP=10;
		gHeightP=10;
		
		objetoP.setAttribute('abierto','1');
	}
	else
	{
		gWidthP=-10;
		gHeightP=-10;
		objetoP.setAttribute('abierto','0');
	}
	
	gObjetoAExpandirDivP=objetoP.id; 
	
		gFuncionExpandirObjetoDivP=setInterval('ExpandirObjetoDivP()',50);
}

function ExpandirObjetoDivP()
{
	if (gObjetoAExpandirDivP && gWidthMaxP && gHeightMaxP)
	{
		var objetoP=document.getElementById(gObjetoAExpandirDivP);
		
		gTamyActualAExpandirDivP=parseInt(objetoP.style.height);
		gTamxActualAExpandirDivP=parseInt(objetoP.style.width);
		
		if (objetoP)
		{
			gTamyActualAExpandirDivP+=gHeightP;
			gTamxActualAExpandirDivP+=gWidthP;
			
			if (gTamyActualAExpandirDivP<=gHeightMaxP)
			{
				 objetoP.style.height=gTamyActualAExpandirDivP + 'px';
				//objeto.style.width=gTamxActualAExpandirDiv + 'px';
			}
			else
				clearInterval(gFuncionExpandirObjetoDivP);	
		}
	}
}
