/*
Site: Hotsite Delicia (Bunge)
URL: http://www.delicia.com.br/
Nome do arquivo: jquery.ini.js
Caminho do arquivo: /web/js/

Descrição:
Este é o JS que contém os scripts do site inseridos manualmente (sem plugin).
Foi escrito com jQuery.
*/

jQuery(document).ready(function ($) {

    /* =Aplica o Cufon (fonte diferenciada nas tags selecionadas)
    -------------------------------------------------------------- */
    Cufon('.menu_cadastre-se, ul > li > a, #rodape address, h4', { hover: true });






















    /* =Pegar pagina atual e aplicar classe 'ativo'
    -------------------------------------------------------------- */
    var url = window.location.href;

    if (url.match(/Supreme\/Default\.aspx$/)) { $('#menu_supreme').addClass('ativo'); }
    if (url.match(/Produtos\/Extra\-Cremosa\.aspx$/) || url.match(/Produtos\/Light\.aspx$/) || url.match(/Produtos\/Mila\.aspx$/)) {
        $('#menu_produtos').addClass('ativo');
    }
    if (url.match(/Contatos\/Fale\-Conosco\.aspx$/)) { $('#menu_fale-conosco').addClass('ativo'); }
    if (url.match(/Wallpapers\/Default\.aspx$/)) { $('#menu_wallpapers').addClass('ativo'); }






















    /* =Hover no submenu Produtos
    -------------------------------------------------------------- */

    $('#submenu_produtos').find('dl dt a img').css('opacity', '0.8');

    $('#submenu_produtos').find('dl').hover(function () {
        $(this).find('dt a img').stop().animate({ 'opacity': '1' }, 150);
    }, function () {
        $(this).find('dt a img').stop().animate({ 'opacity': '0.8' }, 150);
    });













    /* =Efeito Fancybox em imagens
    -------------------------------------------------------------- */
    $('a.fancybox').fancybox();

    $("a.fancybox_video").click(function () {
        $.fancybox({
            'padding': 0,
            'autoScale': false,
            'transitionIn': 'none',
            'transitionOut': 'none',
            'title': this.title,
            'href': this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
            'type': 'swf',    // <--add a comma here
            'swf': { 'allowfullscreen': 'true', 'wmode': 'opaque'} // <-- flashvars here
        });
        return false;

    });

    $('.politica').fancybox({
        'type': 'iframe',
        'width': '90%',
        'height': '90%'
    });





















    /* =Deixar botão input sem texto.
    -------------------------------------------------------------- */
    $('input[type=submit]').val('');

    /*=Compatibilidade do Cufon com IE. Essa linha deve ficar sempre por último
    -------------------------------------------------------------- */
    Cufon.now();




});

