var tm;
var a;
var cont = 0;

function initRule(path, cad) {
ai = new Array();

    tm = window.setInterval('cambiaFoto(path)',5000)
    a = cad.split('#')
    
    //preload
    
    for (var i=0; i<a.length; i++) {
        ai[i] = new Image;
        ai[i].src = a[i]
    }
}


function cambiaFoto(path) {
var img_ruleId = document.getElementById("ruleId")

    cont=cont+1
    if ( cont > a.length-1 ) cont = 0;
    
    img_ruleId.filters.blendTrans.Apply()
    img_ruleId.src = path + a[cont]
    img_ruleId.filters.blendTrans.play()

}


function initRule2(imgId, path, cad) {
ai = new Array();

    tm = window.setInterval('cambiaFoto2("' + imgId + '", path)',5000)
    a = cad.split('#')
    
    //preload
    
    for (var i=0; i<a.length; i++) {
        ai[i] = new Image;
        ai[i].src = a[i]
    }
}
  
  
function cambiaFoto2(imgId, path) {
var img_ruleId = document.getElementById(imgId)


    cont=cont+1
    if ( cont > a.length-1 ) cont = 0;
    
    img_ruleId.filters.blendTrans.Apply()
    img_ruleId.src = path + a[cont]
    img_ruleId.filters.blendTrans.play()

}

  