
/*Función para la navegación de las Fotos Dinámicas de Portada y de Articulos*/
function cambiaFeature(tipodecambio,nuevaFeature)
{
	/* 

	tipo de cambio = 0 el cambio de la Feature se hace por la forma recursiva
			= 1 el cambio de la Feature se hace por la navegación de las flechas
	
	*/

	if (tipodecambio == '0')
	{
		if (thisFeature==lastFeature)
			thisFeature=0;
		else
			thisFeature++;
	}
	else	
		thisFeature = nuevaFeature;
	
	var IZ = 0;	
	
	/* Se cambia la Feature y sus datos

	document.images['FeatureDinamica'].src=arrayFeature[thisFeature];
	document.getElementById("FeatureFA").innerHTML=arrayfa[thisFeature];
	document.getElementById("FeatureZoom").innerHTML=arrayimgzoom[thisFeature]; 

	*/

	document.getElementById("FeatureActual").innerHTML=arrayFeature[thisFeature];
	
	/*

	Si hay mas de una Feature se despliega la navegación de las Features por flechas 

	*/

	if (arrayFeature.length > 1)
	{
		Featureant = thisFeature;
		Featuresig = thisFeature;
		Featureant--;
		Featuresig++;
		if (Featureant < 0)
			Featureant = lastFeature;
		if (Featuresig > lastFeature)
			Featuresig = 0;
		var flechaant = '<a href="javascript:cambiaFeature(&quot;1&quot;,&quot;' + Featureant + '&quot;)"><img src="' + Basepath + '/imagenes2007/btn_ant_f.gif" width="8" height="65" border="0"/></a>';
		if (IZ !== ' ')
			 imgfd = "btn_sig_f.gif";
		else
			imgfd = "btn_sig_f.gif";
		var flechasig = '<a href="javascript:cambiaFeature(&quot;1&quot;,&quot;' + Featuresig + '&quot;)"><img src="' + Basepath + '/imagenes2007/' + imgfd + '" width="8" height="65" border="0"/></a>';
		document.getElementById("FeatureAnt").innerHTML = flechaant;
		document.getElementById("FeatureSig").innerHTML = flechasig;
	}

	/* 

	Si sólo hay una sóla Feature se valida si tiene FeatureZoom, si es así se despliega la imágen completa de la lupita

	else
	{	
		if (IZ !== ' ')
		{
			document.images['ImgZoom'].src = Basepath + 'libre/online/imggc/lupa_sola.gif';
			document.images['ImgZoom'].width = '23';
		}	
	}
	
	
	Si el tipo de cambio de Feature fué recursivo se habilita volver a cambiar la Feature en el tiempo establecido 

	*/

	if (tipodecambio == '0')
	{
		var recur_call = "cambiaFeature('0','')";
		if (arrayFeature.length > 1)
			timerID = setTimeout(recur_call, interval);
	}

     
	
}