/**
* Inicializa as funções assim que os elementos (DOM) são carregados
@author Douglas Rodrigues <douglas.rodrigues@gommo.com.br>
*/
jQuery(function() {
Pompom._init();
});

jQuery(function() {
    jQuery('.new-window').click(function() {
        window.open(this.href, 'YouTube', "height = 400, width = 400, scrollbars=no, status=no, location = no, toolbar = no, menubar=no");
        return false;
    });
});

var Pompom = {
    /**
    * Função de chamada das outras funções que inicializam o site
    * @author Douglas Rodrigues <douglas.rodrigues@gommo.com.br>
    * @modified 
    */
    _init: function() {
        try {
            //Pompom._openMenu();
            Pompom._submenuVertical();
            Pompom._pngFix();
            Pompom._externalLink();
        } catch (e) {
            //console.log('Error: ' + e.description);
        }
    },


    /* Exibe o submenu vertical
    * @author Raul Souza Lima <raul.lima@gommo.com.br>
    */
    _submenuVertical: function() {
        jQuery('div#menu_vertical ol li a.arrow').hover(function() {
            jQuery('div#menu_vertical ol li').hover(
			    function() { jQuery('div', this).css('display', 'block'); },
			    function() { jQuery('div', this).css('display', 'none'); }
			);
        });
    },

    /**
    * Exibe o menu dropdown
    * @author Douglas Rodrigues <douglas.rodrigues@gommo.com.br>
    * @modified 
    */

    /*
    _openMenu: function() {
    $('#menu_nav li').hover(
    function() {
    $('ul', this)
    .css('display', 'block')
    .parent()
    .find('a')
    .addClass('selected');
    },
    function() {
    $('ul', this)
    .css('display', 'none')
    .parent()
    .find('a')
    .removeClass('selected');
    });

    }, */
    /**
    * Ativa pngfix
    * @author Douglas Rodrigues <douglas.rodrigues@gommo.com.br>
    * @modified 
    */
    _pngFix: function() {
        //Apenas IE 6, se apenas um elemento MSIE for encontrado e conter o valor 6
        if (!/msie [^6]\.0/i.test(navigator.userAgent) && /msie 6\.0/i.test(navigator.userAgent)) {
            DD_belatedPNG.fix('img, .pngfix');
        };
    },

    /**
    * target blank
    * @author Douglas Rodrigues <douglas.rodrigues@gommo.com.br>
    */
    _externalLink: function() {
        $('a[rel="external-link"]').click(function(){
            $(this).attr('target','_blank');
        });
    }



};
function realizabusca(texto) {
    var txt = document.getElementById(texto);
    window.location.href('/busca/Busca.aspx?sbusca=' + txt.value);
    //parent.window.open('/busca/Busca.aspx?sbusca=' + txt.value);
};

function linkBanner(param)
{
	if(param == 1)
	{
		// 1 top confort
		top.location.href='http://www.pompom.com.br/produtos/detalhe.aspx?idProduto=18'
	}
	if(param == 2)
	{
		// 2 protek
		top.location.href='http://www.pompom.com.br/produtos/detalhe.aspx?idProduto=19'
	}
	if(param == 3)
	{
		// 1 noturna
		top.location.href='http://www.pompom.com.br/produtos/detalhe.aspx?idProduto=17'
	}	
}
