/***********************
*  Site Specific JS   *
************************/

$(document).ready(function() {
    $('.fancybox').fancybox();
    /*the success message from contact form    */
    $('.flashes').appendTo("#success");
    // success form submit colour changes
    $('.flashes').css("background-color", "#faa732");
    $('.flash_success').css("color", "white");

    /* appending the nav    */
    $('.nav').appendTo('#main-nav');

    //removing linked style sheets
    $('link[href="http://cdn.myld.com.au/1/bootstrap/edge/css/styles.css"]').remove();

    /* appending the ld logo */
    ldbrandingResize();

    /* animated settings */
    ! function($) {
        $('#main-nav a').hover(function() {
            $(this).addClass('animated pulse')
        }, function() {
            $(this).removeClass('animated pulse')
        });
        $('.footer-nav .nav  > li > a').hover(function() {
            $(this).addClass('animated pulse')
        }, function() {
            $(this).removeClass('animated pulse')
        });
        $('.contact-section .btn-send').hover(function() {
            $(this).addClass('animated tada')
        }, function() {
            $(this).removeClass('animated tada')
        });

    }(window.jQuery);

    /* carousel */

    $('#gallery-1').carousel({
        interval: 4000
    });


}); /*end of doc ready func */




// Form Validation 2.0

$(document).ready(function() {

    $('#custom_form').formValidation({
        validateText: ["name-field"],
        validateEmail: ["email-field"],
        validateSpam: true
    });

});
/* appending the ldlogo */

function ldbrandingResize() {

    //adding in the ldbrand to the footer-nav
    var ldbranding = "<div id='totop' class='grid-12 pull-right' style='margin-left: 15px; margin-top: -2px'><div id='ld_branding'> \
    <a href='http://www.localdirectories.com.au/'><img \
    src='http://cdn.myld.com.au/1/images/logos/poweredbyld_darkgrey.png'\
    alt='LD Web Services'></a><br/><br/>"

    var logo = "<a class='social-media ld pull-right' title='Local Directories' href='http://www.localdirectories.com.au/Northern-Rivers,NSW/Cleaning-Neways/profile/d66Q' target='_blank' style=' margin-left:10px;'  ></a> <a class='social-media facebook pull-right' title='Facebook' href='https://www.facebook.com/cleaningneways' target='_blank' rel='tooltip' data-placement='top' ></a>"
    $('.navTwo').append(ldbranding);
    $('.navTwo').append(logo);
}