//Set the array of big images using on site
/////var bimgs = [[],['cocktail_dresses.jpg','dress_advanced_search.jpg','evening_dresses.jpg','find_a_store.jpg','media_gallery.jpg','mother_of_the_bride.jpg','news.jpg','node_11.jpg','node_3.jpg','prom_dresses.jpg']];
var pointer = [,0,0,0];
var millisec = 2000;
var timeout = 0;	//initial timeout (LOADING SPEED UP)

function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}

function autoScrolling(bid) {	// bid = blockid
	
		//alert("bid="+bid+"; column="+column+";");
		var speed = Math.round(millisec / 100);
    var timer = 0;
    
    //set the current image as background
    document.getElementById('blenddiv'+bid).style.backgroundImage = "url(" + document.getElementById('blendimage'+bid).src + ")";
    
    //make image transparent
    changeOpac(0, 'blendimage'+bid);
    
  	pointer[bid]++;
  	if (pointer[bid] > (bimgs[bid].length - 1) ) pointer[bid] = 0;
    
    //make new image
    document.getElementById('blendimage'+bid).src = ''+bimgs[bid][pointer[bid]];

    //fade in image
    for(i = 0; i <= 100; i++) {
        setTimeout("changeOpac(" + i + ",'blendimage"+bid+"')",(timer * speed));
        timer++;
    }
    
    column = column + 1;
    timeout = 4000;	//regular timeout after the first iteration
    
    if (column == algorithm.length) column = 1;	//null
    bid = algorithm[column]; 
    window.setTimeout('autoScrolling('+bid+')', timeout);
}
