/**
*  @author DraftFactory <matt@sandfighter.net>
*  @copyright  2010-2011 DraftFactory
*  @version  Release: $Revision: 1.4 $
*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*/
var jump=function(e)
{
    //prevent the "normal" behaviour which would be a "hard" jump
    e.preventDefault();
    //Get the target
    var target = $(this).attr("href");
    //perform animated scrolling
    $('html,body').animate({
        //get top-position of target-element and set it as scroll target
        scrollTop: $(target).offset().top
    //scrolldelay: 2 seconds
    },1000);
}
$(document).ready(function() {
	var is_visible = false;
	$('a[href$=#top]').bind("click", jump);
	$('body').click(function() {
        $('.sub-nav').fadeOut(150);
        $('.menu-btn').removeClass('active');
    });
	$(".menu-btn").click(function(event){
		var nav = $(this).parents().children(".sub-nav");
		if (nav.is(":hidden")){
			nav.fadeIn(300);
			$(this).addClass('active');
			event.stopPropagation();
			event.preventDefault();
		} else {
			nav.fadeOut(300);
			$(this).removeClass('active');
		}
	});
	$('#search-text').watermark('Looking for something?').focus();
	$('.newsletter-box').watermark('Type your email here...');
	$('.icon-promo, .social a, .secure li').tipTip({defaultPosition: 'top', maxWidth: '300px'});
	//$('a.map').fancybox();
});
