/*
	variáveis globais
*/
	// variáveis determinantes de browsers
	var isN4  	= (document.layers) ? true : false;
	var isIE  	= (document.all) ? true : false;
	var isDOM 	= (document.getElementById && !document.all) ? true : false;
	
/*
	PrintPage()
	função responsável por chamar a caixa de diálogo do navegador para impressão.
*/
function PrintPage()
{
	if (isIE)
		window.print();
	else
		alert('Por favor selecione a opcao "Arquivo -> Imprimir" do menu superior para imprimir.');
}

/*
    função que avança o focus de uma caixa de texto para a seguinte 

*/
function GoToNext(size,obj1,obj2)
{
   if(document.getElementById(obj1.id).value.length >=size)
   {
      document.getElementById(obj2.id).focus();
      
   }}

function OpenPopupNewsletter(oEmail) {
    if (isDOM) {
        email = document.getElementById(oEmail).value;
    }
    else if (isN4) {
        email = document.layers[oEmail].value;
    }
    else if (isIE) {
        email = document.all[oEmail].value;
    }

    pLX  = 300;
    pAY  = 210;
    xx   = parseInt(((screen.width - pLX - 8) / 2));
    yy   = parseInt(((screen.height - pAY - 15) / 2));
    pUrl = 'newsletter.aspx?email=' + email;
    pTit = 'Newsletter';
    s    = window.open(pUrl, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=' + pLX + ',height=' + pAY + ',top=' + yy + ',left=' + xx + ',screenX=' + xx + ',screenY=' + yy);
}

function OpenPopupEvaluation(url)
{
    window.open(url,'ProductEvaluation','toolbar=no,status=no,menubar=no,scrollbars=yes,resizeable=no,top=100,left=50,width=435,height=487');
} 

function OpenPopupStaticText( url, vwidth, vheight )
{
    window.open(url,'StaticText','toolbar=no,status=no,menubar=no,scrollbars=no,resizeable=no,top=100,left=50,width='+vwidth+',height='+ vheight + '');
}

function OpenPopupIndicate(idProduct) {
    pLX = 438;
    pAY = 692;
    xx = parseInt(((screen.width - pLX - 8) / 2));
    yy = parseInt(((screen.height - pAY - 15) / 2));
    pUrl = 'productpopupindicate.aspx?idproduct=' + idProduct;

    s = window.open(pUrl, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=' + pLX + ', height=' + pAY + ', top=' + yy + ', left=' + xx + ', screenX=' + xx + ', screenY=' + yy);
}

/*
	OpenPopup()
	função genérica para abertura de popups no site.
*/
function OpenPopup(idPopup, url, popupW, popupH){
	window.open(url, idPopup, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=' + popupW + ',height=' + popupH + ',top=55,left=55');
}

function OpenPopupRemenber(url)
{
    window.open(url,'ProductRemember','toolbar=no,status=no,menubar=no,scrollbars=no,resizeable=no,top=100,left=50,width=435,height=432');
} 


function OpenGiftCardPopup(idPopup, url, popupW, popupH){
	window.open(url, idPopup, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=' + popupW + ',height=' + popupH + ',top=55,left=55');
}



 function oPenPopupShipCost(zipCode, zipCodeComplement)
 {
    var zipfull = zipCode + zipCodeComplement;
    window.open('popupshipcost.aspx?zip='+zipfull,null ,'width=500,height=200')
    return false;
 }

/*
	ValidateNumberOfChars()
	função responsável por validar a quantidade de caracteres dentro de uma área de texto.
*/
function ValidateNumberOfChars(textBox, limit, divResponse){

	var validKey = true;
	var obj = document.getElementById(textBox);
	var divResponse = document.getElementById(divResponse);
	var diff = limit - obj.value.length;
	
	if(diff < 0 && 
		window.event.keyCode != 8 &&
		window.event.keyCode != 17 &&
		!(window.event.keyCode >= 33 && window.event.keyCode <= 40) &&
		window.event.keyCode != 46
		)
	{
		obj.value = obj.value.substr(0, limit);
		alert('Atenção: Você não pode exceder ' + limit + ' caracteres neste campo!');
		validKey = false;
	}
	
	divResponse.innerHTML = "Total de <font color=\"red\"><strong>" + obj.value.length + "</strong></font> caracteres digitados de no máximo <strong>" + limit + "</strong>.";
	
	return validKey;
}

// Abre popup de zoom de imagem.
function ProductZoom(imageUrl, fgType, idProduct)
{
    pLX = 525;
	pAY = 460;
	xx = parseInt(((screen.width - pLX - 8) / 2));
	yy = parseInt(((screen.height - pAY - 15) / 2));
	pUrl = 'productpopup.aspx?productId=' + idProduct + '&img=' + imageUrl + '&type=' + fgType;
	pTit = 'Vertico20';
    		
	s = window.open(pUrl, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=' + pLX + ', height=' + pAY + ', top=' + yy + ', left=' + xx + ', screenX=' + xx + ', screenY=' + yy);		
}

// Muda a imagem do produto de acordo com a imagem adicional clicada.
function ChangeImage(path, imgDetalhe, imgZoom, idProduct, imgBig, href, hdn)
{        
    if (isDOM) 
    {
        document.getElementById(imgBig).src = path + "/images/product/" + imgDetalhe;
        
        if (imgZoom != "")
        {
            document.getElementById(href).setAttribute("href", "javascript:ProductZoom('" + imgZoom + "','1','" + hdn + "');");
            document.getElementById("ctl00_ContentSite_refProduct").setAttribute("href", "javascript:ProductZoom('" + imgZoom + "','1','" + hdn + "');");
        }
        else
        {
            document.getElementById(href).removeAttribute("href");
            document.getElementById("ctl00_ContentSite_refProduct").removeAttribute("href");
        }
    }
    else if (isN4) 
    {
        document.layers[imgBig].src = path + "/images/product/" + imgDetalhe;
        
        if (imgZoom != "")
        {
            document.layers[href].setAttribute("href", "javascript:ProductZoom('" + imgZoom + "','1','" + hdn + "');"); //"javascript:ProductZoom('" + imgZoom + "','1');");
            document.layers["ctl00_ContentSite_refProduct"].setAttribute("href", "javascript:ProductZoom('" + imgZoom + "','1','" + hdn + "');");
        }
        else
        {
            document.layers[href].removeAttribute("href");
            document.layers["ctl00_ContentSite_refProduct"].removeAttribute("href");
        }
    }
    else if (isIE)
    {
        document.all[imgBig].src = path + "/images/product/" + imgDetalhe;
        
        if (imgZoom != "")
        {
            document.all[href].setAttribute("href", "javascript:ProductZoom('" + imgZoom + "','1','" + hdn + "');"); //"javascript:ProductZoom('" + imgZoom + "','1');");
            document.all["ctl00_ContentSite_refProduct"].setAttribute("href", "javascript:ProductZoom('" + imgZoom + "','1','" + hdn + "');");
        }
        else
        {
            document.all[href].removeAttribute("href");
            document.all["ctl00_ContentSite_refProduct"].removeAttribute("href");
        }
    }
}

// Muda a imagem do produto de acordo com a imagem adicional clicada.
function ChangeImage(sWebPath, sImgBig, sImgZoom, idProduct) {
    if (isDOM) {
        if (document.getElementById("imgProductBig") != null)
            document.getElementById("imgProductBig").src = sWebPath + "/images/product/" + sImgBig

        if (document.getElementById("imgProductZoom") != null)
            document.getElementById("imgProductZoom").src = sWebPath + "/images/product/" + sImgZoom
    }
    else if (isN4) {
        if (document.layers["imgProductBig"] != null)
            document.layers["imgProductBig"].src = sWebPath + "/images/product/" + sImgBig

        if (document.layers["imgProductZoom"] != null)
            document.layers["imgProductZoom"].src = sWebPath + "/images/product/" + sImgZoom
    }
    else if (isIE) {
        if (document.all['imgProductBig'] != null)
            document.all['imgProductBig'].src = sWebPath + "/images/product/" + sImgBig

        if (document.all['imgProductZoom'] != null)
            document.all['imgProductZoom'].src = sWebPath + "/images/product/" + sImgZoom
    }
    
    this.sImgBig = sImgBig;
}

// Muda a imagem de Zoom do produto de acordo com a imagem adicional escolhida.
function ChangeZoomImage(sPath, sImgZoomName, oImgZoom)
{
    if (isDOM)
    {
        document.getElementById(oImgZoom).src = sPath + "/images/product/" + sImgZoomName;
    }
    else if (isN4)
    {
        document.layers[oImgZoom].src = sPath + "/images/product/" + sImgZoomName;
    }
    else if (isIE)
    {
        document.all[oImgZoom].src = sPath + "/images/product/" + sImgZoomName;
    }
}

function ClearField(field, text)
{          
    if (isDOM) 
    {      
        if (document.getElementById(field) != null && document.getElementById(field).value == text) 
            document.getElementById(field).value = '';                          
    }     
    else if (isN4) 
    {
        if (document.layers[field] != null && document.layers[field].value == text) 
            document.layers[field].value = '';    
    }        
    else if (isIE)
    {               
        if (document.all[field] != null && document.all[field].value == text) 
            document.all[field].value = '';        
    } 
} 

function FillField(field, text)
{          
    if (isDOM) 
    {   
        if (document.getElementById(field) != null && document.getElementById(field).value == '') 
            document.getElementById(field).value = text;                          
    }     
    else if (isN4) 
    {
        if (document.layers[field] != null && document.layers[field].value == '') 
            document.layers[field].value = text;    
    }        
    else if (isIE)
    {           
        if (document.all[field] != null && document.all[field].value == '') 
            document.all[field].value = text;        
    } 
} 

/* Scripts da Master removidos para cá */

/* Abre popup de atendimento online */
function MM_openBrWindow(theURL,winName,features) { //v2.0 
    window.open(theURL,winName,features); 
}

/* Efetua cadastro newsletter */
function NewsClick() 
{
    if (isDOM) 
    {
        var sName  = document.getElementById('ctl00_txtName').value;  
        var sEmail = document.getElementById('ctl00_txtEmail').value;  
    }
    else if (isN4) 
    {
        var sName  = document.getElementById['ctl00_txtName'].value;  
        var sEmail = document.getElementById['ctl00_txtEmail'].value;  
    }
    else if (isIE)
    {
        var sName  = document.all['ctl00_txtName'].value;  
        var sEmail = document.all['ctl00_txtEmail'].value;  
    }
    
    pLX = 300;
    pAY = 200;
    xx = parseInt(((screen.width-pLX-8)/2));
    yy = parseInt(((screen.height-pAY-15)/2));
    pUrl = 'popupnewsletter.aspx?email=' + sEmail + '&name=' + sName;
    pTit = 'News';
    s = window.open(pUrl,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width='+pLX+',height='+pAY+',top='+yy+',left='+xx+',screenX='+xx+',screenY='+yy);
}

/* Scripts para renderização das imagens do menu lateral esquerdo e menu superior horizontal */
function MM_swapImgRestore() { //v3.0
    var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function ShowMenuDiv(index, total) {
    if (isDOM) {
        iPaddingLeft = 0;
        for (i=0; i < total; i++) {
            if (i == index) {
                document.getElementById('divMenu' + i).className = 'visiblediv';
                document.getElementById('divMenu' + i).style.paddingLeft = iPaddingLeft + "px";
            }
            else {
                document.getElementById('divMenu' + i).className = 'invisiblediv';
            }
            iPaddingLeft += document.getElementById('imgDept' + i).width;
        }
    }
    else if (isN4) {
        iPaddingLeft = 0;
        for (i=0; i < total; i++) {
            if (i == index) {
                document.layers['divMenu' + i].className = 'visiblediv';
                document.layers['divMenu' + i].style.paddingLeft = iPaddingLeft + "px";
            }
            else {
                document.layers['divMenu' + i].className = 'invisiblediv';
            }
            iPaddingLeft += document.layers['imgDept' + i].width;
        }
    }
    else if (isIE) {
        iPaddingLeft = 0;
        for (i=0; i < total; i++) {
            if (i == index) {
                document.all['divMenu' + i].className = 'visiblediv';
                document.all['divMenu' + i].style.paddingLeft = iPaddingLeft + "px";
            }
            else {
                document.all['divMenu' + i].className = 'invisiblediv';
            }
            iPaddingLeft += document.all['imgDept' + i].width;
        }
    }
}

function ShowImgMain(index, total, iddept) {
    if (isDOM) {
        for (i = 0; i < total; i++) {
            if (i == index) {
                if (iddept == 1)
                    document.getElementById('imgDept' + i).src = 'images/dept/bt_caes_2.gif';
                else if (iddept == 2)
                    document.getElementById('imgDept' + i).src = 'images/dept/bt_gatos_2.gif';
                else if (iddept == 283)
                    document.getElementById('imgDept' + i).src = 'images/dept/bt_aquarismo_2.gif';
                else if (iddept == 284)
                    document.getElementById('imgDept' + i).src = 'images/dept/bt_aves_2.gif';
                else if (iddept == 285)
                    document.getElementById('imgDept' + i).src = 'images/dept/bt_ferrets_2.gif';
                else if (iddept == 286)
                    document.getElementById('imgDept' + i).src = 'images/dept/bt_roedores_2.gif';
                else if (iddept == 287)
                    document.getElementById('imgDept' + i).src = 'images/dept/bt_repteis_2.gif';
            }
        }
    }
    else if (isN4) {
        for (i = 0; i < total; i++) {
            if (i == index) {
                if (iddept == 1)
                    document.layers['imgDept' + i].src = 'images/dept/bt_caes_2.gif';
                else if (iddept == 2)
                    document.layers['imgDept' + i].src = 'images/dept/bt_gatos_2.gif';
                else if (iddept == 283)
                    document.layers['imgDept' + i].src = 'images/dept/bt_aquarismo_2.gif';
                else if (iddept == 284)
                    document.layers['imgDept' + i].src = 'images/dept/bt_aves_2.gif';
                else if (iddept == 285)
                    document.layers['imgDept' + i].src = 'images/dept/bt_ferrets_2.gif';
                else if (iddept == 286)
                    document.layers['imgDept' + i].src = 'images/dept/bt_roedores_2.gif';
                else if (iddept == 287)
                    document.layers['imgDept' + i].src = 'images/dept/bt_repteis_2.gif';
            }
        }
    }
    else if (isIE) {
        for (i = 0; i < total; i++) {
            if (i == index) {
                if (iddept == 1)
                    document.all['imgDept' + i].src = 'images/dept/bt_caes_2.gif';
                else if (iddept == 2)
                    document.all['imgDept' + i].src = 'images/dept/bt_gatos_2.gif';
                else if (iddept == 283)
                    document.all['imgDept' + i].src = 'images/dept/bt_aquarismo_2.gif';
                else if (iddept == 284)
                    document.all['imgDept' + i].src = 'images/dept/bt_aves_2.gif';
                else if (iddept == 285)
                    document.all['imgDept' + i].src = 'images/dept/bt_ferrets_2.gif';
                else if (iddept == 286)
                    document.all['imgDept' + i].src = 'images/dept/bt_roedores_2.gif';
                else if (iddept == 287)
                    document.all['imgDept' + i].src = 'images/dept/bt_repteis_2.gif';
            }
        }
    }
}

function HideMenuDiv(index) {
    if (isDOM) {
        document.getElementById('divMenu' + index).className = 'invisiblediv';
    }
    else if (isN4) {
        document.layers['divMenu' + index].className = 'invisiblediv';
    }
    else if (isIE) {
        document.all['divMenu' + index].className = 'invisiblediv';
    }
}

function HideImgMain(index, total, iddept) {
    if (isDOM) {
        document.getElementById('divMenu' + index).className = 'invisiblediv';
        
        for (i = 0; i < total; i++) {
            if (i == index) {
                if (iddept == 1)
                    document.getElementById('imgDept' + index).src = 'images/dept/bt_caes.gif';
                else if (iddept == 2)
                    document.getElementById('imgDept' + index).src = 'images/dept/bt_gatos.gif';
                else if (iddept == 283)
                    document.getElementById('imgDept' + index).src = 'images/dept/bt_aquarismo.gif';
                else if (iddept == 284)
                    document.getElementById('imgDept' + index).src = 'images/dept/bt_aves.gif';
                else if (iddept == 285)
                    document.getElementById('imgDept' + index).src = 'images/dept/bt_ferrets.gif';
                else if (iddept == 286)
                    document.getElementById('imgDept' + index).src = 'images/dept/bt_roedores.gif';
                else if (iddept == 287)
                    document.getElementById('imgDept' + index).src = 'images/dept/bt_repteis.gif';
            }
        }
    }
    else if (isN4) {
        document.layers['divMenu' + index].className = 'invisiblediv';
        
        for (i = 0; i < total; i++) {
            if (i == index) {
                if (iddept == 1)
                    document.layers['imgDept' + index].src = 'images/dept/bt_caes.gif';
                else if (iddept == 2)
                    document.layers['imgDept' + index].src = 'images/dept/bt_gatos.gif';
                else if (iddept == 283)
                    document.layers['imgDept' + index].src = 'images/dept/bt_aquarismo.gif';
                else if (iddept == 284)
                    document.layers['imgDept' + index].src = 'images/dept/bt_aves.gif';
                else if (iddept == 285)
                    document.layers['imgDept' + index].src = 'images/dept/bt_ferrets.gif';
                else if (iddept == 286)
                    document.layers['imgDept' + index].src = 'images/dept/bt_roedores.gif';
                else if (iddept == 287)
                    document.layers['imgDept' + index].src = 'images/dept/bt_repteis.gif';
            }
        }
    }
    else if (isIE) {
        document.all['divMenu' + index].className = 'invisiblediv';
        
        for (i = 0; i < total; i++) {
            if (i == index) {
                if (iddept == 1)
                    document.all['imgDept' + index].src = 'images/dept/bt_caes.gif';
                else if (iddept == 2)
                    document.all['imgDept' + index].src = 'images/dept/bt_gatos.gif';
                else if (iddept == 283)
                    document.all['imgDept' + index].src = 'images/dept/bt_aquarismo.gif';
                else if (iddept == 284)
                    document.all['imgDept' + index].src = 'images/dept/bt_aves.gif';
                else if (iddept == 285)
                    document.all['imgDept' + index].src = 'images/dept/bt_ferrets.gif';
                else if (iddept == 286)
                    document.all['imgDept' + index].src = 'images/dept/bt_roedores.gif';
                else if (iddept == 287)
                    document.all['imgDept' + index].src = 'images/dept/bt_repteis.gif';
            }
        }
    }
}

/* Script da Basket */
function GoToNext(size,cep1,cep2)
{
    if(document.getElementById(cep1).value.length >=size)
        document.getElementById(cep2).focus(); 
}

/* Script da CustomerAddressControl */
function PhoneFormat(campo) 
{ 
    var tamanho = document.getElementById(campo).value.length; 

    if (tamanho == 4) 
        {
	        document.getElementById(campo).value += '-';
	    } 
}

/* Script da Customer */
function CPFFormat(campo,evt) 
{
    if(ValidateInt(evt))
    {
        return formatField(campo, '000.000.000-00', evt);
    }
}

function CnpjFormat(campo, evt) 
{
    if(ValidateInt(evt))
    {
        return formatField(campo, '00.000.000/0000-00', evt);
    }
}

function RGFormat(campo,evt) 
{ 
    var tamanho = document.getElementById(campo.id).value.length;
    if (isDOM)
    {
        var key = evt.which;
        if (tamanho == 2 || tamanho == 6) 
        {
	        if(key == 8 || key == 127)
	        {       
	            document.getElementById(campo.id).value += '';
	        }
	        else
	        {
	            document.getElementById(campo.id).value += '.';
	        }
	    }
        if (tamanho == 10) 
        {
	        if(key == 8 || key == 127)
	        {       
	            document.getElementById(campo.id).value += '';
	        }
	        else
	        {
	            document.getElementById(campo.id).value += '-';
	        }
	    } 
    }
    else if (isIE)
    { 
        var tamanho = document.getElementById(campo.id).value.length; 

        if (tamanho == 2 || tamanho == 6) 
        {
	        if(window.event.keyCode == 8 || window.event.keyCode == 127)
	        {       
	            document.getElementById(campo.id).value += '';
	        }
	        else
	        {
	            document.getElementById(campo.id).value += '.';
	        }
	    } 
        if (tamanho == 10) 
        {
	        if(window.event.keyCode == 8 || window.event.keyCode == 127)
	        {       
	            document.getElementById(campo.id).value += '';
	        }
	        else
	        {
	            document.getElementById(campo.id).value += '-';
	        }
	    } 
    }
}

function formatField(campo, Mascara, evento) 
{
    var boleanoMascara;
    var Digitato;
    
    if (isDOM)
    {
        Digitato = evento.which;
    }
    else
    {
        Digitato = evento.keyCode;
    }
    
    exp = /\-|\.|\/|\(|\)| /g
    campoSoNumeros = campo.value.toString().replace( exp, "" );
  
    var posicaoCampo   = 0;    
    var NovoValorCampo = "";
    var TamanhoMascara = campoSoNumeros.length;;
    
    if (Digitato != 8) { // backspace
        for(i=0; i<= TamanhoMascara; i++) {
            boleanoMascara  = ((Mascara.charAt(i) == "-") || (Mascara.charAt(i) == ".") || (Mascara.charAt(i) == "/"))
            boleanoMascara  = boleanoMascara || ((Mascara.charAt(i) == "(") || (Mascara.charAt(i) == ")") || (Mascara.charAt(i) == " "))
            if (boleanoMascara) {
                NovoValorCampo += Mascara.charAt(i);
                  TamanhoMascara++;
            }
            else {
                NovoValorCampo += campoSoNumeros.charAt(posicaoCampo);
                posicaoCampo++;
            }           
        }
        campo.value = NovoValorCampo;
        return true;
    }
    else {
        return true;
    }
}

function ValidateInt(evt)
{
    if (isDOM)
        currentKey = evt.which;             
    else
        currentKey = event.keyCode; 
        
    if (currentKey >=48 && currentKey <= 57 || currentKey == 0 || currentKey == 8)
	    return true;
    else 
    {
        if(isDOM)
            evt.preventDefault();
        else
            event.keyCode = false;
    }
}

/* Script da Lista de Desejos (wishlistview) */
var bChecked;
bChecked = true;
function CheckAll() {
    var chk;
    var i;
    var theform;
	
    if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
	    theform = document.aspnetForm;
    }
    else {
	    theform = document.forms["aspnetForm"];
    }
	
    for(i=0; i < theform.elements.length;i++) {
	    if (theform.elements[i].type =="checkbox")
	    {
		    chk = theform.elements[i];
		    chk.checked = bChecked;
	    }
    }
    
    if (bChecked) {
	    bChecked = false;
    }
    else {
	    bChecked=true;
    }
}

/* Script da Payment */
function OpenPopupCreditCard(url, vwidth, vheight)
{
    window.open(url, 'GJTecidos', 'toolbar=no,status=no,menubar=no,scrollbars=no,resizeable=no,top=100,left=50,width='+vwidth+',height='+ vheight + '');
}

/* Script da Product */
function OpenPopUpProductImage(url)
{
    window.open(url,'ProductZoom','toolbar=no,status=no,menubar=no,scrollbars=yes,resizeable=yes,top=110,left=60,width=525,height=460');
}

function ShowDetailDiv(nome)
{       
    if (isDOM) 
    {   
        if (nome == "showDescription")
        {
            document.getElementById("divPayment").className               = "conteudo_abas_detalhe invisiblediv";
            document.getElementById("divDescription").className           = "conteudo_abas_detalhe visiblediv";
            document.getElementById("divAvalie").className                = "conteudo_abas_detalhe invisiblediv";
            document.getElementById("divAdditionalInformation").className = "conteudo_abas_detalhe invisiblediv";
            document.images["imgShowDescription"].src                     = "images/tit_descricao_2.gif";
            document.images["imgShowIndicateProduct"].src                 = "images/tit_avaliacao_produto.gif";
            document.images["imgShowPayment"].src                         = "images/tit_parcelamento.gif";
            document.images["imgAdditionalInformation"].src               = "images/tit_informacoes_nutricionais.gif";
        }
        else if (nome == "showIndicateProduct")
        {
            document.getElementById("divAvalie").className                = "conteudo_abas_detalhe visiblediv";
            document.getElementById("divPayment").className               = "conteudo_abas_detalhe invisiblediv";
            document.getElementById("divDescription").className           = "conteudo_abas_detalhe invisiblediv";
            document.getElementById("divAdditionalInformation").className = "conteudo_abas_detalhe invisiblediv";
            document.images["imgShowDescription"].src                     = "images/tit_descricao.gif";
            document.images["imgShowIndicateProduct"].src                 = "images/tit_avaliacao_produto_2.gif";
            document.images["imgShowPayment"].src                         = "images/tit_parcelamento.gif";
            document.images["imgAdditionalInformation"].src               = "images/tit_informacoes_nutricionais.gif";
        }
        else if (nome == "showPayment")
        {
            document.getElementById("divDescription").className           = "conteudo_abas_detalhe invisiblediv";
            document.getElementById("divAvalie").className                = "conteudo_abas_detalhe invisiblediv";
            document.getElementById("divPayment").className               = "conteudo_abas_detalhe visiblediv";
            document.getElementById("divAdditionalInformation").className = "conteudo_abas_detalhe invisiblediv";
            document.images["imgShowDescription"].src                     = "images/tit_descricao.gif";
            document.images["imgShowIndicateProduct"].src                 = "images/tit_avaliacao_produto.gif";
            document.images["imgShowPayment"].src                         = "images/tit_parcelamento_2.gif";
            document.images["imgAdditionalInformation"].src               = "images/tit_informacoes_nutricionais.gif";
        }
        else if (nome == "showAdditionalInformation")
        {
            document.getElementById("divDescription").className           = "conteudo_abas_detalhe invisiblediv";
            document.getElementById("divAvalie").className                = "conteudo_abas_detalhe invisiblediv";
            document.getElementById("divPayment").className               = "conteudo_abas_detalhe invisiblediv";
            document.getElementById("divAdditionalInformation").className = "conteudo_abas_detalhe visiblediv";
            document.images["imgShowDescription"].src                     = "images/tit_descricao.gif";
            document.images["imgShowIndicateProduct"].src                 = "images/tit_avaliacao_produto.gif";
            document.images["imgShowPayment"].src                         = "images/tit_parcelamento.gif";
            document.images["imgAdditionalInformation"].src               = "images/tit_informacoes_nutricionais_2.gif";
        }
    }     
    else if (isN4) 
    {
        if (nome == "showDescription")
        {
            document.getElementById["divPayment"].className               = "conteudo_abas_detalhe invisiblediv";
            document.getElementById["divDescription"].className           = "conteudo_abas_detalhe visiblediv";
            document.getElementById["divAvalie"].className                = "conteudo_abas_detalhe invisiblediv";
            document.getElementById["divAdditionalInformation"].className = "conteudo_abas_detalhe invisiblediv";
            document.images["imgShowDescription"].src                     = "images/tit_descricao_2.gif";
            document.images["imgShowIndicateProduct"].src                 = "images/tit_avaliacao_produto.gif";
            document.images["imgShowPayment"].src                         = "images/tit_parcelamento.gif";
            document.images["imgAdditionalInformation"].src               = "images/tit_informacoes_nutricionais.gif";
        }
        else if (nome == "showIndicateProduct")
        {
            document.getElementById["divAvalie"].className                = "conteudo_abas_detalhe visiblediv";
            document.getElementById["divPayment"].className               = "conteudo_abas_detalhe invisiblediv";
            document.getElementById["divDescription"].className           = "conteudo_abas_detalhe invisiblediv";
            document.getElementById["divAdditionalInformation"].className = "conteudo_abas_detalhe invisiblediv";
            document.images["imgShowDescription"].src                     = "images/tit_descricao.gif";
            document.images["imgShowIndicateProduct"].src                 = "images/tit_avaliacao_produto_2.gif";
            document.images["imgShowPayment"].src                         = "images/tit_parcelamento.gif";
            document.images["imgAdditionalInformation"].src               = "images/tit_informacoes_nutricionais.gif";
        }
        else if (nome == "showPayment")
        {
            document.getElementById["divDescription"].className           = "conteudo_abas_detalhe invisiblediv";
            document.getElementById["divAvalie"].className                = "conteudo_abas_detalhe invisiblediv";
            document.getElementById["divPayment"].className               = "conteudo_abas_detalhe visiblediv";
            document.getElementById["divAdditionalInformation"].className = "conteudo_abas_detalhe invisiblediv";
            document.images["imgShowDescription"].src                     = "images/tit_descricao.gif";
            document.images["imgShowIndicateProduct"].src                 = "images/tit_avaliacao_produto.gif";
            document.images["imgShowPayment"].src                         = "images/tit_parcelamento_2.gif";
            document.images["imgAdditionalInformation"].src               = "images/tit_informacoes_nutricionais.gif";
        }
        else if (nome == "showAdditionalInformation")
        {
            document.getElementById["divDescription"].className           = "conteudo_abas_detalhe invisiblediv";
            document.getElementById["divAvalie"].className                = "conteudo_abas_detalhe invisiblediv";
            document.getElementById["divPayment"].className               = "conteudo_abas_detalhe invisiblediv";
            document.getElementById["divAdditionalInformation"].className = "conteudo_abas_detalhe visiblediv";
            document.images["imgShowDescription"].src                     = "images/tit_descricao.gif";
            document.images["imgShowIndicateProduct"].src                 = "images/tit_avaliacao_produto.gif";
            document.images["imgShowPayment"].src                         = "images/tit_parcelamento.gif";
            document.images["imgAdditionalInformation"].src               = "images/tit_informacoes_nutricionais_2.gif";
        }
    }        
    else if (isIE)
    {
        if (nome == "showDescription")
        {
            document.getElementById("divPayment").className               = "conteudo_abas_detalhe invisiblediv";
            document.getElementById("divDescription").className           = "conteudo_abas_detalhe visiblediv";
            document.getElementById("divAvalie").className                = "conteudo_abas_detalhe invisiblediv";
            document.getElementById("divAdditionalInformation").className = "conteudo_abas_detalhe invisiblediv";
            document.images["imgShowDescription"].src                     = "images/tit_descricao_2.gif";
            document.images["imgShowIndicateProduct"].src                 = "images/tit_avaliacao_produto.gif";
            document.images["imgShowPayment"].src                         = "images/tit_parcelamento.gif";
            document.images["imgAdditionalInformation"].src               = "images/tit_informacoes_nutricionais.gif";
        }
        else if (nome == "showIndicateProduct")
        {
            document.getElementById("divAvalie").className                = "conteudo_abas_detalhe visiblediv";
            document.getElementById("divPayment").className               = "conteudo_abas_detalhe invisiblediv";
            document.getElementById("divDescription").className           = "conteudo_abas_detalhe invisiblediv";
            document.getElementById("divAdditionalInformation").className = "conteudo_abas_detalhe invisiblediv";
            document.images["imgShowDescription"].src                     = "images/tit_descricao.gif";
            document.images["imgShowIndicateProduct"].src                 = "images/tit_avaliacao_produto_2.gif";
            document.images["imgShowPayment"].src                         = "images/tit_parcelamento.gif";
            document.images["imgAdditionalInformation"].src               = "images/tit_informacoes_nutricionais.gif";
        }
        else if (nome == "showPayment")
        {
            document.getElementById("divDescription").className           = "conteudo_abas_detalhe invisiblediv";
            document.getElementById("divAvalie").className                = "conteudo_abas_detalhe invisiblediv";
            document.getElementById("divPayment").className               = "conteudo_abas_detalhe visiblediv";
            document.getElementById("divAdditionalInformation").className = "conteudo_abas_detalhe invisiblediv";
            document.images["imgShowDescription"].src                     = "images/tit_descricao.gif";
            document.images["imgShowIndicateProduct"].src                 = "images/tit_avaliacao_produto.gif";
            document.images["imgShowPayment"].src                         = "images/tit_parcelamento_2.gif";
            document.images["imgAdditionalInformation"].src               = "images/tit_informacoes_nutricionais.gif";
        }
        else if (nome == "showAdditionalInformation")
        {
            document.getElementById("divDescription").className           = "conteudo_abas_detalhe invisiblediv";
            document.getElementById("divAvalie").className                = "conteudo_abas_detalhe invisiblediv";
            document.getElementById("divPayment").className               = "conteudo_abas_detalhe invisiblediv";
            document.getElementById("divAdditionalInformation").className = "conteudo_abas_detalhe visiblediv";
            document.images["imgShowDescription"].src                     = "images/tit_descricao.gif";
            document.images["imgShowIndicateProduct"].src                 = "images/tit_avaliacao_produto.gif";
            document.images["imgShowPayment"].src                         = "images/tit_parcelamento.gif";
            document.images["imgAdditionalInformation"].src               = "images/tit_informacoes_nutricionais_2.gif";
        }
    }
}
