// determine yOffset for main nav
function yOffset() {
    // if there is no .php in the path or we're on index.php, then we're on the home page
    // and we need to take into account the extra image on that page
    if (location.pathname.indexOf('.php') == -1 || location.pathname.indexOf('index.php') >= 0)
        return 303;

    // otherwise, we're on a normal page
    return 133;
}

// return the proper "home" URL
function homeURL() {
    // if 'localhost' is in the URL, then we are NOT on the live site
    if (location.href.indexOf('localhost') >= 0)
        return "/grc/";

    // otherwise, we're on the live site
    return "/";
}

/*
 *  English menus
 */
var MENU_ITEMS = [
    {pos:[0,yOffset()], leveloff:[23,0], style:STYLE1, delay:150},
    {code:"Home", url:homeURL(), size:[23,68]},
    {code:"Company Overview", url:"overview.php", itemoff:[0,68], size:[23,142]},
    {code:"Projects", url:"projects.php", itemoff:[0,142], size:[23,79],
        sub:[
            {itemoff:[23,0], size:[23,165], style:STYLE2},
            {code:"El Aguila", url:"project-ea.php"},
            {code:"&nbsp;&nbsp;Construction Progress", url:"presentation/progress/player.html", target:"_blank"},
            {code:"Las Margaritas", url:"project-lm.php"},
            {code:"El Rey", url:"project-er.php"},
            {code:"Solaga", url:"project-so.php"},
            {code:"Alta Gracia", url:"project-ag.php"}
       
        ]
    },
    {code:"Community", url:"community.php", itemoff:[0,79], size:[23,98],
        sub:[
            {itemoff:[23,0], size:[23,125], style:STYLE2},
            {code:"English Report", url:"content/Community%20English.pdf"},
            {code:"Spanish Report", url:"content/Community%20Spanish.pdf"}
        ]
    },
    {code:"Management", url:"team.php", itemoff:[0,98], size:[23,105]},
    {code:"Investor Information", url:"investor.php", itemoff:[0,105], size:[23,151],
        sub:[
            {itemoff:[23,0], size:[23,220], style:STYLE2},
            {code:"News Releases", url:"news-releases.php"},
            {code:"GRC One Page", url:"content/GRC%20One%20Page.pdf"},
            {code:"GRC Presentation", url:"presentation/company/player.html", target:"_blank"},
            {code:"Research Reports", url:"reports.php"},
            {code:"Webcast Presentations", url:"webcasts.php"},
            {code:"SEC Filings", url:"http://www.sec.gov/cgi-bin/browse-edgar?company=Gold+Resource+Corp&CIK=&filenum=&State=&SIC=&owner=include&action=getcompany", target:"_blank"},
            {code:"Annual Reports", url:"annual-reports.php"},
            {code:"Code of Ethics", url:"content/GRC%20Code%20of%20Ethics.pdf"},
            {code:"Conference Calls", url:"conference-calls.php"},
            {code:"Receive GRC news and updates", url:"email-list.php"}
        ]
    },
    {code:"Contact", url:"contact.php", itemoff:[0,151], size:[23,77]}
];

var PROJECT_ITEMS = [
    {pos:[15,189], itemoff:[32,0], leveloff:[0,157], style:VERT_BOX, size:[33,157], zIndex:998, delay:150},
    {code:"El Aguila", url:"project-ea.php"},
    {code:"&nbsp;Construction Progress", url:"presentation/progress/player.html", target:"_blank"},
    {code:"Las Margaritas", url:"project-lm.php"},
    {code:"El Rey", url:"project-er.php"},
    {code:"Solaga", url:"project-so.php"},
    {code:"Alta Gracia", url:"project-ag.php"}
];

var INV_ITEMS = [
    {pos:[15,189], itemoff:[32,0], leveloff:[0,130], style:VERT_BOX, size:[33,130], delay:150},
    {code:"News Releases", url:"news-releases.php"},
    {code:"GRC One Page", url:"content/GRC%20One%20Page.pdf"},
    {code:"GRC Presentation", url:"presentation/company/player.html", target:"_blank"},
    {code:"Research Reports", url:"reports.php"},
    {code:"Webcast Presentations", url:"webcasts.php"},
    {code:"SEC Filings", url:"http://www.sec.gov/cgi-bin/browse-edgar?company=Gold+Resource+Corp&CIK=&filenum=&State=&SIC=&owner=include&action=getcompany", target:"_blank"},
    {code:"Annual Reports", url:"annual-reports.php"},
    {code:"Code of Ethics", url:"content/GRC%20Code%20of%20Ethics.pdf"},
    {code:"Conference Calls", url:"conference-calls.php"},
    {code:"Receive GRC news and updates", url:"email-list.php"}
];

var PROJECT_EA_DRILL_DATA = [
    {pos:[197,189], style:VERT_BOX, size:[33,135], zIndex:999, delay:50},
    {code:"Drilling Data / Maps", url:"drilling-data.php"}
];

var COMMUNITY_REPORT_ENGLISH = [
    {pos:[30,187], style:VERT_BOX, size:[33,120], zIndex:999, delay:50},
    {code:"English Report", url:"content/Community%20English.pdf"}
];

var COMMUNITY_REPORT_SPANISH = [
    {pos:[170,187], style:VERT_BOX, size:[33,120], zIndex:999, delay:50},
    {code:"Spanish Report", url:"content/Community%20Spanish.pdf"}
];

/*
 *  German menus
 */
var MENU_ITEMS_DE = [
    {pos:[0,yOffset()], leveloff:[23,0], style:STYLE1, delay:150},
    {code:"Unternehmensüberblick", url:"overview.php", size:[23,165]},
    {code:"Projekte", url:"projects.php", itemoff:[0,165], size:[23,80],
        sub:[
            {itemoff:[23,0], size:[23,125], style:STYLE2},
            {code:"El Aguila", url:"project-ea.php"},
            {code:"Las Margaritas", url:"project-lm.php"},
            {code:"El Rey", url:"project-er.php"},
            {code:"Solaga", url:"project-so.php"},
            {code:"Fotos", url:"drilling.php"}
        ]
    },
    {code:"Bevölkerung", url:"community.php", itemoff:[0,80], size:[23,110]},
    {code:"Management", url:"team.php", itemoff:[0,110], size:[23,110]},
    {code:"Informationen für Investoren", url:"investor.php", itemoff:[0,110], size:[23,165],
        sub:[
            {itemoff:[23,0], size:[23,230], style:STYLE2},
            {code:"Pressemitteilungen", url:"http://www.aktiencheck.de/news/suche.m?suchbegriff=US38068T1051", target:"_blank"},
            {code:"Forschungsberichte", url:"reports.php"},
            {code:"Webcast-Präsentationen", url:"webcasts.php"},
            {code:"SEC-Berichte", url:"http://www.sec.gov/cgi-bin/browse-edgar?company=Gold+Resource+Corp&CIK=&filenum=&State=&SIC=&owner=include&action=getcompany", target:"_blank"},
            {code:"CEO-Interview mit Contrary Investors Cafe", url:"http://www.contraryinvestorscafe.com/broadcast.php?media=107", target:"_blank", size:[33,230]},
            {code:"Nachrichten und Neuigkeiten zu GRC abonnieren", url:"../email-list.php", itemoff:[33,0], size:[33,230]}
        ]
    },
    {code:"Kontakt", url:"contact.php", itemoff:[0,165], size:[23,90]}
];

var PROJECT_ITEMS_DE = [
    {pos:[15,189], itemoff:[32,0], leveloff:[0,130], style:VERT_BOX, size:[33,130], delay:150},
    {code:"El Aguila", url:"project-ea.php"},
    {code:"Las Margaritas", url:"project-lm.php"},
    {code:"El Rey", url:"project-er.php"},
    {code:"Solaga", url:"project-so.php"},
    {code:"Fotos", url:"drilling.php"}
];

var INV_ITEMS_DE = [
    {pos:[15,206], itemoff:[32,0], leveloff:[0,165], style:VERT_BOX, size:[33,165], delay:150, zIndex:999},
    {code:"Pressemitteilungen", url:"http://www.aktiencheck.de/news/suche.m?suchbegriff=US38068T1051", target:"_blank"},
    {code:"Forschungsberichte", url:"reports.php"},
    {code:"Webcast-Präsentationen", url:"webcasts.php"},
    {code:"SEC-Berichte", url:"http://www.sec.gov/cgi-bin/browse-edgar?company=Gold+Resource+Corp&CIK=&filenum=&State=&SIC=&owner=include&action=getcompany", target:"_blank"},
    {code:"CEO-Interview mit Contrary Investors Cafe", url:"http://www.contraryinvestorscafe.com/broadcast.php?media=107", target:"_blank"},
    {code:"Nachrichten und Neuigkeiten zu GRC abonnieren", url:"email-list.php", size:[43,165]}
];

var PROJECT_EA_DRILL_DATA_DE = [
    {pos:[167,189], style:VERT_BOX, size:[33,168], zIndex:999, delay:50},
    {code:"Bohrergebnisse / Karten", url:"drilling-data.php"}
];
