/// ----------------------------------------------------------------------------
/// --- All elements copyright (c) 2002 - 2008 by
/// --- SFW - Stefan Falz Webconsulting
/// --- http://www.asp-solutions.de/
/// --- 
/// --- Unauthorized use is strongly prohibited
/// ----------------------------------------------------------------------------
/// --- Article JavaScript functions
/// ---
/// --- Created on: 28.02.2007 von SFW (SF)
/// ----------------------------------------------------------------------------
/// --- Last changed on  : 
/// --- Last changed from: 
/// --- Reason           : 
/// ----------------------------------------------------------------------------

var articles = new Array();

function Article( ID, Headline, Text, Date, Author )
    {
    this.ID       = ID;
    this.Headline = Headline;
    this.Text     = Text;
    this.Date     = Date;
    this.Author   = Author;
    }

function addArticle( ID, Headline, Text, Date, Author )
    {
    var article = new Article( ID, Headline, Text, Date, Author );
    articles.push( article );
    }

function getArticle( ID )
    {
    for( i=0; i < articles.length; i++ )
        {
        if( articles[ i ].ID == ID )
            {
            return( articles[ i ] );
            }
        }
    }

function writeArticleData( ID )
    {
    var article = getArticle( ID );
    if( article != null )
        {
        try
            {
            document.getElementById( "ArticleHeadline" ).innerHTML    = article.Headline;
            document.getElementById( "ArticleDescription" ).innerHTML = article.Text;
            document.getElementById( "ArticleDate" ).innerHTML        = article.Date;
            document.getElementById( "ArticleAuthor" ).innerHTML      = article.Author;
            }
        catch( e )
            {
            }
        }
    }
