//Navegador:
ie=0
n=0
n6=0


//Para que desaparezcan los textos, 1 para si, 0 para no
volver=0

//Tiempo entre noticias en milisegundos:
tiempo=10000

//Vuelve a empezar al acabar (0 para que no lo haga)
var loop=2

//Fuente
Fuente='verdana'

//Tamaņo fuente en pixel
Tfuente=11

//contador de los elementos del array
contador=0

//Colores, primero como background, ultimo color como se quiere que quede:
colors=new Array()
colors[0]='#EBEEFA'
colors[1]='#EEEEEE'
colors[2]='#CCCCCC'
colors[3]='#999999'
colors[4]='#666666'
colors[5]='#333333'
colors[6]='#000000'
//Noticias, usar # si no se quiere poner link

// numero de noticias a mostrar
numNoticiasRotables=0;
numNoticias=0;

   
	
if((navigator.appName=="Microsoft Internet Explorer")&&(parseInt(navigator.appVersion)>=4))
	ie=1;
else if((navigator.appName=="Netscape")&&(navigator.appVersion.indexOf("4.")>=0)) {
	n=1;
}
else if((navigator.appName=="Netscape")&&(navigator.appVersion.indexOf("5.")>=0)){
	n6=1;
}
else
	n6=1;


function Inicio(numRotables,maxNoticias)
{
	oNews1=new makeObj('divNews1','divCont1');
	numNoticiasRotables=numRotables;
	numNoticias=maxNoticias;
	Noticias(0)
}


function makeObj(obj,nest)
{	

	aux  = nest;
	
    nest=(!nest) ? '':'document.'+nest+'.'
    
    
    
    if (n)
    {
		this.writeref=eval(nest+'document.'+obj+'.document');
		this.css=eval(nest+'document.'+obj );
	}
	else if (ie){
		this.writeref=eval(obj);		
		this.css=eval(obj+'.style')
	}
	else if (n6){
		this.writeref=document.getElementById(aux);
		this.css=this.writeref.style;
	}
	
	this.Cambiar=b_Cambiar
    this.obj = obj + "Object"; 
    eval(this.obj + "=this")
    
}

function b_Cambiar(indice,font,size,speed,fn,num,c0,c1,c2,c3,c4,c5,c6)
{
	if(num < arguments.length  && arguments[num]!=0){
		writetext=""
		j=indice
		for (i=0; i < numNoticiasRotables ;i++){
			if (j >= numNoticias)
				j=0;
			
			
			// esto es con link
			writetext=writetext + '<br><a href="' + eval('news' + j + '["link"]') + '" onClick="javascript:windowopener(this.href,500,300); return false;">'
			+eval('news' + j + '["text"]') +'</a><br>' + eval('news' + j + '["desarrollo"]') + '<br>' 
			
			j ++;
			
		}
		
		if(n) 
		{
			
			this.writeref.write(writetext); 
			this.writeref.close();			
		}
		if(ie) this.writeref.innerHTML=writetext		
		if (n6)
			this.writeref.innerHTML=writetext; 
		
		
		num ++;
		
		setTimeout(this.obj + '.Cambiar(' + indice + ',"'+font+'",'+size+','+speed+',"'
		+fn+'",'+num+',"'+c0+'","'+c1+'","'+c2+'","'+c3+'","'+c4+'","'+c5+'","'+c6+'")',speed)
	}
}

function Noticias(num)
{	
	if(num < numNoticias)
	{	
		fn='Noticias('+(num+1)+')'
		MuestraRotable(fn,num,oNews1);
		num +=numNoticiasRotables;
		if (num >= numNoticias)
			num = 0;
		
	}
	setTimeout('Noticias('+num+')',tiempo)
}
function MuestraRotable(fn,num,objeto){
	objeto.Cambiar(num,Fuente,Tfuente,100,fn,6,
	colors[0],colors[1],colors[2],colors[3],colors[4],colors[5],colors[6])
}


