var map_updater = function(page_name) 
{
    // make sure none of the array you actually use had length = 0
    var maps = {
        front_page : [   
            { 
              place : "Tel Aviv, Gush Dan, Israel",
              mapUrl : "http://prod1.decell.com/website/7.gif" ,
              time : "mapUpdater/il-time.php"
            },

            { 
              place : "Vienna, Austria",
              mapUrl : "http://prod1.decell.com/a1/web1a/Austria_circle.gif" ,
              time : "mapUpdater/at-time.php"
            },
			
			{ 
              place : "Prague, The Czech Republic",
              mapUrl : "http://prod3.decell.com/Czech/web/Praha_circle.gif" ,
              time : "mapUpdater/cz-time.php"
            },
			
			{ 
              place : "Warsaw, Poland",
              mapUrl : "http://prod3.decell.com/poland/web/Poland_circle.gif" ,
              time : "mapUpdater/pl-time.php"
            },
			
			{ 
              place : "Bratislava, Slovakia",
              mapUrl : "http://prod3.decell.com/slovakia/web/bratislava_circle.gif" ,
              time : "mapUpdater/sk-time.php"
            },
			
			
            
        ] ,
        live_system : [
            { 
              place : "Tel Aviv, Gush Dan, Israel",
              mapUrl : "http://prod1.decell.com/website/8.gif" ,
              time : "mapUpdater/il-time.php"
            },

            { 
              place : "Vienna, Austria",
              mapUrl : "http://prod1.decell.com/a1/web1a/Austria_circle2.gif" ,
              time : "mapUpdater/at-time.php"
            },
			
			{ 
              place : "Prague, The Czech Republic",
              mapUrl : "http://prod3.decell.com/Czech/web/Praha_circle2.gif" ,
              time : "mapUpdater/cz-time.php"
            },

            { 
              place : "Warsaw, Poland",
              mapUrl : "http://prod3.decell.com/poland/web/Poland_circle2.gif" ,
              time : "mapUpdater/pl-time.php"
            },
			
			{ 
              place : "Bratislava, Slovakia",
              mapUrl : "http://prod3.decell.com/slovakia/web/bratislava_circle2.gif" ,
              time : "mapUpdater/sk-time.php"
            },


        
        
        ] } ;
        
    var currentIndex = -1;
    
    var replaceMap = function()
    {
        currentIndex = (currentIndex + 1) % maps[page_name].length;     // advance the current map index 

        $("#live_map").attr("src", maps[page_name][currentIndex].mapUrl);
        $("#live_location").text(maps[page_name][currentIndex].place);
        $("#live_time").load(maps[page_name][currentIndex].time);
    }
    
    replaceMap();
    setInterval(replaceMap,1000*5);    
}



