﻿var _strSection = "Primary";

// navigate to page
function go(strPage) {
    var strDirPrefix = document.location.href.indexOf("/ok-") >= 0 ? "../" : "";

    if (document.location.href.indexOf("okproduce.com") > 0) {
        if (strPage == "home") {
            document.location.href = strDirPrefix;
        } else {
            document.location.href = strDirPrefix + "ok-" + strPage + "/";
        }
    } else {
        if (strPage == "home") {
            document.location.href = strDirPrefix + "index.html";
        } else {
            document.location.href = strDirPrefix + "ok-" + strPage + "/index.html";
        }
    }
}

//fade
function fade() {
    var div = $('div1').setStyle('display', 'block');
    new Fx.Style(div, 'opacity', { duration: 1000 }).start(1);
}

// show meet our team tabs
var _activeMeetTab = "ManagementStaff";
function showMeetTab(v) {
    document.getElementById("ManagementStaffTab").className = v == "ManagementStaff" ? "tabOn" : "tabOff";
    document.getElementById("SalesStaffTab").className = v == "SalesStaff" ? "tabOn" : "tabOff";
    document.getElementById("BuyingStaffTab").className = v == "BuyingStaff" ? "tabOn" : "tabOff";
	document.getElementById("AccountingStaffTab").className = v == "AccountingStaff" ? "tabOn" : "tabOff";
	document.getElementById("OperationsStaffTab").className = v == "OperationsStaff" ? "tabOn" : "tabOff";
    
    document.getElementById("ManagementStaff").style.display = v == "ManagementStaff" ? "block" : "none";
    document.getElementById("SalesStaff").style.display = v == "SalesStaff" ? "block" : "none";
    document.getElementById("BuyingStaff").style.display = v == "BuyingStaff" ? "block" : "none";
	document.getElementById("AccountingStaff").style.display = v == "AccountingStaff" ? "block" : "none";
	document.getElementById("OperationsStaff").style.display = v == "OperationsStaff" ? "block" : "none";
}

// mouse out menu
function menuOut(o) {
    if (o.className != "menuSel") o.className = "menuOut";
}

// mouse over menu
function menuOvr(o) {
    if (o.className != "menuSel") o.className = "menuOvr";
}

// show page section
function show(strSection) {
    //if (_strSection != "Primary") document.getElementById("Menu" + _strSection).className = "menuOut";
    //if (strSection != "Primary") document.getElementById("Menu" + strSection).className = "menuSel";
    document.getElementById(_strSection).style.display = "none";
    document.getElementById(strSection).style.display = "block";
    document.getElementById(document.getElementById(_strSection + "Image") ? (_strSection + "Image") : "PrimaryImage").style.display = "none";
    document.getElementById(document.getElementById(strSection + "Image") ? (strSection + "Image") : "PrimaryImage").style.display = "block";
    _strSection = strSection;
}
