simpleCart.currency({
code: "SEK" ,
name: "Swedish Krona" ,
symbol: " kr" ,
delimiter: " " ,
decimal: "," ,
after: true ,
accuracy: 2
});
simpleCart({
currency: "SEK",
taxRate: 0.25,
checkout: {
type: "SendForm" ,
url: "/checkout.php" ,
method: "POST" ,
success: "success.html" ,
cancel: "cancel.html" ,
// an option list of extra name/value pairs that can
// be sent along with the checkout data
extra_data: {
storename: "Diploma Utbildning",
cartid: "12321321"
}
},
cartColumns: [
{ attr: "name" , label: "Utbildning" } ,
{ attr: "price" , label: "Pris", view: 'currency' } ,
{ attr: "id" , label: "ID" } ,
{ view: "remove" , label: "Åtgärd", text: "Ta bort" }
],
cartStyle: "table"
});
(function($) {
"use strict"; // Start of use strict
// jQuery for page scrolling feature - requires jQuery Easing plugin
$('a.page-scroll').bind('click', function(event) {
var $anchor = $(this);
$('html, body').stop().animate({
scrollTop: ($($anchor.attr('href')).offset().top - 50)
}, 1250, 'easeInOutExpo');
event.preventDefault();
});
// Highlight the top nav as scrolling occurs
$('body').scrollspy({
target: '.navbar-fixed-top',
offset: 51
})
// Closes the Responsive Menu on Menu Item Click
$('.navbar-collapse ul li a:not(.dropdown-toggle)').click(function() {
$('.navbar-toggle:visible').click();
});
// Fit Text Plugin for Main Header
var maxh1FontSize = 65;
if (document.width <= 480) maxh1FontSize = 22;
else if (document.width <= 667) maxh1FontSize = 40;
else if (document.width <= 768) maxh1FontSize = 45;
else if (document.width <= 1024) maxh1FontSize = 60;
$("h1").fitText(
1.2, {
minFontSize: '23px',
maxFontSize: maxh1FontSize + 'px'
}
);
// Offset for Main Navigation
$('#mainNav').affix({
offset: {
top: 100
}
});
// Update the slogans with transition.
var currentSlogan = 0;
var slogans = [
"Traditionell utbildning
möter den digitala världen",
"Vi digitaliserar Sveriges
populäraste utbildningar",
"Vad vill du lära dig?
Kom igång redan idag"
];
function updateSlogan() {
$(".header-content-inner h1").fadeOut(function() {
$(this).html(slogans[currentSlogan])
}).fadeIn();
if (currentSlogan == 2) currentSlogan = 0;
else currentSlogan++;
setTimeout(updateSlogan, 6000);
}
//updateSlogan();
//setInterval(updateSlogan, 6000);
$(".header-content-inner img.sr-contact").on( "click", function() {
$('#promo-video-box').modal('show');
$('#promo-video-box iframe').attr("src", "https://www.youtube.com/embed/dVBfs_IKgPk?autoplay=1");
//?autoplay=1
//$("#video_player")[0].play();
});
// Stop video on modal exit
$('#promo-video-box').on('hidden.bs.modal', function () {
$('#promo-video-box iframe').attr("src", "");
});
// Initialize and Configure Scroll Reveal Animation
window.sr = ScrollReveal();
sr.reveal('.sr-icons', {
duration: 600,
scale: 0.3,
distance: '0px'
}, 200);
sr.reveal('.sr-button', {
duration: 1000,
delay: 200
});
sr.reveal('.sr-contact', {
duration: 600,
scale: 0.3,
distance: '0px'
}, 300);
sr.reveal('.sr-img', {
duration: 600,
scale: 0.3,
distance: '0px'
}, 300);
sr.reveal('.sr-img-1', { duration: 600 }, 300);
sr.reveal('.sr-img-2', { duration: 600 }, 300);
sr.reveal('.sr-img-3', { duration: 600 }, 300);
sr.reveal('.sr-img-4', { duration: 600 }, 300);
sr.reveal('.sr-img-5', { duration: 600 }, 300);
sr.reveal('.sr-img-6', { duration: 600 }, 300);
sr.reveal('.sr-img-7', { duration: 600 }, 300);
sr.reveal('.sr-img-8', { duration: 600 }, 300);
$(".nav-search").on( "click", function() {
$( "#q" ).focus();
});
$(".nav-login").on( "click", function() {
$('#login-box').modal('show');
});
})(jQuery); // End of use strict
// Variable to hold request
var request;
// Bind to the submit event of our form
$("#contact-form").submit(function(event){
// Abort any pending request
if (request) {
request.abort();
}
// setup some local variables
var $form = $(this);
var ready = true;
// Clear old errors
$("#contact-form .error").removeClass("error");
// Check if all fields are filled out - if not, signal to user
if ($("#contact-form input[name=name]").val().length === 0) {
$("#contact-form input[name=name]").addClass("error");
ready = false;
}
if ($("#contact-form input[name=email]").val().length === 0) {
$("#contact-form input[name=email]").addClass("error");
ready = false;
}
if ($("#contact-form textarea").val().length === 0) {
$("#contact-form textarea").addClass("error");
ready = false;
}
if (ready) {
// Let's select and cache all the fields
var $inputs = $form.find("input, select, button, textarea");
// Serialize the data in the form
var serializedData = $form.serialize();
// Let's disable the inputs for the duration of the Ajax request.
// Note: we disable elements AFTER the form data has been serialized.
// Disabled form elements will not be serialized.
$inputs.prop("disabled", true);
// Fire off the request to /form.php
request = $.ajax({
url: "/api/mail.php?c=first-page-contact",
type: "post",
data: serializedData
});
// Callback handler that will be called on success
request.done(function (response, textStatus, jqXHR){
// Log a message to the console
if (response == "1") {
$("#contact div.alert-success").removeClass("hide");
$("#contact-form input, #contact-form textarea").val("");
} else {
$("#contact div.alert-danger").removeClass("hide");
}
});
// Callback handler that will be called on failure
request.fail(function (jqXHR, textStatus, errorThrown){
// Log the error to the console
console.error(
"The following error occurred: "+
textStatus, errorThrown
);
});
// Callback handler that will be called regardless
// if the request failed or succeeded
request.always(function () {
// Reenable the inputs
$inputs.prop("disabled", false);
});
}
// Prevent default posting of form
event.preventDefault();
});
/*
$(".button-purchase").on( "click", function() {
setTimeout( function() {
$("form fieldset section label").wrap("