File: D:/HostingSpaces/EUmans/dak-spouwmuurisolatie.be/wwwroot/css-js/umans.js
function getScrollY() {
var scrOfY = 0;
if( typeof( window.pageYOffset ) == 'number' ) {
//Netscape compliant
scrOfY = window.pageYOffset;
} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
//DOM compliant
scrOfY = document.body.scrollTop;
} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
//IE6 standards compliant mode
scrOfY = document.documentElement.scrollTop;
}
return scrOfY;
}
//function to handle the posTop from the previous page
//making a string from the url, splitting the characters after '#', string to number, setting the body scoll bar
function positionPrePage() {
var currentPosTop = (document.URL);
var mySplitResult = currentPosTop.split("#");
currentPosTop = mySplitResult[1];
parseFloat('currentPosTop');
document.documentElement.scrollTop = currentPosTop;
document.body.scrollTop = currentPosTop;
}
function linkPositionAdd(){
$('a.jsPositie').click(function(e) {
e.preventDefault();
var orgURL = $(this).attr('href');
var currentPosTop = getScrollY();
window.location.href = orgURL+"#572";
});
}
//ON DOC READY
$(document).ready(function(){
positionPrePage();
linkPositionAdd();
var windowWidth = screen.availWidth;
var windowHeight = screen.availHeight;
if(windowWidth > 1440){
$('#header').addClass('groot');
$('#header').removeClass('klein');
}else{
$('#header').addClass('klein');
$('#header').removeClass('groot');
}
// if($('#landing_contLeft').length){
//
// if (windowHeight > 760){
// $('#landing_contLeft').css('height', function() {
// var naam = screen.availHeight + 'px';
// return naam;
// });
// }
// if (windowHeight > 760){
// $('#landing_contRight').css('height', function() {
// var naam = screen.availHeight + 'px';
// return naam;
// });
// }
// }
//MENU DIRECT
$('#mainMenu li').click(function(){
window.location.href = $('a',this).attr('href');
});
$('.spotlight_container').click(function(e){
if(e.target.tagName != 'A') {
window.location.href = $('a',this).attr('href');
}
});
$('.spotlight_container').hover(function() {
$("> .spotlight_img", this).stop().animate({"opacity": "0.9"}, "fast");
},
function() {
$("> .spotlight_img", this).stop().animate({"opacity": "1"}, "fast");
});
//COURIER LINKS ON HOVER
$(".courierLink a").hover(function() {
$(this).stop().animate({ color: "#3BAF31" }, "medium");
},function() {
$(this).stop().animate({ color: "#C9C9C9" }, "medium");
});
//ACTION BTN ON HOVER
$('a.actionBtn').hover(function() {
$("> .hover", this).stop().animate({"opacity": "1"}, "fast");
$("> .hoverRight", this).stop().animate({"opacity": "1"}, "fast");
$("> .up", this).stop().animate({"opacity": "0"}, "medium");
$("> .upRight", this).stop().animate({"opacity": "0"}, "medium");
},
function() {
$("> .hover", this).stop().animate({"opacity": "0"}, "medium");
$("> .hoverRight", this).stop().animate({"opacity": "0"}, "medium");
$("> .up", this).stop().animate({"opacity": "1"}, "fast");
$("> .upRight", this).stop().animate({"opacity": "1"}, "fast");
});
//ACTION SPOTLIGHT_CONTACTINFO
$('a.spotlight_contactInfo').hover(function() {
$(this).stop().animate({ color: "#3BAF31" }, "medium");
$("> .hover", this).stop().animate({"opacity": "1"}, "fast");
$("> .up", this).stop().animate({"opacity": "0"}, "medium");
},
function() {
$(this).stop().animate({ color: "#707070" }, "medium");
$("> .hover", this).stop().animate({"opacity": "0"}, "medium");
$("> .up", this).stop().animate({"opacity": "1"}, "fast");
});
//PHOTO GALLLERY
var activeFoto = 0;
var totalFotos = $(".photoViewer_container li").length;
var galleryPlay = true;
$(".photoViewer_container li").eq(0).css({'display':'block'});
$(".photoViewer_menu li a").eq(0).toggleClass("active");
$(".thumbItemMenu a").eq(0).toggleClass("active");
function fotoRotate(){
if(galleryPlay){
$.doTimeout( 4000, function(){
if(galleryPlay){
$(".photoViewer_container li").eq(activeFoto).fadeOut('slow');
$(".photoViewer_menu li a").eq(activeFoto).toggleClass("active");
$(".photoViewer_menu li a .up").eq(activeFoto).stop().animate({"opacity": "1"}, "fast");
$(".photoViewer_menu li a .hover").eq(activeFoto).stop().animate({"opacity": "0"}, "fast");
if($('.thumbItemMenu').length){
$(".thumbItemMenu a").eq(activeFoto).toggleClass("active");
$(".thumbItemMenu a .hover").eq(activeFoto).stop().animate({"opacity": "0"}, "fast");
}
activeFoto = activeFoto + 1;
if(activeFoto == totalFotos) {
activeFoto = 0;
}
$(".photoViewer_menu li a").eq(activeFoto).toggleClass("active");
$(".photoViewer_menu li a .up").eq(activeFoto).stop().animate({"opacity": "0"}, "fast");
$(".photoViewer_menu li a .hover").eq(activeFoto).stop().animate({"opacity": "1"}, "fast")
$(".photoViewer_container li").eq(activeFoto).fadeIn('slow');
if($('.thumbItemMenu').length){
$(".thumbItemMenu a .hover").eq(activeFoto).stop().animate({"opacity": "1"}, "fast");
$(".thumbItemMenu a").eq(activeFoto).toggleClass("active");
}
fotoRotate();
}
});
}
}
fotoRotate();
$('.photoViewer_menu li a').each(function(index) {
$(this).click(function(e){
e.preventDefault;
clickAction(index);
});
});
$('.thumbItemMenu a').each(function(index) {
$(this).click(function(e){
e.preventDefault;
clickAction(index);
});
});
$('a.pausePlay').click(function(e) {
e.preventDefault;
if (galleryPlay == false) {
$(this).removeClass('playBtn');
$(this).addClass('pauzeBtn');
galleryPlay = true;
fotoRotate();
} else {
galleryPlay = false;
$(this).removeClass('pauzeBtn');
$(this).addClass('playBtn');
}
});
function clickAction(newActive){
if(galleryPlay){
$('a.pausePlay').removeClass('pauzeBtn');
$('a.pausePlay').addClass('playBtn');
}
$(".photoViewer_menu li a").eq(activeFoto).toggleClass("active");
$(".photoViewer_menu li a .up").eq(activeFoto).stop().animate({"opacity": "1"}, "fast");
$(".photoViewer_menu li a .hover").eq(activeFoto).stop().animate({"opacity": "0"}, "medium");
if($('.thumbItemMenu').length){
$(".thumbItemMenu a .hover").eq(activeFoto).stop().animate({"opacity": "0"}, "fast");
$(".thumbItemMenu a").eq(activeFoto).toggleClass("active");
}
galleryPlay = false;
$(".photoViewer_container li").eq(activeFoto).fadeOut('slow');
$(".photoViewer_container li").eq(newActive).fadeIn('slow');
$(".photoViewer_menu li a").eq(newActive).toggleClass("active");
if($('.thumbItemMenu').length){
$(".thumbItemMenu a .hover").eq(newActive).stop().animate({"opacity": "1"}, "fast");
$(".thumbItemMenu a").eq(newActive).toggleClass("active");
}
activeFoto = newActive;
}
//NRBTNVIEWER BTN ON HOVER
$('.photoViewer_menu li a').hover(function() {
$("> .up", this).stop().animate({"opacity": "0"}, "fast");
$("> .hover", this).stop().animate({"opacity": "1"}, "fast");
},
function(){
if(!$(this).hasClass("active")) {
$("> .up", this).stop().animate({"opacity": "1"}, "fast");
$("> .hover", this).stop().animate({"opacity": "0"}, "medium");
}
});
$('.photoSelection a').hover(function() {
$("> .hover", this).stop().animate({"opacity": "1"}, "fast");
},
function(){
if(!$(this).hasClass("active")) {
$("> .hover", this).stop().animate({"opacity": "0"}, "fast");
}
});
$('.photoSelection_showroom a').hover(function() {
$("> .hover", this).stop().animate({"opacity": "1"}, "fast");
},
function(){
if(!$(this).hasClass("active")) {
$("> .hover", this).stop().animate({"opacity": "0"}, "fast");
}
});
//landingpage
$('#landing_contLeft').click(function(e){
if(e.target.tagName != 'A') {
window.location.href = $('#landing_linkLeft a',this).attr('href');
}
});
$('#landing_contRight').click(function(e){
if(e.target.tagName != 'A') {
window.location.href = $('#landing_linkRight a',this).attr('href');
}
});
$('#landing_contLeft').hover(function(){
$("#landing_contRight").stop().animate({"opacity": ".8"}, "slow");
},function(){
$("#landing_contRight").stop().animate({"opacity": "1"}, "slow");
});
$('#landing_contRight').hover(function(){
$("#landing_contLeft").stop().animate({"opacity": ".8"}, "slow");
},function(){
$("#landing_contLeft").stop().animate({"opacity": "1"}, "slow");
});
//CONTACTFORM
if($('#contactform.contactformulier').length){
if($('#contactformForm')){
$('<input type="hidden" />').attr({
name: 'secretcode',
id: 'secretcode',
value: 'spamcheckkomma'
}).appendTo("#contactformForm");
}
$("a.contactformSubmit").click(function(){
$(".error").hide();
var hasContactError = false;
var emailReg = /[\w-\.]+@([\w-]+\.)+[\w-]{2,4}/;
var contactNaamVal = $("#naam").val();
if(contactNaamVal == '' || contactNaamVal == 'naam') {
$("#naam").css('color','#E70000');
$("#naamLabel").css('color','#E70000');
hasContactError = true;
}else{
$("#naam").css('color','#000');
$("#naamLabel").css('color','#3BAF31');
}
var contactWoonAdresVal = $("#woonAdres").val();
if(contactWoonAdresVal == '' || contactWoonAdresVal == 'woon-adres') {
$("#woonAdres").css('color','#E70000');
$("#woonAdresLabel").css('color','#E70000');
hasContactError = true;
}else{
$("#woonAdres").css('color','#000');
$("#woonAdresLabel").css('color','#3BAF31');
}
var contactWoonplaatsVal = $("#woonplaats").val();
if(contactWoonplaatsVal == '' || contactWoonplaatsVal == 'woonplaats') {
$("#woonplaats").css('color','#E70000');
$("#woonplaatsLabel").css('color','#E70000');
hasContactError = true;
}else{
$("#woonplaats").css('color','#000');
$("#woonplaatsLabel").css('color','#3BAF31');
}
var contactNummerVal = $("#telefoonnummer").val();
if(contactNummerVal == '' || contactNummerVal == 'telefoonnummer') {
$("#telefoonnummer").css('color','#E70000');
$("#telefoonnummerLabel").css('color','#E70000');
hasContactError = true;
}else{
$("#telefoonnummer").css('color','#000');
$("#telefoonnummerLabel").css('color','#3BAF31');
}
var contactEmailVal = $("#emailadres").val();
if(contactEmailVal == '' || contactEmailVal == 'e-mailadres' || !emailReg.test(contactEmailVal)) {
$("#emailadres").css('color','#E70000');
$("#emailadresLabel").css('color','#E70000');
hasContactError = true;
}else{
$("#emailadres").css('color','#000');
$("#emailadresLabel").css('color','#3BAF31');
}
var contactBerichtVal = $("#opmerkingen").val();
if(contactBerichtVal == '' || contactBerichtVal == 'uw vraag en/of opmerking') {
$("#opmerkingen").css('color','#E70000');
$("#opmerkingenLabel").css('color','#E70000');
hasContactError = true;
}else{
$("#opmerkingen").css('color','#000');
$("#opmerkingenLabel").css('color','#3BAF31');
}
var secretcode = $("#secretcode").val();
if(hasContactError == false) {
$.post("/contactformVerzenden.php",
{ naam: contactNaamVal, woonAdres: contactWoonAdresVal, woonplaats: contactWoonplaatsVal, telefoon: contactNummerVal, email: contactEmailVal, bericht: contactBerichtVal, secretcode: secretcode },
function(data){
$("#contactform").fadeOut("slow", function() {
$("#contactformReplacement").fadeIn("slow");
});
}
);
}else{
$('#errorContact').css('display','block');
}
return false;
});
}
if($('#contactform.offerte').length){
if($('#geslachtMan').is(':checked')) {
$('#geslachtMan').addClass("selected");
}
if($('#geslachtVrouw').is(':checked')) {
$('#geslachtVrouw').addClass("selected");
}
$('#geslachtManLabel').click(function(){ $('#geslachtMan').addClass("selected"); $('#geslachtVrouw').removeClass("selected"); });
$('#geslachtMan').click(function(){ $('#geslachtMan').addClass("selected"); $('#geslachtVrouw').removeClass("selected"); });
$('#geslachtVrouwLabel').click(function(){ $('#geslachtVrouw').addClass("selected"); $('#geslachtMan').removeClass("selected"); });
$('#geslachtVrouw').click(function(){ $('#geslachtVrouw').addClass("selected"); $('#geslachtMan').removeClass("selected"); });
if($('#contactformForm')){
$('<input type="hidden" />').attr({
name: 'secretcode',
id: 'secretcode',
value: 'spamcheckkomma'
}).appendTo("#contactformForm");
}
$("a.contactformSubmit").click(function(){
$(".error").hide();
var hasContactError = false;
var emailReg = /[\w-\.]+@([\w-]+\.)+[\w-]{2,4}/;
if($("#geslachtMan.selected").length || $("#geslachtVrouw.selected").length) {
if($("#geslachtMan").hasClass("selected")) {
var contactGeslachtVal = "man";
}else{
var contactGeslachtVal = "vrouw";
}
$("#geslachtManLabel").css('color','#707070');
$("#geslachtVrouwLabel").css('color','#707070');
$("#geslachtLabel").css('color','#3BAF31');
}else{
$("#geslachtLabel").css('color','#E70000');
$("#geslachtManLabel").css('color','#E70000');
$("#geslachtVrouwLabel").css('color','#E70000');
hasContactError = true;
}
var contactNaamVal = $("#naam").val();
if(contactNaamVal == '' || contactNaamVal == 'naam') {
$("#naam").css('color','#E70000');
$("#naamLabel").css('color','#E70000');
hasContactError = true;
}else{
$("#naam").css('color','#000');
$("#naamLabel").css('color','#3BAF31');
}
var contactBedrijfsnaamVal = $("#bedrijfsnaam").val();
var contactWoonAdresVal = $("#woonAdres").val();
if(contactWoonAdresVal == '' || contactWoonAdresVal == 'woon-adres') {
$("#woonAdres").css('color','#E70000');
$("#woonAdresLabel").css('color','#E70000');
hasContactError = true;
}else{
$("#woonAdres").css('color','#000');
$("#woonAdresLabel").css('color','#3BAF31');
}
var contactWoonplaatsVal = $("#woonplaats").val();
if(contactWoonplaatsVal == '' || contactWoonplaatsVal == 'woonplaats') {
$("#woonplaats").css('color','#E70000');
$("#woonplaatsLabel").css('color','#E70000');
hasContactError = true;
}else{
$("#woonplaats").css('color','#000');
$("#woonplaatsLabel").css('color','#3BAF31');
}
var contactNummerVal = $("#telefoonnummer").val();
if(contactNummerVal == '' || contactNummerVal == 'telefoonnummer') {
$("#telefoonnummer").css('color','#E70000');
$("#telefoonnummerLabel").css('color','#E70000');
hasContactError = true;
}else{
$("#telefoonnummer").css('color','#000');
$("#telefoonnummerLabel").css('color','#3BAF31');
}
var contactEmailVal = $("#emailadres").val();
if(contactEmailVal == '' || contactEmailVal == 'e-mailadres' || !emailReg.test(contactEmailVal)) {
$("#emailadres").css('color','#E70000');
$("#emailadresLabel").css('color','#E70000');
hasContactError = true;
}else{
$("#emailadres").css('color','#000');
$("#emailadresLabel").css('color','#3BAF31');
}
var contactBerichtVal = $("#opmerkingen").val();
if(contactBerichtVal == '' || contactBerichtVal == 'uw vraag en/of opmerking') {
$("#opmerkingen").css('color','#E70000');
$("#opmerkingenLabel").css('color','#E70000');
hasContactError = true;
}else{
$("#opmerkingen").css('color','#000');
$("#opmerkingenLabel").css('color','#3BAF31');
}
var secretcode = $("#secretcode").val();
if(hasContactError == false) {
$.post("/offerteformVerzenden.php",
{ geslacht: contactGeslachtVal, naam: contactNaamVal, woonAdres: contactWoonAdresVal, woonplaats: contactWoonplaatsVal, bedrijfsnaam: contactBedrijfsnaamVal, telefoon: contactNummerVal, email: contactEmailVal, bericht: contactBerichtVal, secretcode: secretcode },
function(data){
$("#contactform").fadeOut("slow", function() {
$("#contactformReplacement").fadeIn("slow");
});
}
);
}else{
$('#errorContact').css('display','block');
}
return false;
});
}
});
$(window).resize(function() {
var windowWidth = screen.availWidth;
var windowHeight = screen.availHeight;
if(windowWidth > 1440){
$('#header').addClass('groot');
$('#header').removeClass('klein');
}else{
$('#header').addClass('klein');
$('#header').removeClass('groot');
}
// if($('#landing_contLeft').length){
//
// if (windowHeight > 760){
// $('#landing_contLeft').css('height', function() {
// var naam = screen.availHeight + 'px';
// return naam;
// });
// }
// if (windowHeight > 760){
// $('#landing_contRight').css('height', function() {
// var naam = screen.availHeight + 'px';
// return naam;
// });
// }
// }
});