var portfolioSelectedTab = 0;
var solutionSelectedTab = 0;
function gotoPortfolio(id) { 
    window.location = '/guest/index/portfolio/s=' + id;
}
function clickPortfolio(id) {
    var t, s;
    if (portfolioSelectedTab > 0) {
        //t = document.getElementById("tab" + portfolioSelectedTab);
        //t.className = "item";
        s = document.getElementById("solutions" + portfolioSelectedTab);
        s.style.display = 'none';
    }
    //t = document.getElementById("tab" + id);
    //t.className = "item selected";
    s = document.getElementById("solutions" + id);
    s.style.display = 'block';
    portfolioSelectedTab = id;
}
function clickSolutionTab(id) {
    var t, s;
    if (solutionSelectedTab > 0) {
        t = document.getElementById("tab" + solutionSelectedTab);
        t.className = "tab";
        s = document.getElementById("descr" + solutionSelectedTab);
        s.style.display = 'none';
    }
    t = document.getElementById("tab" + id);
    t.className = "tab selected";
    s = document.getElementById("descr" + id);
    s.style.display = 'block';
    solutionSelectedTab = id;
}
var fxOpacity = 0;
var fxOpacityIncr = 0.05;
var fxImageIndex = 0;
var fxImages = null;
function startEffectReferences(ids) {
    fxImages = ids;
    fxImageIndex = Math.floor(Math.random() * fxImages.length);
    var r = document.getElementById("referenceImages");
    if (r) {
        r.style.backgroundImage = "url(/data/customers/" + fxImages[fxImageIndex].id + ".gif)";
        r.style.opacity = 0;
        fxOpacity = 0;
        fxOpacityIncr = 0.05;
        setInterval(effectReferences, 50);
    }
}
function effectReferences() {
    fxOpacity += fxOpacityIncr;
    var r = document.getElementById("referenceImages");    
    r.style.opacity = Math.max(0, Math.min(1, fxOpacity));
    if (fxOpacity < 0) {
        fxImageIndex = ++fxImageIndex % fxImages.length;
        r.style.backgroundImage = "url(/data/customers/" + fxImages[fxImageIndex].id + ".gif)";
        fxOpacityIncr = 0.05;
    } else if (fxOpacity >= 2) fxOpacityIncr = -0.05;
}