/*var newsArray = {
 1:{'date':'June 23 2010',
    'news':'> Delenisl emin dolore do del ex delendre consed min euis addo delis dio. On hent alis eugit lums andion utet quis dit duis velisscte vero'
    },
 2:{'date':'July 2 2010',
    'news':'> Selendre consed min wuisd lums andion addo delis dio han. Mon pili ex delendre andio'
    },
 3:{'date':'May 17 2010',
    'news':'> Transil is edpici renelait no metnaio smenio aostin roan bolues i can ricstlie alen f isoijej erolas jdofij aoisdf alksjd f'
    },
 4:{'date':'April 6 2010',
    'news':'> Antil i wor said isti locan itra be ras edein belos dubia wot wi len do sot tie animin euis addo delis dio'
    }
};*/
//var numNews = 0; for (var i in newsArray) numNews++;
var currentNews = 1;

function rotateNewsViewer(){
 newsViewerLoadScroll(currentNews);
 currentNews = (currentNews>=numNews ? 1 : currentNews+1);
 setTimeout('rotateNewsViewer()',5000);
 }

function newsViewerLoadFade(news) {
 currentNews = news;
 var windowHTML = ''
+'<!--font style="display:block;height:17px;"><img SRC="images/maketextww.php?text='+newsArray[news]['date']+'&c=99d3f9&bgc=3273aa&font=helvetica-regular.ttf&size=11" /></font-->'
+'<p>'+newsArray[news]['news']+'</p>';
 jQuery('#news-window2').show();
 getElem("news-window2").innerHTML = getElem("news-window1").innerHTML;
 jQuery('#news-window1').hide();
 getElem("news-window1").innerHTML = windowHTML;
 jQuery('#news-window2').fadeOut(500);
 setTimeout("jQuery('#news-window1').fadeIn(500);",100);
}

function newsViewerLoadScroll(news) {
 currentNews = news;
 var windowHTML = ''
+'<!--font style="display:block;height:17px;"><img SRC="images/maketextww.php?text='+newsArray[news]['date']+'&c=99d3f9&bgc=3273aa&font=helvetica-regular.ttf&size=11" /></font-->'
+'<p>'+newsArray[news]['news']+'</p>';
 getElem("news-window2").innerHTML = getElem("news-window1").innerHTML;
 jQuery('#news-window2').css({
     top: '0px'
     });
 jQuery('#news-window1').css({
     top: '150px'
     });
 getElem("news-window1").innerHTML = windowHTML;
 jQuery('#news-window2').animate({
     top: '-150'
     }, {
     duration: 500
     });
 jQuery('#news-window1').animate({
     top: '0'
     }, {
     duration: 500
     });
}

function open_interchange_map() {
    jQuery('#interchange-map-container img').stop().animate({
     opacity: 0
     }, {
     duration: 400,
     easing: 'linear',
     complete: function(){
     }});
      jQuery('#interchange-map-container img').css({'display':'none'});
      jQuery('#interchange-map').stop().animate({
       width: 1022,
       height: 748,
       top: -274,
       right: -20/*25*/
       }, {
        duration: 400
       ,easing: 'easeOutQuad'
       ,complete:function(event){
        jQuery('#indicator').css({display:'block'});
        jQuery('#interchange-animation').css({display:'block'});
        }
       });
//jQuery('#indicator').css({ top:'600px',left:'900px' })
//.animate({ top:'200px', left:'400px' },1000,'easeOutQuad',function(e){  })
//;

jQuery('#indicator').css({display:'none'});
jQuery('#interchange-animation').css({display:'none'});
}
function close_interchange_map(){
    jQuery('#interchange-map').stop().animate({
     width: 188,
     height: 68,
     top: 0,
     right: 0
     }, {
     duration: 400,
     easing: 'easeOutQuad',
     complete: function(){
      jQuery('#interchange-map-container img').css({'display':'block'});
      jQuery('#interchange-map-container img').stop().animate({
       opacity: 1
       }, {
       duration: 400,
       easing: 'linear'
       });
     }});
}
