var cantidad = 6;
var flyer = new Array()
var flyer2 = new Array()

for(a=0;a<=cantidad-1;a++){
	flyer[a]=a+1
	flyer2[a]=0
};

function aleatorio(inferior,superior){
    numPosibilidades = superior - inferior
    aleat = Math.random() * numPosibilidades
    aleat = Math.floor(aleat)
    return parseInt(inferior) + aleat
};
function rotar(){
	for(a=0;a<=cantidad-1;a++){
		c=0
		while(c==0){
			b=aleatorio(-1,cantidad)
				if (flyer2[b]==0){
				 	flyer2[b]=flyer[a]
					c=1
				}
		}
	}
texto ='<table width="490" border="0" cellpadding="0" cellspacing="0" bgcolor="#000000"><tr><td height="25" colspan="3" align="left" scope="col"><img src="imagenes/letras/destacado.gif" width="99" height="16" /></td></tr>';
b=0;
for(a=0;a<=cantidad-1;a++){
	if (b==0){
			texto+='<tr>';
	}
	texto +='<td align="center" scope="col"><a href="eventos.php?f='+flyer2[a]+'"><img src="portada/flyer'+flyer2[a]+'.gif" width="243" height="155" border="0" /></a></td><td bgcolor="#FF6600" scope="col">';
	if (b==1){
			texto+'</td></tr>';
			b=0;
	}else{
	texto +='<img src="imagenes/dummy.gif" width="1" height="1" /></td>'
	b=b+1
	}
}
texto+='</table>';
document.getElementById("flayers").innerHTML = texto;
}

