// JavaScript Document

var pic_sets = {

preload:true, // set to true or false

// first image in each set should be the corresponding image tag's actual src image.
// each set may have as many images as you like, other sets may be added.

pic_set_1:['img/index/bild1_titelbild.jpg', 'img/index/bild2_inlay.jpg'],

///////////////// Stop Editing /////////////////

change:function(el){
var a=pic_sets[el.id];
for (var re, pnum = 0, i = a.length - 1; i > -1; --i){
re = new RegExp(a[i]);
if(re.test(el.src))
pnum = i;
}
pnum = pnum < a.length - 1? pnum + 1 : 0;
el.src = a[pnum];
}
};

(function(){
if (!pic_sets.preload)
return;
var im = [];
for (var p in pic_sets)
if(/pic_set/.test(p))
for (var i = pic_sets[p].length - 1; i > 0; --i){
im[im.length] = new Image();
im[im.length - 1].src = pic_sets[p][i];
}
})();


