﻿$(function() {
    $('div#newsLetter div.sendBtn').click(function() {
        if ($('input#newsletterMail').val() !== '') {
            post();
        }
    });
    
    $('a.scrollTo').click(function(e) {
        e.preventDefault();
        
        scrollTo($(this).attr('href'));
    });
    
    $("#orderOverlay").css("height", $("body").height());
});

function scrollTo(id) {
    $('html, body').animate({ 'scroll-top': $(id).offset().top }, 'slow');
}

function postTo(url) {
    $('form#aspnetForm').attr('action', url).submit();
}

function post() {
    postTo(location.href);
}

function goTo(url) {
    location.assign(url);
}

