function lclink( str, href ) {
    this.str = str;
    this.href = href;
}

var mainLinkArray = new Array();
mainLinkArray[0] = new lclink("About Local Colors", "index.html");
mainLinkArray[1] = new lclink("Education", "education.html");
mainLinkArray[2] = new lclink("Services", "services.html");
mainLinkArray[3] = new lclink("Events", "events.html");
mainLinkArray[4] = new lclink("Taste of Culture", "taste.html");
mainLinkArray[5] = new lclink("Countries&nbsp;&amp;&nbsp;Vendors", "countries_vendors.htm");
mainLinkArray[6] = new lclink("Photos", "photos.html");
mainLinkArray[7] = new lclink("Press", "press.html");
mainLinkArray[8] = new lclink("Links", "links.html");
mainLinkArray[9] = new lclink("Legal", "legal.html");

function makeFooter() {
    var fname = document.location.pathname.substr( document.location.pathname.lastIndexOf("/")+1 );
    var str = "";
    for (var i = 0 ; i < mainLinkArray.length ; i++ ) {
        str += "[";
        if (fname != mainLinkArray[i].href) {
            str += "<a href='" + mainLinkArray[i].href + "'>" + mainLinkArray[i].str + "</a>";
        } else {
            str += mainLinkArray[i].str ;
        }
        str += "] ";
    }
    document.getElementById("footerLinks").innerHTML = str;
}

function makeSashLinks() {
    var fname = document.location.pathname.substr( document.location.pathname.lastIndexOf("/")+1 );
    var str = "";
    for (var i = 0 ; i < mainLinkArray.length ; i++ ) {
        if ( mainLinkArray[i].str != "Legal" ) {
            if ( i == 0 ) {
                customStyle =  "style='margin-top: 15px;'";
            } else {
                customStyle = "";
            }
            if (fname != mainLinkArray[i].href) {
                str += "<a href='../html/" + mainLinkArray[i].href + "' class='rollover'>"
                str += "<div class='rollover out' " + customStyle
                str += "   onMouseOver=\"W_roll( this, 'over' )\""
                str += "   onMouseOut=\"W_roll( this, 'out' )\">"
                str += mainLinkArray[i].str
                str += "</div>"
                str += "</a>"
            } else {
                str += "<div class='rollover on'"  + customStyle + ">"
                str += mainLinkArray[i].str
                str += "</div>"
            }
        }
    }

    str += "<p>"
    str += "<div class='leftsash'>"
    str += "<p><b>Local Colors</b> highlights the ethnic and cultural diversity of the Roanoke Valley."
    str += "It has opened the minds and hearts of many, enriching the quality of life for all who have "
    str += "been part of it.</p>"
    str += "<p>Pearl Fu <br>Executive Director &nbsp;"
    str += "<br><a href='mailto:pearlfu@aol.com'>Contact Local Colors</a></p>"
    str += "</div>"

    str += "<p class='logotext'>"
    str += "<br><a href='http://www.jeffcenter.org/'>"
    str += "<img width='79' height='100' src='../images/Jefferson_Cnter.jpg' border='0'></a>"
    str += "<br><b>Located in the<br>Jefferson Center</b>"
    str += "<br>541 Luck Avenue"
    str += "<br>Suite # 228"
    str += "<br>Roanoke, VA 24016"
    str += "<br>540-904-2234"
    str += "</p>"

    document.getElementById("sashLinks").innerHTML = str;
}

function makeSponsorLinks() {
    var str = "";
    str += "<p align=\"center\">"
    str += "  <a href=\"http://www.suntrust.com/portal/server.pt\">"
    str += "  <img width=\"110\" align=\"middle\" height=\"61\" src=\"../images/Suntrust_Logo_110.jpg\" border=\"0\" alt=\"SunTrust\"></a>"
    str += "    &nbsp; &nbsp; "
    str += "  <a href=\"http://www.cox.com/roanoke/\">"
    str += "  <img width=\"100\" align=\"middle\" height=\"58\" src=\"../images/cox_2009.jpg\" border=\"0\" alt=\"Cox Communications\"></a>"
    str += "    &nbsp; &nbsp; "
    str += "  <a href=\"http://www.roanokeva.gov/85256A8D0062AF37/vwContentByKey/N264GSDL482JEASEN/$File/RoanokevaHomePage.html\">"
    str += "  <img width=\"122\" align=\"middle\" src=\"../images/roanoke.gif\" border=\"0\" alt=\"The City of Roanoke\"></a>"
    str += "    &nbsp; &nbsp; "
    str += "  <a href=\"http://www.kroger.com/homepage/index.htm\">"
    str += "  <img width=\"105\" align=\"middle\" height=\"86\" src=\"../images/kroger_small.jpg\" border=\"0\" alt=\"Kroger\"></a>"
    str += "    &nbsp; &nbsp; "
    str += "  <a href=\"http://www.pepsi.com/home.php\">"
    str += "  <img width=\"60\" align=\"middle\" height=\"60\" src=\"../images/pepsi.gif\" border=\"0\" alt=\"Pepsi\"></a>"
    str += "    &nbsp; &nbsp; "
//    str += "  <a href=\"http://www.wdbj7.com/\">"
//    str += "  <img width=110 align=\"middle\" height=37 src=\"../images/WDBJLogo.jpg\" border=\"0\" alt=\"WDBJ7\"></a>"
    str += "  <a href=\"http://www.nightvision.com/\">"
    str += "  <img width=110 align=\"middle\" height=86 src=\"../images/ITT.jpg\" border=\"0\" alt=\"ITT Corporation\"></a>"
//    str += "  <a href=\"http://www.uscellular.com/\">"
//    str += "  <img width=202 align=\"left\" height=59 src=\"../images/uscc_logo.gif\" border=\"0\" alt=\"US Cellular\"></a>"
    str += "  <a href=\"http://www.carilionclinic.org\">"
    str += "  <img width=188 align=\"right\" height=70 src=\"../images/Carilion-logo.png\" border=\"0\" alt=\"Carilion\"></a>"
    str += "  <a href=\"http://www.nscorp.com/nscportal/nscorp/\">"
    str += "  <img width=188 align=\"right\" height=70 src=\"../images/NSlogo.gif\" border=\"0\" alt=\"Norfolk Southern Foundation\"></a>"

    str += "</p>"

    document.getElementById("sponsorLinks").innerHTML = str;
}

function preparePage() {
    if ( document.getElementById("sashLinks") != null ) {
        makeSashLinks();
    }
    if ( document.getElementById("sponsorLinks") != null ) {
        makeSponsorLinks();
    }
    if ( document.getElementById("footerLinks") != null ) {
        makeFooter();
    }
    if ( document.getElementById("flagstrip") != null ) {
//        makeFlagStrip();
    }
}

var countries = new Array();
countries[0] = "argentina";
countries[1] = "bangladesh";
countries[2] = "brazil";
countries[3] = "chile";
countries[4] = "china";
countries[5] = "colombia";
countries[6] = "cuba";
countries[7] = "ethiopia";
countries[8] = "france";
countries[9] = "germany";
countries[10] = "ghana";
countries[11] = "greece";
countries[12] = "honduras";
countries[13] = "india";
countries[14] = "iran";
countries[15] = "ireland";
countries[16] = "italy";
countries[17] = "japan";
countries[18] = "kenya";
countries[19] = "korea";
countries[20] = "lebanon";
countries[21] = "mexico";
countries[22] = "norway";
countries[23] = "pakistan";
countries[24] = "peru";
countries[25] = "poland";
countries[26] = "russia";
//  countries[27] = "scotland";
countries[27] = "spain";
countries[28] = "sudan";
countries[29] = "sweden";
countries[30] = "thailand";
countries[31] = "unitedkingdom";
countries[32] = "vietnam";

function makeFlagStrip() {
    var str; str = "";
    for ( var i = 0 ; i < countries.length ; i++ ) {
        str += makeFlag( countries[i] );
    }
    document.getElementById("flagstrip").innerHTML = str;
    str = "";
    for ( var i = countries.length - 1 ; i >= 0 ; i-- ) {
        str += makeFlag( countries[i] );
    }
    document.getElementById("flagstrip2").innerHTML = str;
}

function makeFlag( country ) {
    var str;
    str = "<img align='bottom' src='../images/flags/" + country + "2.gif' ";
    str += " width='60px;' height='40px;' title='" + country + "'><br>";
    return str;
}