jQuery.noConflict();
jQuery(document).ready(function(){

    //downloads page stijling
    jQuery("#download #main #download_items_detail .ringt h2, #download #main #download_items_detail .screens h2, #download #main #download_items_detail .vids h2").css("margin-top", "35px");
            jQuery("#download #main #download_items_detail .ringt h2:first, #download #main #download_items_detail .screens h2:first, #download #main #download_items_detail .vids h2:first").css("margin-top", "0px");

    //remove empty downloads categories & headers
    jQuery("p.empty").each(function(){

        jQuery(this).removeClass("empty");
        var className = jQuery(this).attr("class");
        jQuery("."+className).css("display", "none");
    });

    jQuery("#banners li:first-child").addClass('first-child');
    jQuery("#banners li:last-child").addClass('last-child');
    jQuery("#navigation li:last-child").addClass('last-child');
    jQuery("#navigation li:first-child").addClass('first-child');
    jQuery("#footer_info li:last-child").addClass('last-child');
    jQuery("#footer_info li:first-child").addClass('first-child');

    // LOGO SWITCH FOOTER: SWITCH COCA COLA WHITE LOGO WITH RED
    var bodyId = jQuery("body").attr("id");
    var bodyClass = jQuery("body").attr("class");
    var srcImg = jQuery("#banners .first-child img").attr("src");

    if(bodyId != "home" && bodyClass != "sprite-zero" && bodyClass != "coca-cola-light" && bodyClass != "powerade" && bodyClass != "minute-maid"  && bodyClass != "fernandes-light" && bodyClass != "fernandes-soft-drinks"  && bodyClass != "dasani" && bodyClass != "fernandes-sodawater" && bodyId != "events"){
        if(srcImg =="./uploads/banner/da6f9b98905a9c8bf25c07a733b09ce9a4d5f925.png"){
            jQuery("#banners .first-child img").attr("src", "./uploads/banner/da6f9b98905a9c8bf25c07a733b09ce9a4d5f925_white.png");
        }
    }  
    // END LOGO SWITCH FOOTER

    //LOGO FOOTER ANIMATION
    jQuery("#banners ul.thumb li").hover(function() {
            jQuery(this).css({'z-index' : '10'});
            jQuery(this).find('img').addClass("hover").stop()
                    .animate({
                            marginTop: '-50px',
                            marginLeft: '-50px',
                            top: '60%',
                            left: '50%',
                            width: '100px',
                            height: '100px',
                            padding: '0px'
                    }, 200);

            } , function() {
            jQuery(this).css({'z-index' : '0'});
            jQuery(this).find('img').removeClass("hover").stop()
                    .animate({
                            marginTop: '0',
                            marginLeft: '0',
                            top: '0',
                            left: '0',
                            width: '75px',
                            height: '75px',
                            padding: '0px'
                    }, 400);
        });


    // FOOTER LOGOS HOVER END

     jQuery("a.blank").click(function(){
         jQuery(this).attr("target", "_blank");
     });

     //lightbox

     //contact switch
    var contact_address     = jQuery("#contact_type").val();
    var contact_bottling    = "postmaster@fernandesbottling.com";
    var contact_verkoop     = "postmaster@fernandesbottling.com";
    var contact_consument   = "postmaster@fernandesbottling.com";
    var contact_klanten     = "postmaster@fernandesbottling.com";


    if(contact_address == "Fernandes Bottling Company N.V."){
        jQuery("#contactform_fields").show();
        jQuery(".contact_info_1").show();
        jQuery(".contact_info_2").hide();
        jQuery(".contact_info_3").hide();
        jQuery(".contact_info_4").hide();
        jQuery("#mail_to").val(contact_bottling);
    }
    if(contact_address == "Fernandes Verkoopmaatschappij N.V. Paramaribo"){
        jQuery("#contactform_fields").show();
        jQuery(".contact_info_2").show();
        jQuery(".contact_info_1").hide();
        jQuery(".contact_info_3").hide();
        jQuery(".contact_info_4").hide();
        jQuery("#mail_to").val(contact_verkoop);
    }
    if(contact_address == "Consumenten Service"){
        jQuery("#contactform_fields").hide();
        jQuery(".contact_info_3").show();
        jQuery(".contact_info_1").hide();
        jQuery(".contact_info_2").hide();
        jQuery(".contact_info_4").hide();
        jQuery("#mail_to").val(contact_consument);
    }
    if(contact_address == "Klanten Service"){
        jQuery("#contactform_fields").hide();
        jQuery(".contact_info_4").show();
        jQuery(".contact_info_1").hide();
        jQuery(".contact_info_2").hide();
        jQuery(".contact_info_3").hide();
        jQuery("#mail_to").val(contact_klanten);
    }


    jQuery('#contact_type').change(function() {
        //get the selected radio value
        var selectValue = jQuery("select#contact_type option:selected").val();

        if(selectValue == "Fernandes Bottling Company N.V."){
            jQuery("#contactform_fields").show();
            jQuery(".contact_info_1").show();
            jQuery(".contact_info_2").hide();
            jQuery(".contact_info_3").hide();
            jQuery(".contact_info_4").hide();
            jQuery("#mail_to").val(contact_bottling);
        }
        if(selectValue == "Fernandes Verkoopmaatschappij N.V. Paramaribo"){
            jQuery("#contactform_fields").show();
            jQuery(".contact_info_2").show();
            jQuery(".contact_info_1").hide();
            jQuery(".contact_info_3").hide();
            jQuery(".contact_info_4").hide();
            jQuery("#mail_to").val(contact_verkoop);
        }
        if(selectValue == "Consumenten Service"){
            jQuery("#contactform_fields").hide();
            jQuery(".contact_info_3").show();
            jQuery(".contact_info_1").hide();
            jQuery(".contact_info_2").hide();
            jQuery(".contact_info_4").hide();
            jQuery("#mail_to").val(contact_consument);
        }
        if(selectValue == "Klanten Service"){
           jQuery("#contactform_fields").hide();
            jQuery(".contact_info_4").show();
            jQuery(".contact_info_1").hide();
            jQuery(".contact_info_2").hide();
            jQuery(".contact_info_3").hide();
            jQuery("#mail_to").val(contact_klanten);
        }
    });
     //contact switch

        //Brands & Packages Tabs
        jQuery("#tabs").tabs();
        jQuery("#tabs").tabs().addClass('ui-tabs-vertical ui-helper-clearfix');
        jQuery("#tabs li").removeClass('ui-corner-top').addClass('ui-corner-left');
        //END Brands & Packages Tabs

        //downloads overlay

        //programma popup
       jQuery('.videos li #flash').click(function(){
           jQuery('#programma_overlay').fadeIn(300);
       });


       jQuery('#programma_content img.close').click(function(){
           jQuery('#programma_overlay').fadeOut(300);
       });


    jQuery(function() {
        jQuery('#content #gallery a').lightBox();
    });
    
    jQuery(function() {
        jQuery('a.image').lightBox();
    });
     
});