// JavaScript Document


var imagenes = [
    "http://www.actioncare.net/ac/usuario/img/ico_02_AP.png",
    "http://www.actioncare.net/ac/usuario/img/ico_02_AP.png",
    "http://www.actioncare.net/ac/usuario/img/ico_02_AP.png",
    "http://www.actioncare.net/ac/usuario/img/ico_02_AP.png",
    "http://www.actioncare.net/ac/usuario/img/ico_02_AP.png",
    "http://www.actioncare.net/ac/usuario/img/ico_02_AP.png",
    "http://www.actioncare.net/ac/usuario/img/ico_02_AP.png"
];

var enlaces = [
    "http://www.sucaricatura.com/2002/maxi/2002H001.jpg",
    "http://www.sucaricatura.com/2002/mini/2002H002.jpg",
    "http://www.sucaricatura.com/2002/maxi/2002H003.jpg",
    "http://www.sucaricatura.com/2002/mini/2002H004.jpg",
    "http://www.sucaricatura.com/2002/maxi/2002H005.jpg",
    "http://www.sucaricatura.com/2002/mini/2002H006.jpg",
    "http://www.sucaricatura.com/2002/maxi/2002H007.jpg"
];

function azar()    {
    var temp = new Array(4);
    temp[0] = Math.floor(Math.random() * imagenes.length);
    do
        temp[1] = Math.floor(Math.random() * imagenes.length);
    while (temp[0] == temp[1])
    do
        temp[2] = Math.floor(Math.random() * imagenes.length);
    while (temp[0] == temp[1] || temp[0] == temp[2] || temp[1] == temp[2])
    do
        temp[3] = Math.floor(Math.random() * imagenes.length);
    while (    temp[0] == temp[1] ||
        temp[0] == temp[2] ||
        temp[1] == temp[2] ||
        temp[0] == temp[3] ||
        temp[1] == temp[3] ||
        temp[2] == temp[3]
)
//    alert(document.links.length);
    document.getElementById("enlace1").setAttribute("href", enlaces[temp[0]]);
    document.getElementById("enlace2").href = enlaces[temp[1]];
    document.getElementById("enlace3").href = enlaces[temp[2]];
    document.getElementById("enlace4").href = enlaces[temp[3]];
    document.images.imagen1.src = imagenes[temp[0]];
    document.images.imagen2.src = imagenes[temp[1]];
    document.images.imagen3.src = imagenes[temp[2]];
    document.images.imagen4.src = imagenes[temp[3]];
}


function ini() {
  var direcciones = new Array("producto1.html")
  aleat = Math.random() * direcciones.length;
  aleat = Math.floor(aleat);
  producto_rotacion.location=direcciones[aleat];
}

