File: D:/HostingSpaces/SBogers10/verrassendveel.komma.pro/wwwroot/js/langstraat.js
// JavaScript Document
var currentBannerImage = 1;
var numLargeBanner = 1;
var largeBannerIntv = null;
$(document).ready(function(){
// var w = Number($('#bannerquote1').width()) + Number(88);
// var newW = 976 - w;
// $('#bannerquote1').css({ left: newW+'px', zIndex : 4 });
//
// var w = Number($('#bannerquote2').width()) + Number(88);
// var newW = 976 - w;
// $('#bannerquote2').css({ left: newW+'px', zIndex : 4 });
//
// var w = Number($('#bannerquote3').width()) + Number(88);
// var newW = 976 - w;
// $('#bannerquote3').css({ left: newW+'px', zIndex : 4 });
//
// var w = Number($('#bannerquote4').width()) + Number(88);
// var newW = 976 - w;
// $('#bannerquote4').css({ left: newW+'px', zIndex : 4 });
//
// var w = Number($('#bannerquote5').width()) + Number(88);
// var newW = 976 - w;
// $('#bannerquote5').css({ left: newW+'px', zIndex : 4 });
setTimeout(function(){ largeBannerNext(true) }, 100);
setTimeout(function(){ largeBannerNext(false) }, 6000);
initHovers();
resizer();
$(window).resize(function () {
resizer();
});
//correctThumbnails()
});
function initHovers(){
//images
$('.image-holder').hover(function(){ $(this).children('.hover').stop().animate({opacity: 1},200); }, function(){ $(this).children('.hover').stop().animate({opacity: 0},200); });
//hover button
$('.hover-button').hover(function(){ $(this).children('.hover').stop().animate({opacity: 1},100); }, function(){ $(this).children('.hover').stop().animate({opacity: 0},100); });
}
function correctThumbnails(){
$('.thumb-row').each(function(){
var rowHeight = $(this).height();
$(this).children().each(function() {
if($(this).hasClass('thumb-holder')){
$(this).css({height : (rowHeight + 208)+'px'});
}
});
});
}
function resizer() {
$('#banner-holder').height($('#banner-holder').width()/976 * 304);
}
function largeBannerNext(first){
clearTimeout(largeBannerIntv);
largeBannerIntv = setTimeout(function(){ largeBannerNext(false) }, 6000);
if(!first){
//clear current
var speed = 500;
$('#bannerimage'+currentBannerImage).stop().animate({ opacity : 0},speed);
$('#bannerimage'+currentBannerImage).css({ zIndex : 5 });
var w = Number($('#bannerquote'+currentBannerImage).width()) + Number(88);
var newW = 976 - w;
$('#bannerquote'+currentBannerImage).stop().animate({opacity: 0 },speed);
$('#bannerquote'+currentBannerImage).css({ zIndex : 4 });
$('#largebannercount'+currentBannerImage).removeClass('active');
}
//set new
if(currentBannerImage != numLargeBanner){
currentBannerImage++;
}
else{
currentBannerImage = 1;
}
$('#largebannercount'+currentBannerImage).addClass('active');
$('#bannerimage'+currentBannerImage).stop().animate({ opacity : 1},speed);
$('#bannerimage'+currentBannerImage).css({ zIndex : 10 });
var w = Number($('#bannerquote'+currentBannerImage).width()) + Number(16);
var newW = 976 - w;
$('#bannerquote'+currentBannerImage).stop().animate({ opacity: 1},speed);
$('#bannerquote'+currentBannerImage).css({ zIndex : 11 });
}
function largeBannerPrev(){
clearTimeout(largeBannerIntv);
largeBannerIntv = setTimeout(largeBannerNext,6200);
var speed = 700;
$('#largebannercount'+currentBannerImage).removeClass('active');
$('#bannerimage'+currentBannerImage).stop().animate({ opacity : 0},speed);
if(currentBannerImage != 1){
currentBannerImage--;
}
else{
currentBannerImage = numLargeBanner;
}
$('#largebannercount'+currentBannerImage).addClass('active');
$('#bannerimage'+currentBannerImage).stop().animate({ opacity : 1},speed);
}
function updateNumLargeBanner(num){
numLargeBanner = num;
}
function updateSession(session, value){
$('#jsbox').load('./php/js_updateSession.php?sessionName=' + session + '&value=' + value,function() {
window.location.reload()
});
}