$(document).ready(function(){	

//Open Slider 
	$(".slider").easySlider({
		auto: true,
		continuous: true,
		numeric: true
	});
//Close Slider

//Open Drop Down Menu
	$('.band').hover(function() {
        $(this).children('.band-subnav').slideDown('fast');
    },
    function() {
        $(this).children('.band-subnav').slideUp('fast');
    });
    
    $('.resources').hover(function() {
        $(this).children('.resources-subnav').slideDown('fast');
    },
    function() {
        $(this).children('.resources-subnav').slideUp('fast');
    });
//Close Drop Down Menu

//Open Navigation Tracker
    $(window).scroll(function() {
    var scrollPos   =   $(this).scrollTop();
    var contentPos  =   $('.content').position().top;
    var menuPos     =   $('.presskit-nav').position().top;
    var conHeight   =   $('.content').outerHeight(true); 
    var menuHeight  =   $('.presskit-nav').outerHeight(true);
    var bottomPos   =   (contentPos + conHeight) - menuHeight;

    if (scrollPos > contentPos && !(scrollPos >= bottomPos)) {
        $('.presskit-nav').css({'position': 'fixed', 'top': 0});
    } 
    else if (scrollPos >= bottomPos) {
        $('.presskit-nav').css({'position': 'absolute', 'top': bottomPos});
    }  
    else {
        $('.presskit-nav').css({'position': 'absolute', 'top': contentPos});
    }

    });
//Close Navigation Tracker
    
//Open Scroll Slider on Anchor Clicks
    
    $(".scroll").click(function(event){
    //prevent the default action for the click event
    event.preventDefault();

    //get the full url - like mysitecom/index.htm#home
    var full_url = this.href;

    //split the url by # and get the anchor target name - home in mysitecom/index.htm#home
    var parts = full_url.split("#");
    var trgt = parts[1];

    //get the top offset of the target anchor
    var target_offset = $("#"+trgt).offset();
    var target_top = target_offset.top;

    //goto that anchor by setting the body scroll top to anchor top
    $('html, body').animate({scrollTop:target_top}, 500);
    
    });
//Close Scroll Slider on Anchor Clicks

//Open Form Field Name

    $('input.name').example('FIRST AND LAST NAME');
    $('input.email').example('EMAIL ADDRESS');
    $('input.dates').example('EVENT DATES');
    $('input.phone').example('PHONE NUMBER');    
    $('textarea.event-description').example('EVENT DESCRIPTION');
    $('textarea.role').example('OUR ROLE AT THE EVENT');
    $('input.username').example('USERNAME...');
    $('input.password').example('PASSWORD...');
    
});


