if (document.images) {

    ID_TOP10_ON = new Image(); ID_TOP10_ON.src = "ImagesCached/categ/acessorios-flores_TOP.jpg";
    ID_TOP10_OFF = new Image(); ID_TOP10_OFF.src = "ImagesCached/categ/acessorios-flores_01.jpg";

    ID_PELUCIAS_ON = new Image(); ID_PELUCIAS_ON.src = "ImagesCached/categ/acessorios-flores_PELUCIAS.jpg";
    ID_PELUCIAS_OFF = new Image(); ID_PELUCIAS_OFF.src = "ImagesCached/categ/acessorios-flores_02.jpg";

    ID_CHOCOLATES_ON = new Image(); ID_CHOCOLATES_ON.src = "ImagesCached/categ/acessorios-flores_GULOSEIMAS.jpg";
    ID_CHOCOLATES_OFF = new Image(); ID_CHOCOLATES_OFF.src = "ImagesCached/categ/acessorios-flores_03.jpg";

    ID_BEBIDAS_ON = new Image(); ID_BEBIDAS_ON.src = "ImagesCached/categ/acessorios-flores_BEBIDAS.jpg";
    ID_BEBIDAS_OFF = new Image(); ID_BEBIDAS_OFF.src = "ImagesCached/categ/acessorios-flores_04.jpg";

    ID_CARTOES_ON = new Image(); ID_CARTOES_ON.src = "ImagesCached/categ/acessorios-flores_CARTOES.jpg";
    ID_CARTOES_OFF = new Image(); ID_CARTOES_OFF.src = "ImagesCached/categ/acessorios-flores_05.jpg";

    ID_LIVROS_ON = new Image(); ID_LIVROS_ON.src = "ImagesCached/categ/acessorios-flores_LIVROS.jpg";
    ID_LIVROS_OFF = new Image(); ID_LIVROS_OFF.src = "ImagesCached/categ/acessorios-flores_06.jpg";
    

    ID_DIVERSOS_ON = new Image(); ID_DIVERSOS_ON.src = "ImagesCached/categ/acessorios-flores_MISTICOS.jpg";
    ID_DIVERSOS_OFF = new Image(); ID_DIVERSOS_OFF.src = "ImagesCached/categ/acessorios-flores_07.jpg";

}



function handleOverTop10(img) {
    if (document.images) document.getElementById(img).src = ID_TOP10_ON.src;
}

function handleOutTop10(img) {
    if (document.images) document.getElementById(img).src = ID_TOP10_OFF.src;
}

function handleOverPelucias(img) {
    if (document.images) document.getElementById(img).src = ID_PELUCIAS_ON.src;
}

function handleOutPelucias(img) {
    if (document.images) document.getElementById(img).src = ID_PELUCIAS_OFF.src;
}

function handleOverChocolates(img) {
    if (document.images) document.getElementById(img).src = ID_CHOCOLATES_ON.src;
}

function handleOutChocolates(img) {
    if (document.images) document.getElementById(img).src = ID_CHOCOLATES_OFF.src;
}

function handleOverLivros(img) {
    if (document.images) document.getElementById(img).src = ID_LIVROS_ON.src;
}

function handleOutLivros(img) {
    if (document.images) document.getElementById(img).src = ID_LIVROS_OFF.src;
}

function handleOverCartoes(img) {
    if (document.images) document.getElementById(img).src = ID_CARTOES_ON.src;
}

function handleOutCartoes(img) {
    if (document.images) document.getElementById(img).src = ID_CARTOES_OFF.src;
}

function handleOverBebidas(img) {
    if (document.images) document.getElementById(img).src = ID_BEBIDAS_ON.src;
}

function handleOutBebidas(img) {
    if (document.images) document.getElementById(img).src = ID_BEBIDAS_OFF.src;
}

function handleOverDiversos(img) {
    if (document.images) document.getElementById(img).src = ID_DIVERSOS_ON.src;
}

function handleOutDiversos(img) {
    if (document.images) document.getElementById(img).src = ID_DIVERSOS_OFF.src;
}


function menu_active(img, menu, temp, ip) {
    handleOutTop10('ID_TOP10');
    handleOutChocolates('ID_CHOCOLATES');
    handleOutLivros('ID_LIVROS');
    handleOutCartoes('ID_CARTOES');
    handleOutBebidas('ID_BEBIDAS');
    handleOutDiversos('ID_DIVERSOS');
    handleOutPelucias('ID_PELUCIAS');
    if (menu == 'top10') { // 33
        Produto_detalhe.BuscaTOP(1, 33, temp, ip, GetResult_CallBack1); // 1 = onde deve aparecer     1 = se é se é top10 ou pelucias, etc
        Produto_detalhe.BuscaTOP(2, 33, temp, ip, GetResult_CallBack2);
        handleOverTop10('ID_TOP10');
    } else if (menu == 'pelucias') { // 15
    Produto_detalhe.BuscaTOP(1, 15, temp, ip, GetResult_CallBack1); // 1 = onde deve aparecer     1 = se é se é top10 ou pelucias, etc
    Produto_detalhe.BuscaTOP(2, 15, temp, ip, GetResult_CallBack2);
        handleOverPelucias('ID_PELUCIAS');
    } else if (menu == 'chocolates') { // 16
    Produto_detalhe.BuscaTOP(1, 16, temp, ip, GetResult_CallBack1); // 1 = onde deve aparecer     1 = se é se é top10 ou pelucias, etc
    Produto_detalhe.BuscaTOP(2, 16, temp, ip, GetResult_CallBack2);
        handleOverChocolates('ID_CHOCOLATES');
    } else if (menu == 'livros') { //17
    Produto_detalhe.BuscaTOP(1, 17, temp, ip, GetResult_CallBack1); // 1 = onde deve aparecer     1 = se é se é top10 ou pelucias, etc
    Produto_detalhe.BuscaTOP(2, 17, temp, ip, GetResult_CallBack2);
        handleOverLivros('ID_LIVROS');
    } else if (menu == 'cartoes') { // 77
    Produto_detalhe.BuscaTOP(1, 77, temp, ip, GetResult_CallBack1); // 1 = onde deve aparecer     1 = se é se é top10 ou pelucias, etc
    Produto_detalhe.BuscaTOP(2, 77, temp, ip, GetResult_CallBack2);
        handleOverCartoes('ID_CARTOES');
    } else if (menu == 'bebidas') { // 19
    Produto_detalhe.BuscaTOP(1, 19, temp, ip, GetResult_CallBack1); // 1 = onde deve aparecer     1 = se é se é top10 ou pelucias, etc
    Produto_detalhe.BuscaTOP(2, 19, temp, ip, GetResult_CallBack2);
        handleOverBebidas('ID_BEBIDAS');
    } else if (menu == 'diversos') { //20
    Produto_detalhe.BuscaTOP(1, 20, temp, ip, GetResult_CallBack1); // 1 = onde deve aparecer     1 = se é se é top10 ou pelucias, etc
    Produto_detalhe.BuscaTOP(2, 20, temp, ip, GetResult_CallBack2);
        handleOverDiversos('ID_DIVERSOS');
    }
}




function GetResult_CallBack1(response) {
    var ds = response.value;
    if (ds != null && typeof (ds) == "object" && ds.Tables != null && ds.Tables[0].Rows.length != 0) {
        var s = new Array();
        s[s.length] = "<table border = 0>";
        for (var i = 0; i < ds.Tables[0].Rows.length; i++) {
            s[s.length] = "<tr bgcolor=#FFFFFF>";
            s[s.length] = "<td><img alt=" + ds.Tables[0].Rows[i].prd_desc + " border=0  src=ImagesCached/prd_images/" + ds.Tables[0].Rows[i].prd_img.replace("_pq", "_gd") + "></td>";
            s[s.length] = "<td><font face=verdana size=1 color=#848484><b>" + ds.Tables[0].Rows[i].prd_nome + "</b></font><br><font face=verdana size=1 color=#848484>" + ds.Tables[0].Rows[i].prd_desc + "</font><br><font face=verdana size=1 color=#009900><b>R$ " + ds.Tables[0].Rows[i].prd_total.replace(".", ",") + "</b></font><br><input " + ds.Tables[0].Rows[i].ativo + " style='border:0px;' type=checkbox name=" + ds.Tables[0].Rows[i].prd_id + "  onclick=fuInc(" + ds.Tables[0].Rows[i].prd_id + ",'" + ds.Tables[0].Rows[i].ip + "','" + ds.Tables[0].Rows[i].Temporario + "')>&nbsp;<img src='ImagesCached/adicionar.gif' alt='Adicionar acessórios - Flores e Presentes Finos'></td></tr>";

        }
        s[s.length] = "</table>";
        document.getElementById("Display1").innerHTML = s.join("");
    }
}




colunas = 1;
function GetResult_CallBack2(response) {
    var ds = response.value;
    if (ds != null && typeof (ds) == "object" && ds.Tables != null && ds.Tables[0].Rows.length != 0) {
        var s = new Array();
        s[s.length] = "<table border = 0 width='618'>";
        for (var i = 0; i < ds.Tables[0].Rows.length; i++) {
            if (colunas == 1) {
                s[s.length] = "<tr bgcolor=#FFFFFF valign='middle'>";
                s[s.length] = "<td width='111' valign='top' align='center'><img alt='" + ds.Tables[0].Rows[i].prd_desc + "' border=0  src=ImagesCached/prd_images/" + ds.Tables[0].Rows[i].prd_img + "><br><img src=ImagesCached/zoom.jpg onMouseOver=showtrail('http://www.florencanto.com.br/ImagesCached/prd_images/" + ds.Tables[0].Rows[i].prd_img + "','',150,160) onMouseOut=hidetrail()></td>";
                s[s.length] = "<td width='195' valign='top' ><font face=verdana size=1 color=#848484><b>" + ds.Tables[0].Rows[i].prd_nome + "</b></font><br><font face=verdana size=1 color=#848484>" + ds.Tables[0].Rows[i].prd_desc + "</font><br><font face=verdana size=1 color=#009900><b>R$ " + ds.Tables[0].Rows[i].prd_total.replace(".", ",") + "</b></font><br><input " + ds.Tables[0].Rows[i].ativo + " style='border:0px;' type=checkbox name=" + ds.Tables[0].Rows[i].prd_id + "  onclick=fuInc(" + ds.Tables[0].Rows[i].prd_id + ",'" + ds.Tables[0].Rows[i].ip + "','" + ds.Tables[0].Rows[i].Temporario + "')>&nbsp;<img src='ImagesCached/adicionar.gif' alt='Adicionar acessórios - Flores e Presentes Finos'></td>";
                colunas = 2;

            } else {
                colunas = 1;
                s[s.length] = "<td width='111' valign='top' align='center'><img alt='" + ds.Tables[0].Rows[i].prd_desc + "' border=0  src=ImagesCached/prd_images/" + ds.Tables[0].Rows[i].prd_img + "><br><img src=ImagesCached/zoom.jpg onMouseOver=showtrail('http://www.florencanto.com.br/ImagesCached/prd_images/" + ds.Tables[0].Rows[i].prd_img + "','',150,160) onMouseOut=hidetrail()></td>";
                s[s.length] = "<td width='195' valign='top'><font face=verdana size=1 color=#848484><b>" + ds.Tables[0].Rows[i].prd_nome + "</b></font><br><font face=verdana size=1 color=#848484>" + ds.Tables[0].Rows[i].prd_desc + "</font><br><font face=verdana size=1 color=#009900><b>R$ " + ds.Tables[0].Rows[i].prd_total.replace(".", ",") + "</b></font><br><input " + ds.Tables[0].Rows[i].ativo + " style='border:0px;' type=checkbox name=" + ds.Tables[0].Rows[i].prd_id + "  onclick=fuInc(" + ds.Tables[0].Rows[i].prd_id + ",'" + ds.Tables[0].Rows[i].ip + "','" + ds.Tables[0].Rows[i].Temporario + "')>&nbsp;<img src='ImagesCached/adicionar.gif' alt='Adicionar acessórios - Flores e Presentes Finos'></td>";
                s[s.length] = "</tr>";
            }
        }
        colunas = 1;
        s[s.length] = "</table>";
        document.getElementById("Display2").innerHTML = s.join("");
    }
}


// Inclui no carrinho
function fuInc(val, temp, ip) {
    Acessorios.InteracaoAcessorio(val, ip, temp);
}




var offsetfrommouse = [15, 25]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration = 0; //duration in seconds image should remain visible. 0 for always.

var defaultimageheight = 40; // maximum image size.
var defaultimagewidth = 40; // maximum image size.

var timer;

var t_id = setInterval(animate, 20);
var pos = 0;
var dir = 2;
var len = 0;

function animate() {
    var elem = document.getElementById('progress');
    if (elem != null) {
        if (pos == 0) len += dir;
        if (len > 32 || pos > 79) pos += dir;
        if (pos > 79) len -= dir;
        if (pos > 79 && len == 0) pos = 0;
        elem.style.left = pos;
        elem.style.width = len;
    }
}


function remove_loading() {
    this.clearInterval(t_id);
    var targelem = document.getElementById('loader_container');
    targelem.style.display = 'none';
    targelem.style.visibility = 'hidden';
    var t_id = setInterval(animate, 60);
}

function gettrailobj() {

    if (document.getElementById)
        return document.getElementById("preview_div").style
}

function gettrailobjnostyle() {
    if (document.getElementById)
        return document.getElementById("preview_div")
}


function truebody() {
    return (!window.opera && document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body
}


function hidetrail() {
    gettrailobj().display = "none";
    document.onmousemove = ""
    gettrailobj().left = "-500px"
    clearTimeout(timer);
}

function showtrail(imagename, title, width, height) {

    i = imagename
    t = title
    w = width
    h = height
    timer = setTimeout("show('" + i + "',t,w,h);", 100);
}

function show(imagename, title, width, height) {

    var docwidth = document.all ? truebody().scrollLeft + truebody().clientWidth : pageXOffset + window.innerWidth - offsetfrommouse[0]
    var docheight = document.all ? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)

    if ((navigator.userAgent.indexOf("Konqueror") == -1 || navigator.userAgent.indexOf("Firefox") != -1 || (navigator.userAgent.indexOf("Opera") == -1 && navigator.appVersion.indexOf("MSIE") != -1))) {
        (width == 0) ? width = defaultimagewidth : '';
        (height == 0) ? height = defaultimageheight : '';

        width += 0
        height += 5
        defaultimageheight = height
        defaultimagewidth = width

        document.onmousemove = followmouse;

        newHTML = '<div class="border_preview" style="width:' + width + 'px;height:' + height + 'px"><div id="loader_container"><div id="loader"><div align="center">   Carregando a imagem...</div><div id="loader_bg"><div id="progress"> </div></div></div></div>';

        newHTML = newHTML + '<div class="preview_temp_load"><img onload="javascript:remove_loading();" src="' + imagename.replace("_pq", "_gd") + '" border="0"></div>';
        newHTML = newHTML + '</div>';

        if (navigator.userAgent.indexOf("MSIE") != -1 && navigator.userAgent.indexOf("Opera") == -1) {
            newHTML = newHTML + '<iframe src="about:blank" scrolling="no" frameborder="0" width="' + width + '" height="' + height + '"></iframe>';
        }

        gettrailobjnostyle().innerHTML = newHTML;
        gettrailobj().display = "block";
    }
}

function followmouse(e) {

    var xcoord = offsetfrommouse[0]
    var ycoord = offsetfrommouse[1]

    var docwidth = document.all ? truebody().scrollLeft + truebody().clientWidth : pageXOffset + window.innerWidth - 15
    var docheight = document.all ? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)

    if (typeof e != "undefined") {
        if (docwidth - e.pageX < defaultimagewidth + 2 * offsetfrommouse[0]) {
            xcoord = e.pageX - xcoord - defaultimagewidth; // Move to the left side of the cursor
        } else {
            xcoord += e.pageX;
        }
        if (docheight - e.pageY < defaultimageheight + 2 * offsetfrommouse[1]) {
            ycoord += e.pageY - Math.max(0, (2 * offsetfrommouse[1] + defaultimageheight + e.pageY - docheight - truebody().scrollTop));
        } else {
            ycoord += e.pageY;
        }

    } else if (typeof window.event != "undefined") {
        if (docwidth - event.clientX < defaultimagewidth + 2 * offsetfrommouse[0]) {
            xcoord = event.clientX + truebody().scrollLeft - xcoord - defaultimagewidth; // Move to the left side of the cursor
        } else {
            xcoord += truebody().scrollLeft + event.clientX
        }
        if (docheight - event.clientY < (defaultimageheight + 2 * offsetfrommouse[1])) {
            ycoord += event.clientY + truebody().scrollTop - Math.max(0, (2 * offsetfrommouse[1] + defaultimageheight + event.clientY - docheight));
        } else {
            ycoord += truebody().scrollTop + event.clientY;
        }
    }
    gettrailobj().left = xcoord + "px"
    gettrailobj().top = ycoord + "px"

}

function initAlts() {
    arr = document.getElementsByName('title')
    titles = new Array()
    xs = new Array()
    ys = new Array()
    for (i = 0; i < arr.length; i++) {
        itemm = arr.item(i)
        itemm.onmouseover = prepareShowAlt
        itemm.onmouseout = hideAlt
        itemm.id = "title_" + i
        titles[i] = itemm.title
        xs[i] = (typeof itemm.xs == 'undefined' ? 0 : itemm.xs)
        ys[i] = (typeof itemm.ys == 'undefined' ? 0 : itemm.ys)
        itemm.title = ""
    }
}
	