

// objects
function footerItem( argText, argLink ) {
    this.text = argText;
    this.link = argLink;
}

function mapCoords( argLink, argAlt, argCoords ) {
    this.link = argLink;
    this.alt = argAlt;
    this.coords = argCoords;
}

// footer array
var footerMenu = [
    new footerItem( "©2008 Chrysler Sweden AB", "javascript:flexWin('/privacy/copyright.html', 'yes', 571, 625);" ), 
    new footerItem( "Förbehåll & Cookies", "javascript:flexWin('/privacy/cookies.html', 'yes', 571, 625);" )
];

// map array
var imageMap = [
    new mapCoords( 'http://www.chrysler.se', 'Chrysler', '110,15,205,50' ), 
    new mapCoords( 'http://www.jeep.se', 'Jeep', '210,15,258,50' ), 
    new mapCoords( 'http://www.dodge.se', 'Dodge', '50,15,90,50' )
];

// methods
function drawFooter() {
    var obj = footerMenu;
    var str = '<span class="footer">';
    for( var i = 0; i < obj.length; i++ ) {
        if( obj[i].link == "" ) {
            str += obj[i].text;
        } else {
            str += '<a class="footer" href="' + obj[i].link + '" name="&lpos=footer">';
            str += obj[i].text;
            str += '</a>';
        }
        if( i < obj.length-1 )
            str += ' | ';
    }
    str += '</span>';
    str += '<br /><img src="/img/footer_se.gif" border="0" usemap="#footerMap" />';
    document.write( str );
}

function drawMap() {
    var obj = imageMap;
    var str = '<map name="footerMap">';
    for( var i = 0; i < obj.length; i++ ) {
        if( obj[i].link != "" )
            str += '<area href="' + obj[i].link + '" alt="' + obj[i].alt + '" coords="' + obj[i].coords + '" />';
    }
    str += '</map>';
    document.write( str );
}

// draw
drawMap(); drawFooter();

