﻿nie = (navigator.appName.indexOf("Microsoft") == -1);

function getel(doc, id) {
    return doc.getElementById(id);
}

function el(id) {
    return getel(document, id);
}

function getElementsById(sId) {
    var outArray = new Array();

    if (typeof (sId) != 'string' || !sId) {
        return outArray;
    };

    if (document.evaluate) {
        var xpathString = "//*[@id='" + sId.toString() + "']"
        var xpathResult = document.evaluate(xpathString, document, null, 0, null);
        while ((outArray[outArray.length] = xpathResult.iterateNext())) { }
        outArray.pop();
    }
    else if (document.all) {

        if (document.all[sId])
            for (var i = 0, j = document.all[sId].length; i < j; i += 1) {
                outArray[i] = document.all[sId][i];
            }

    } else if (document.getElementsByTagName) {

        var aEl = document.getElementsByTagName('*');
        for (var i = 0, j = aEl.length; i < j; i += 1) {

            if (aEl[i].id == sId) {
                outArray.push(aEl[i]);
            };
        };

    };

    if ((outArray.length == 0) && (el(sId)))
        outArray[0] = el(sId);

    return outArray;
}

function escreve(s) {
    document.write(s);
}

function arr(n) {
    this.length = n
    for (var i = 0; i < n; i = i + 1) {
        this[i] = ''
    }
}

function element_top(el) {
    var et = 0
    while (el) {
        et += el.offsetTop
        el = el.offsetParent
    }
    return et
}


function element_left(el) {
    var et = 0
    while (el) {
        et += el.offsetLeft
        el = el.offsetParent
    }
    return et
}

function lstVai(lst, frame) {
    lnk = lst.options[lst.selectedIndex].value;
    if (lnk.length < 1)
        return;
    if (typeof(frame) == "undefined")
        window.location.href = lnk;
    else
        window.frames[frame].location.href = lnk;
    lst.selectedIndex = 0;
}

function mainDivCenter(divName, infinite, toRight) {
    d = document.documentElement.clientWidth;
    me = document.getElementById(divName);
    toRight = ((typeof (toRight) != 'undefined') && (toRight)) ? 1 : 0;
    if ((!me.lastD) || (me.lastD != d)) {
        me = document.getElementById(divName);
        x = me.offsetWidth;
        if (x < d) {
            dif = d - x;
            me.style.marginLeft = ((dif / 2) + (toRight ? dif % 2 : 0)) + 'px';
        }
        else
            me.style.marginLeft = '0px';
        me.lastD = d;
    }
    if (infinite)
        setTimeout('mainDivCenter(\'' + divName + '\', 1, ' + (toRight) + ')', 500);
}

/* 12/10/2009 */
function escreveFlash(id, src, width, height, align, salign, transparent, mozila, versao, onmouseover, onmouseout, flashVars) {
    s = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + (versao) + ',0,0,0" width="' +
        (width) + '" height="' + (height) + '" id="' +
        id + '" ' + (align != '' ? 'align="' + align + '"' : '') +
        (onmouseover != '' ? ' onmouseover="' + onmouseover + '"' : '') +
        (onmouseout != '' ? ' onmouseout="' + onmouseout + '"' : '') +
        '><param name="quality" value="high" />' +
        (src != '' ? '<param name="movie" value="' + src + '" />' : '') +
        (salign != '' ? '<param name="salign" value="' + salign + '" />' : '') +
        (transparent ? '<param name="wmode" value="transparent" />' : '') +
        (((typeof(flashVars) != "undefined") && (flashVars != '')) ? '<param name="flashVars" value="' + flashVars + '" />' : '') +
        '<param name="menu" value="false" /><param name="scale" value="noscale" />';
    if (mozila)
        s += '<embed ' +
            (src != '' ? 'src="' + src + '" ' : '') +
            'loop="false" menu="false" quality="high" scale="noscale" width="' +
            (width) + '" height="' + (height) + '" name="' + id + '" ' +
            (align != '' ? 'align="' + align + '" ' : '') +
            (salign != '' ? 'salign="' + salign + '" ' : '') +
            (onmouseover != '' ? 'onmouseover="' + onmouseover + '" ' : '') +
            (onmouseout != '' ? 'onmouseout="' + onmouseout + '" ' : '') +
            (transparent ? 'wmode="transparent" ' : '') +
            (((typeof(flashVars) != "undefined") && (flashVars != '')) ? 'flashVars="' + flashVars + '" ' : '') +
            'allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" swliveconnect="true" />';
    s += '</object>';
    escreve(s);
}

function loadFlashWithPreload2(id, src, preloadId, paramsStr) {
    preloaded = movieIsLoaded(mv(preloadId));
    loaded = movieIsLoaded(mv(id));

    if ((!loaded) && (preloaded)) {
        cmd = 'loadMovie(\'' + id + '\', \'' + src + '\', [' + paramsStr + '])';
        setTimeout(cmd, 1);
    }

    paramsStr = paramsStr.replace(/\'/g, '\\\'');
    cmd = 'loadFlashWithPreload2(\'' + id + '\', \'' + src + '\', \'' + preloadId + '\', \'' + paramsStr + '\')';

    //if ((loaded) && (nie))
    //    setTimeout(cmd, 1000);
    //else 
    if (!loaded)
        setTimeout(cmd, 100);

}

function mv(movieName) {
    tM = null;
    if (navigator.appName.indexOf("Microsoft") != -1) {
        tM = document.all[movieName];
        if (typeof (tM) != "undefined") {
            if (tM.length && (tM.length > 0))
                tM = tM[0];
            else if (tM.length && (tM.length == 0))
                tM = null;
        }
    }
    else if (document[movieName])
        tM = document[movieName];
    else
        tM = el(movieName);

    return tM;
}

function loadMovie(id, movie, params) {
    mv(id).LoadMovie(0, movie);
    for (p = 0; p < params.length; p += 2)
        mv(id).SetVariable(params[p], params[p + 1]);
}

function loadMovieWithDelay(id, movie, paramsStr) {
    cmd = 'loadMovie(\'' + id + '\', \'' + movie + '\', ' + paramsStr + ')';
    setTimeout(cmd, 500);
}

function movieIsLoaded(theMovie) {
    if (typeof (theMovie) != "undefined") {
        return ((typeof (theMovie.PercentLoaded) != "undefined") && (theMovie.PercentLoaded() == 100));
    } else {
        return false;
    }
}

function movieIsReady(theMovie) {
    return (typeof (theMovie.PercentLoaded) != "undefined");
}

function newImage(arg) {
    if (document.images) {
        rslt = new Image();
        rslt.src = arg;
        return rslt;
    }
}

function imprime() {
    window.focus();
    setTimeout("window.print()", 500);
}

var ie5 = document.all && !window.opera
var lastHeight = 0;
var autoHeight = 1;
var autoHSet = 0;
function adjustIFrameSize() {
    if (!el('divSize'))
        return;
    iframeElement = getel(window.parent.document, 'ifcontent');
    iframeWindow = window.parent.frames[name];
    if (nie)
        iframeElement.style.height = '';
    h = 0;
    hMin = 0;
    h = el('divSize').offsetHeight;
    hMin = 600;
    h = h > hMin ? h : hMin;

    lastHeight = h;

    iframeElement.style.height = (h) + 'px';
    window.parent.el('iframe-wrapper').style.height = (h) + 'px';

    mw = window.parent.el('menu-wrapper');
    wp = window.parent.el('wrapper');
    msl = window.parent.el('menu-shadow-left');
    msr1 = window.parent.el('menu-shadow-right1');
    msr2 = window.parent.el('menu-shadow-right2');

    mw.style.height = '';

    h = wp.offsetHeight;
    if (mw.offsetHeight > h)
        h = mw.offsetHeight;
    
    mw.style.height = (h) + 'px';
    msl.style.height = (h) + 'px';
    msr1.style.height = (h) + 'px';
    msr2.style.height = (h) + 'px';
    
    if ((autoHeight) && (!autoHSet)) {
        autoHSet = 1;
        setTimeout('autoH()', 500);
    }
}

function autoH() {
    h = el('divSize').offsetHeight;
    hMin = 600;
    h = h > hMin ? h : hMin;
    if (h != lastHeight) {
        scrollPos = window.parent.document.documentElement.scrollTop;
        adjustIFrameSize();
        window.parent.document.documentElement.scrollTop = scrollPos;
    }
    setTimeout('autoH()', 500);
}

var elementosFonte = '';
function fonte(aumenta) {
    // default
    dif = Number(readCookie('fontSize'));

    els = elementosFonte.split(',');

    for (i = 0; i < els.length; i++) {

        if (els[i].substr(0, 1) == '_') {
            dfs = getElementsById(els[i].substr(1, els[i].length - 1));
        }
        else
            dfs = [el(els[i])];

        for (xx = 0; xx < dfs.length; xx++) {
            df = dfs[xx];
            if (!df)
                continue;
            def = Number(df.getAttribute('default-font', 0));
            if (aumenta > -1) {
                size = Number(df.style.fontSize.substr(0, df.style.fontSize.length - 2));
                dif = size - def;
            }
            else {
                dif = Number(readCookie('fontSize'));
                size = def + dif;
            }
            //alert(els[i] + ' default: ' + (def) + ' atual: ' + (size));

            if (aumenta > -1) {
                if ((dif <= 0) && !aumenta) {
                    alert(fonteMinTxt);
                    return;
                }
                if ((dif >= 4) && aumenta) {
                    alert(fonteMaxTxt);
                    return;
                }
                if (aumenta)
                    size++;
                else
                    size--;
            }

            dif = size - def;

            df.style.fontSize = (size) + "px";
        }
    }

    var expire = new Date();
    expire.setTime(new Date().getTime() + 3600000 * 24 * 5000);
    document.cookie = 'fontSize' + "=" + escape((dif) + '') + ";expires=" + expire.toGMTString();

    adjustIFrameSize();
}

function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for (var i = 0; i < ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') c = c.substring(1, c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
    }
    return null;
}

function indica() {
    ifc = window.parent.frames['ifcontent'];
    iurl = 'indique.aspx?1=1';
    if (ifc) {
        if (ifc.idcontent)
            iurl += '&idContent=' + (ifc.idcontent);
        if (ifc.idcontentsection)
            iurl += '&idContentSection=' + (ifc.idcontentsection);
        ifc.location = htmlbase + iurl;
    }
    else
        window.location = iurl;
}

function amplia2(id, pw, ph, text) {
    wp = window.parent;
    wpd = wp.document;
    ov = getel(wpd, 'overlay');
    amp = getel(wpd, 'ampliacao');
    ampi = getel(wpd, 'ampliInner');
    img = getel(wpd, 'imgAmpliar2');
    txt = getel(wpd, 'ampliText');

    ampi.style.width = (pw + 12) + 'px';
    ov.style.height = (wpd.documentElement.scrollHeight) + 'px';
    img.src = wp.htmlbase + 'images/blank.gif';
    txt.style.display = (text != '' ? 'block' : 'none');
    txt.innerHTML = text;

    th = wpd.documentElement.clientHeight;
    th = ((th - ph - 12 - 18 - 3) / 2) - 20;
    if (th < 0)
        th = 0;
    th = th + window.parent.document.documentElement.scrollTop;
    ampi.style.marginTop = (th) + 'px';

    ov.style.display = 'block';
    amp.style.display = 'block';

    img.src = wp.htmlbase + 'ModuleHandlers/Content/picture.aspx?idContentPicture=' +
        (id) + '&w=' + (pw) + '&h=' + (ph);
}

function fechaAmpliar2() {
    wp = window.parent;
    wpd = wp.document;
    img = getel(wpd, 'imgAmpliar2');
    txt = getel(wpd, 'ampliText');
    ov = getel(wpd, 'overlay');
    amp = getel(wpd, 'ampliacao');

    ov.style.display = 'none';
    amp.style.display = 'none';
    img.src = '';
    txt.innerHTML = '';
}



/* ----------------------------------------------- */

var menuItens = new arr(0);
var menuComplete = 0;
var menuLoaded = 0;
var menuShowed = 0;

function addMenuItem(id, src, preloadId, paramsStr) {
    menuItens.length++;
    i = menuItens.length - 1;
    menuItens[i] = new arr(4);
    menuItens[i][0] = id;
    menuItens[i][1] = src;
    menuItens[i][2] = preloadId;
    menuItens[i][3] = paramsStr;
}

function menuDone() {
    menuComplete = 1;
}

function mostraMenu() {
    preloaded = movieIsLoaded(mv('menuPreload'));
    loaded = movieIsLoaded(mv('menuPreload'));

    if ((!menuComplete) || (!preloaded) || (!loaded))
        setTimeout('mostraMenu()', 100);
    else if (!menuLoaded) {
        menuLoaded = 1;
        for (i = 0; i < menuItens.length; i++) {
            cmd = 'loadMovie(\'' + menuItens[i][0] + '\', \'' + menuItens[i][1] + '\', [' + menuItens[i][3] + '])';
            setTimeout(cmd, i * 100);
        }
    }
}

function umclique(base, sel) {
    val = sel.options[sel.selectedIndex].value;
    if (val != '')
        window.location = base + val;
}

// *********************************************************************************************************************

function slideShow(varId, outerElementId, auto, slide_time, slide_change_speed, textos) {

    this.textos = textos;
    this.varid = varId;
    this.outerElementId = outerElementId;
    this.automatic = auto;
    this.slideTime = slide_time;
    this.speed = slide_change_speed;

    this.banners = new matriz(0);

    this.bannerIndex = -1;
    this.allBannersCreated = 0;
    this.loadAllBannersIndex = 1;
    this.loadBannersCalled = 0;

    this.oldBannerIndex = 0;

    this.direction = 0;

    this.timeoutid = 0;

    this.addBanner = function(html) {
        this.banners.length++;
        this.banners[this.banners.length - 1] = html;
    }

    this.init = function() {

        if (this.banners.length == 0)
            return;

        if (!this.loadBannersCalled) {
            this.loadBanners();
            this.loadBannersCalled = 1;
        }
        else {
            this.vaiParaBanner(0);
        }
    }

    this.loadBanners = function() {

        if (this.banners.length == 0)
            return;

        // el('outdoor-buttons').style.display = banners.length > 1 ? 'block' : 'none';

        this.criaBanner(0);
        setTimeout(this.varid + '.loadAllBanners()', 500);

        this.trocaBanner(1, 1, -1);
    }

    this.criaBanner = function(indice) {
        if (!this.textos)
            el(this.outerElementId).innerHTML += this.banners[indice];
        bn = el('div' + this.varid + '_' + (indice));
        bn.style.position = 'absolute';
        bn.style.left = '5000px';
        bn.style.top = '0px';
        bn.style.display = 'block';
    }

    this.loadAllBanners = function() {

        if (this.textos || this.bannerIsLoaded(this.varid + '_0') || nie) {
            if (this.banners.length > 1) {
                this.criaBanner(this.loadAllBannersIndex);
            }
            if (this.loadAllBannersIndex < this.banners.length - 1) {
                this.loadAllBannersIndex++;
                setTimeout(this.varid + '.loadAllBanners()', 100);
            }
            else {
                this.allBannersCreated = 1;
            }
        }
        else
            setTimeout(this.varid + '.loadAllBanners()', 500);
    }

    this.banner0isok = function() {
        return ((this.banners.length == 0) || (this.textos) || (this.bannerIsLoaded(this.varid + '_0')));
    }

    this.bannerIsLoaded = function(id) {
        if ((mv(id).tagName == 'EMBED') || (mv(id).tagName == 'OBJECT'))
            return movieIsLoaded(mv(id));
        else if (mv(id).tagName == 'IMG')
            return el(id).complete;
    }

    this.trocaBanner = function(avanca, fast, novoIndice) {
        
        if ((!this.allBannersCreated) && (this.bannerIndex != -1))
            return;

        this.oldBannerIndex = this.bannerIndex;

        if (avanca > -1) {
            if (avanca) {
                this.direction = 1;
                this.bannerIndex++;
            }
            else {
                this.direction = -1;
                this.bannerIndex--;
            }

            if (this.bannerIndex == -1)
                this.bannerIndex = this.banners.length - 1;
            else if (this.bannerIndex >= this.banners.length)
                this.bannerIndex = 0;
        }
        else if (novoIndice > -1) {
            this.bannerIndex = novoIndice;
        }

        /* if (this.bannerIndex > -1) {
        if (!this.bannerIsLoaded(this.varid + '_' + (this.bannerIndex)) && (this.oldBannerIndex > -1))
        el('div' + this.varid + '_' + (this.oldBannerIndex)).style.display = 'none';
        } */

        this.mostraBanner(fast);
    }

    this.avancaBanner = function(avanca) {
        this.trocaBanner(avanca, 0, -1);
    }

    this.vaiParaBanner = function(indice) {
        this.trocaBanner(-1, 0, indice);
    }

    this.dvOld = 0;
    this.dvNew = 0;

    this.mostraBanner = function(fast) {
        if (this.textos || this.bannerIsLoaded(this.varid + '_' + (this.bannerIndex))) {

            if (this.dvOld)
                this.dvOld.style.left = '-5000px';

            oe = el(this.outerElementId);
            this.dvOld = el('div' + this.varid + '_' + (this.oldBannerIndex));
            this.dvNew = el('div' + this.varid + '_' + (this.bannerIndex));

            if (this.textos) {
                bx = el(this.varid + '_' + (this.bannerIndex) + '_boxes');
                h = oe.offsetHeight - 20;
                if (bx.offsetHeight < h)
                    bx.style.height = (h) + 'px';

                if (this.dvOld) {
                    if (this.direction == 1) {
                        this.dvOld.style.width = (el(this.outerElementId).offsetWidth / 2) + 'px';
                        this.dvOld.style.overflow = 'hidden';
                        this.dvNew.style.width = (el(this.outerElementId).offsetWidth) + 'px';
                        this.dvNew.style.overflow = 'visible';
                    }
                    else {
                        this.dvNew.style.width = (el(this.outerElementId).offsetWidth / 2) + 'px';
                        this.dvNew.style.overflow = 'hidden';
                        this.dvOld.style.width = (el(this.outerElementId).offsetWidth) + 'px';
                        this.dvOld.style.overflow = 'visible';
                    }
                }
            }

            if (this.oldBannerIndex > -1) {
                if (!this.textos)
                    this.slowChange();
                else
                    this.slowChangeTextos();
            }
            else {
                //if (this.dvOld)
                //    this.dvOld.style.display = 'none';
                this.dvNew.style.left = '0px';
                // this.dvNew.style.display = 'block';
            }

            if (this.dvNew.offsetHeight > oe.offsetHeight) {
                oe.style.height = (this.dvNew.offsetHeight) + 'px';
            }

            titulo = el(this.varid + '_titulo');
            h = titulo.offsetHeight + 40;
            if (h > oe.offsetHeight) {
                oe.style.height = (h) + 'px';
            }

            if (this.textos) {
                bx = el(this.varid + '_' + (this.bannerIndex) + '_boxes');
                h = oe.offsetHeight - 20;
                if (bx.offsetHeight < h)
                    bx.style.height = (h) + 'px';
            }            

            if (this.automatic)
                this.scheduleNext(0);
        }
        else {
            setTimeout(this.varid + '.mostraBanner(' + (fast) + ')', 1000);
        }
    }

    this.scheduleNext = function(delay) {
        if (this.timeoutid)
            clearTimeout(this.timeoutid);
        if (this.banners.length > 1) {
            this.timeoutid = setTimeout(this.varid + '.trocaBanner(1, 0, -1)', (this.slideTime + delay));
        }
    }

    this.bnWidth = 0;
    this.slowChangeDirection = 0;
    this.slowChangePos = 0;
    this.slowStepSize = 40;
    this.slowStepSize2 = 0;
    this.slowStepInterval = 100;
    this.slowChangeTimer = 0;

    this.slowChange = function() {
        this.slowChangeDirection = this.direction * -1;
        // alert(this.dvNew.offsetWidth);
        this.dvNew.style.left = '5000px';
        // this.dvNew.style.display = 'block';
        this.bnWidth = this.dvNew.offsetWidth;
        this.dvOld.style.left = '0px';
        this.dvNew.style.left = ((this.bnWidth+1) * this.direction) + 'px';
        this.slowChangePos = 0;
        if (this.slowChangeTimer)
            clearInterval(this.slowChangeTimer);
        this.slowStepSize2 = this.slowStepSize;
        this.slowChangeTimer = setInterval(this.varid + '.slowStep()', 1);
        //this.slowStep();
    }

    this.slowStep = function() {
        this.slowChangePos = this.slowChangePos + (this.slowChangeDirection * this.slowStepSize2);
        ended = (Math.abs(this.slowChangePos) >= this.bnWidth);
        ending = (Math.abs(this.slowChangePos) >= (this.bnWidth * 0.5));
        if (ended)
            this.slowChangePos = this.bnWidth * this.slowChangeDirection;
        if (ending) {
            dif = this.bnWidth - Math.abs(this.slowChangePos);
            this.slowStepSize2 = dif * 0.1;
            // alert(this.slowStepSize2);
            if (this.slowStepSize2 < 1)
                this.slowStepSize2 = 1;
        }

        this.dvOld.style.left = (this.slowChangePos + this.slowChangeDirection) + 'px';
        this.dvNew.style.left = ((this.bnWidth * this.direction) + this.slowChangePos) + 'px';
        // alert(this.dvOld.style.left + this.dvNew.style.left)
        if (!ended) {
            // setTimeout(this.varid + '.slowStep()', this.slowStepInterval);
        }
        else {
            clearInterval(this.slowChangeTimer);
            // this.dvOld.style.display = 'none';
        }
    }

    this.slowChangeTextos = function() {
        this.slowChangeDirection = this.direction * -1;
        this.dvNew.style.left = '5000px';
        if (this.direction == -1)
            this.bnWidth = this.dvOld.offsetWidth / 2;
        else
            this.bnWidth = this.dvNew.offsetWidth / 2;
        this.dvOld.style.left = '0px';
        this.dvNew.style.left = (this.bnWidth * this.direction) + 'px';
        this.slowChangePos = 0;
        if (this.slowChangeTimer)
            clearInterval(this.slowChangeTimer);
        this.slowStepSize2 = this.slowStepSize;
        this.slowChangeTimer = setInterval(this.varid + '.slowStepTextos()', 1);
    }

    this.slowStepTextos = function() {
        this.slowChangePos = this.slowChangePos + (this.slowChangeDirection * this.slowStepSize2);
        ended = (Math.abs(this.slowChangePos) >= this.bnWidth);
        ending = (Math.abs(this.slowChangePos) >= (this.bnWidth * 0.5));
        if (ended)
            this.slowChangePos = this.bnWidth * this.slowChangeDirection;
        if (ending) {
            dif = this.bnWidth - Math.abs(this.slowChangePos);
            this.slowStepSize2 = dif * 0.1;
            if (this.slowStepSize2 < 1)
                this.slowStepSize2 = 1;
        }

        this.dvOld.style.left = this.slowChangePos + 'px';
        this.dvNew.style.left = ((this.bnWidth * this.direction) + this.slowChangePos) + 'px';
        if (ended) {
            clearInterval(this.slowChangeTimer);
        }
    }    
}


function matriz(n) {
    this.length = n
    for (var i = 0; i < n; i = i + 1) {
        this[i] = ''
    }
}

/* ----------------------------------------------- */

function contentBeforePrint() {
    getel(window.parent.document, 'ifcontent').style.height = (getel(window.parent.document, 'ifcontent').offsetHeight + 150) + 'px';
}

function contentAfterPrint() {
    getel(window.parent.document, 'ifcontent').style.height = (getel(window.parent.document, 'ifcontent').offsetHeight - 150) + 'px';
}

secaoAtiva = 0;
itemMenuAtivo = 0;
function adjust1(secao) {

    if (secaoAtiva == secao)
        return;

    if (itemMenuAtivo)
        mudaBotao(itemMenuAtivo, 1);

    mudaSubMenu(secaoAtiva, 0);
    mudaSubMenu(secao, 1);

    secaoAtiva = secao;

    itemMenuAtivo = 'm' + (secao);
    if (el(itemMenuAtivo))
        mudaBotao(itemMenuAtivo, 3);
}

function mudaSubMenu(id, estado) {
    sub = el('s' + id);
    if (!sub)
        return;
    sub.style.display = estado ? 'block' : 'none';
    
    /*
    loadFlashWithPreload2('m2234', 'flash/botao.swf', 'menuPreload', '');
    loadFlashWithPreload2('m2235', 'flash/botao.swf', 'menuPreload', '');
    loadFlashWithPreload2('m2236', 'flash/botao.swf', 'menuPreload', '');

    loadFlashWithPreload2('m2237', 'flash/botao.swf', 'menuPreload', '');

    loadFlashWithPreload2('m2238', 'flash/botao.swf', 'menuPreload', '');
    loadFlashWithPreload2('m2239', 'flash/botao.swf', 'menuPreload', '');
    loadFlashWithPreload2('m2240', 'flash/botao.swf', 'menuPreload', '');
    loadFlashWithPreload2('m2241', 'flash/botao.swf', 'menuPreload', '');
    loadFlashWithPreload2('m2225', 'flash/botao.swf', 'menuPreload', '');
    */
}

function subCustomLoad(id, src, preloadId, menuid) {

    visible = el('s' + (menuid)).style.display == 'block';
    preloaded = movieIsLoaded(mv(preloadId));
    loaded = movieIsLoaded(mv(id));

    if ((!loaded) && (preloaded) && (visible)) {
        cmd = 'loadMovie(\'' + id + '\', \'' + src + '\', [])';
        setTimeout(cmd, 1);
    }

    cmd = 'subCustomLoad(\'' + id + '\', \'' + src + '\', \'' + preloadId + '\', \'' + menuid + '\')';

    if (!loaded || !visible) {
        setTimeout(cmd, 500);
        return;
    }

    if ((loaded) && (nie))
        setTimeout(cmd, 1000);
    else
    if (!loaded || !visible)
        setTimeout(cmd, 500);
}

function mudaBotao(id, estado) {
    if (!mv(id))
        return;
    mv(id).SetVariable('fast', 'yes');
    mv(id).SetVariable('tipoBotao', estado);
    mv(id).GotoFrame(1);
    mv(id).Play();
}

function ajdustIframeWidth() {

    md = el('medida');
    w1 = el('iframe-wrapper').clientWidth;
    w2 = md.clientWidth;
    w = w1 > w2 ? w1 : w2;

    if ((!md.lastW) || (md.lastW != w)) {
        ifc = el('ifcontent');
        ifc.style.width = (621 + Math.ceil((w-1002)/2)) + 'px';
        md.lastW = w;
    }
    setTimeout('ajdustIframeWidth()', 500);
}
