var Y_OFFSET = 133;
var HOME_PAGE_Y_OFFSET = Y_OFFSET + 170;

// determine yOffset for main nav
function yOffset() {
    /*
     * we're on the home page if
     *   - admin is not in the path and there is no .php in the path
     */
    if (location.pathname.indexOf('admin') == -1 && location.pathname.indexOf('.php') == -1) {
        // we need to take into account the extra banner image on the home page
        return HOME_PAGE_Y_OFFSET;
    }

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

function xOffset(xpos) {
	return xpos;
}

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

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

/*
 *  English menus
 */
var MENU_ITEMS = [
    {pos:[xOffset(0),yOffset()], leveloff:[23,0], style:STYLE1, delay:150},
    {code:"Home", url:homeURL(), size:[23,68]},
    {code:"Company Overview", url:homeURL()+"overview.php", itemoff:[0,68], size:[23,142]},
    {code:"Projects", url:homeURL()+"projects.php", itemoff:[0,142], size:[23,79],
        sub:[
            {itemoff:[23,0], size:[23,165], style:STYLE2},
            {code:"El Aguila", url:homeURL()+"project-ea.php"},
            {code:"&nbsp;&nbsp;Project Photos", url:homeURL()+"presentation/progress/player.html", target:"_blank"},
            {code:"&nbsp;&nbsp;2011 Photo Book", url:homeURL()+"content/2011 Photo Book.pdf", target:"_blank"},
            {code:"Las Margaritas", url:homeURL()+"project-lm.php"},
            {code:"El Rey", url:homeURL()+"project-er.php"},
            {code:"Solaga", url:homeURL()+"project-so.php"},
            {code:"Alta Gracia", url:homeURL()+"project-ag.php"}
       
        ]
    },
    {code:"Community", url:homeURL()+"community.php", itemoff:[0,79], size:[23,98],
        sub:[
            {itemoff:[23,0], size:[23,170], style:STYLE2},
            {code:"Community Participation", url:homeURL()+"content/Community%20Participation%202010.pdf"}
        ]
    },
    {code:"Management", url:homeURL()+"team.php", itemoff:[0,98], size:[23,105]},
    {code:"Investor Information", url:homeURL()+"investor.php", itemoff:[0,105], size:[23,151],
        sub:[
            {itemoff:[30,0], size:[30,180], style:STYLE2},
            {code:"News Releases", url:homeURL()+"news-releases.php"},
            {code:"GRC One Page", url:homeURL()+"content/GRC%20One%20Page.pdf"},
            {code:"GRC Audio Presentation", url:homeURL()+"presentation/company/player.html", target:"_blank"},
            {code:"GRC PDF Presentation", url:homeURL()+"content/grc-presentation.pdf"},
            {code:"Research Reports", url:homeURL()+"reports.php"},
            {code:"IRS Form 8937 - Dividend Distributions", url:homeURL()+"irs-form-8937.php"},
            {code:"Webcast Presentations", url:homeURL()+"webcasts.php"},
            {code:"SEC Filings", url:homeURL()+"refer.php?rc=SEC_FILINGS"},
            {code:"SEC Filings Ownership Reports", url:homeURL()+"refer.php?rc=SEC_FILINGS_OWNERSHIP_REP"},
            {code:"XBRL Files", url:homeURL()+"xbrl-files.php"},
            {code:"Annual Reports", url:homeURL()+"annual-reports.php"},
            {code:"Code of Ethics", url:homeURL()+"content/GRC%20Code%20of%20Ethics.pdf"},
            {code:"FCPA Compliance Policy", url:homeURL()+"content/FCPA%20Compliance%20Policy%2012-31-2011.pdf"},
            {code:"Audit Charter", url:homeURL()+"content/Audit%20Committee%20Charter%202010-08-09.pdf"},
            {code:"Compensation Charter", url:homeURL()+"content/Compensation%20Committee%20Charter%202010-08-09.pdf"},
            {code:"Conference Calls", url:homeURL()+"conference-calls.php"},
            {code:"Receive GRC news and updates", url:homeURL()+"email-list.php"}
        ]
    },
    {code:"Contact", url:homeURL()+"contact.php", itemoff:[0,151], size:[23,77]}
];

var PROJECT_ITEMS = [
    {pos:[xOffset(15),189], itemoff:[32,0], leveloff:[0,157], style:VERT_BOX, size:[33,157], zIndex:998, delay:150},
    {code:"El Aguila", url:homeURL()+"project-ea.php"},
    {code:"&nbsp;&nbsp;Project Photos", url:homeURL()+"presentation/progress/player.html", target:"_blank"},
    {code:"&nbsp;&nbsp;2011 Photo Book", url:homeURL()+"content/2011 Photo Book.pdf", target:"_blank"},
    {code:"Las Margaritas", url:homeURL()+"project-lm.php"},
    {code:"El Rey", url:homeURL()+"project-er.php"},
    {code:"Solaga", url:homeURL()+"project-so.php"},
    {code:"Alta Gracia", url:homeURL()+"project-ag.php"}
];

var INV_ITEMS = [
    {pos:[xOffset(7),189], itemoff:[32,0], leveloff:[0,142], style:VERT_BOX, size:[33,142], delay:150},
    {code:"News Releases", url:homeURL()+"news-releases.php"},
    {code:"GRC One Page", url:homeURL()+"content/GRC%20One%20Page.pdf"},
    {code:"GRC Audio Presentation", url:homeURL()+"presentation/company/player.html", target:"_blank"},
    {code:"GRC PDF Presentation", url:homeURL()+"content/grc-presentation.pdf"},
    {code:"Research Reports", url:homeURL()+"reports.php"},
    {code:"IRS Form 8937 - Dividend Distributions", url:homeURL()+"irs-form-8937.php"},
    {code:"Webcast Presentations", url:homeURL()+"webcasts.php"},
    {code:"SEC Filings", url:homeURL()+"refer.php?rc=SEC_FILINGS"},
    {code:"SEC Filings Ownership Reports", url:homeURL()+"refer.php?rc=SEC_FILINGS_OWNERSHIP_REP"},
    {code:"XBRL Files", url:homeURL()+"xbrl-files.php"},
    {code:"Annual Reports", url:homeURL()+"annual-reports.php"},
    {code:"Code of Ethics", url:homeURL()+"content/GRC%20Code%20of%20Ethics.pdf"},
    {code:"FCPA Compliance Policy", url:homeURL()+"content/FCPA%20Compliance%20Policy%2012-31-2011.pdf"},
    {code:"Audit Charter", url:homeURL()+"content/Audit%20Committee%20Charter%202010-08-09.pdf"},
    {code:"Compensation Charter", url:homeURL()+"content/Compensation%20Committee%20Charter%202010-08-09.pdf"},
    {code:"Conference Calls", url:homeURL()+"conference-calls.php"},
    {code:"Receive GRC news and updates", url:homeURL()+"email-list.php"}
];

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

var COMMUNITY_REPORT = [
    {pos:[xOffset(30),187], style:VERT_BOX, size:[33,170], zIndex:999, delay:50},
    {code:"Community Participation", url:homeURL()+"content/Community%20Participation%202010.pdf"}
];

