            $(document).ready(function(){
            //nav menu active tab
                $('.nav li').hover(function(){
                    $(this).addClass("active1")
                },function(){
                    $(this).removeClass("active1");
                });
            //navigation drop down
                $('.nav li.down').hover(function(){
                    $('.snav').hide()
                   $(this).children('.snav').show()
                });

            //homepage fadebox
                $('.box a').hover(function(){
                    $('.box .subtitle').hide()
                   $(this).children('.boxim').fadeTo(300, 0.2)
                   $(this).children('span').fadeIn('fast')
                }, function(){
                   $(this).children('.boxim').fadeTo(800, 1)
                    $('.box span').fadeOut('slow')
                });

            //about fadecontent
                $('.fadedad').click(function(){
                    $('.fadechild').hide();

                    var fadecontent = $(this).attr('title');
                    var valueF = ('#' + fadecontent);
                    $(valueF).fadeIn()
                });

            //about, whybother - fade on enter
            function fadeChild(){
                var valueG = location.hash
                $('.fadechild').hide();
                $(valueG).fadeIn();
            }
            
            function subchild(){
            var valueSub =location.hash
                    $(valueSub).css({"background-color" : "#ccca0e", "padding" : "10px"})
                    $(valueSub).next('p').after('<a href="javascript:history.go(-1)"> [Go back to previous page]</a> | <a rel="#header"> [Go to the Top]</a>')
            }
                if (location.hash == "#kids"){
                    subchild();
                }
                else if (location.hash == "#cdp"){
                    subchild();
                }
                else {
                    if (location.hash != 0){
                        fadeChild();
                       $('html,body').animate(
                       {scrollTop: $(location.hash).offset().top});
                    }
                }
            //homepage whats on highlight
            $('.meetings').click(function(){$('#bottomside').addClass('grey')});

//scroll to using rel
var jump=function(e)
{
       e.preventDefault();
       var target = $(this).attr("rel");
       $('html,body').animate(
       {
               scrollTop: $(target).offset().top
       },1000,function()
       {
               location.hash = target;
       });

}


$('a[rel*=#]').bind("click", jump);
return false;



            });

$(function(){
    $('#goToContactForm').click(function(){
        $('#contact').append('<div class="contactPointer"><img src="images/arrow.png" alt="" /></div>');
        $('#contact > .contactPointer').animate({top: '-=200px'}, 500)
            .animate({top: '-240px'}, 500)
            .animate({top: '-100px'}, 300)
            .animate({top: '-200px'}, 400)
            .animate({top: '-120px'}, 180)
            .animate({top: '-200px'}, 500)
            .animate({top: '-100px', opacity: '1'}, 500, function(){
                $(this).fadeOut(800, function(){$(this).remove();});
            })
    });

    $('#highlightContact').click(function(){
        var waitFirst = setTimeout(function(){
            $('#david > img').animate({width: '211px'}, 200).animate({width: '280px'}, 500)
        }, 1000)
    });
});
