var t;
var v = 1;
var langcode = "hu";

fokepek = new Array()
nevek = new Array()
cnt = new Array()
maxkep = new Array()

var m = document.getElementsByTagName('meta');
for(var i in m) {
   if(m[i].name == "language") {
     langcode = m[i].content.substr(0,2);
     break;
   }
}

fokepek[1] = new Array()
nevek[1] = "fokep" + 1;
cnt[1] = 2;
maxkep[1] = 3;
for (i=1; i <= maxkep[1]; i++){
  fokepek[1][i] = new Image()
  fokepek[1][i].src = "/images/ardin/home/" + langcode + "/0" + i + ".jpg"    
}

fokepek[2] = new Array()
nevek[2] = "fokep" + 2;
cnt[2] = 2;
maxkep[2] = 4;
for (i=1; i <= maxkep[2]; i++){
  fokepek[2][i] = new Image()
  fokepek[2][i].src = "/images/ardin/home/" + langcode + "/2" + i + ".jpg"    
}

function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            if (oldonload) {
                oldonload();
            }
            func();
        }
    }
}
 
addLoadEvent(function() {
    startAnim();
})

function startAnim()
{
    t = setTimeout("timedCount()",3000);    
}

function timedCount()
{
   document[nevek[v]].src = fokepek[v][cnt[v]].src;

   cnt[v] = cnt[v]+1;
   if(cnt[v] > maxkep[v]) cnt[v] = 1;

   v = v+1;
   if(v>2) v = 1;

   t = setTimeout("timedCount()",2000);
}


