var activeMenu; var timeoutMenu; var activeRotate = -1; $(document).ready(function() { //watermark search //$('div.search input').eq(0).watermark('Zoekterm'); //$('div#Login div.customForm_Row input').eq(0).watermark('Gebruikersnaam'); //$('div#Login div.customForm_Row input').eq(1).watermark('Wachtwoord'); if ($('div.controlBorder').length > 0) { $('body').addClass('backoffice'); backoffice = true; } $('div.home div.columns2 div.col2 div.content:last p:last').css('padding-bottom', '0px'); //Menu $('div#Menu div.AspNet-TreeView > ul > li:first').addClass('first'); $('div#Menu div.AspNet-TreeView > ul > li:last').addClass('last'); $('div#Submenu div.AspNet-TreeView > ul > li:last').addClass('last'); $('div#Menu div.AspNet-TreeView > ul > li').each(function() { $(this).mouseenter(function() { clearTimeout(timeoutMenu); if (activeMenu && activeMenu.index() != $(this).index()) { leaveMenu(); } activeMenu = $(this); $(this).addClass('hover'); $(this).find('ul').slideDown(300); }); }); $('div#Menu div.AspNet-TreeView').mouseleave(function() { timeoutMenu = setTimeout(leaveMenu, 300); }); //Columns $('div.columns4').each(function() { var columns = $(this).find('div.col1 div.content, div.col2 div.content, div.col3 div.content, div.col4 div.content'); var maxSize = 0; columns.each(function() { if ($(this).height() > maxSize) { maxSize = $(this).height(); } }); columns.height(maxSize); }); //Products $('div#ProductOverview div.product').each(function(index) { if ((index + 1) % 3 == 0) { $(this).addClass('breakItem'); } }); //Expand $('div.expand').each(function() { $(this).find('div.link a').click(function() { var info = $(this).parents('div.expand').find('div.info'); info.stop(true, true); info.slideToggle('slow'); }); }); //Home Rotator if ($('div#Content div#IntroRight.homeRotator').length > 0 && $('div#Content div#IntroRight.homeRotator p').length > 0 && backoffice == false) { $('div#Content div#IntroRight.homeRotator').append('
 
'); $('div#Content div#IntroRight.homeRotator').append('
 
'); $('div#Content div#IntroRight.homeRotator div.rotateRight').click(function() { rotateHome(1); }); $('div#Content div#IntroRight.homeRotator div.rotateLeft').click(function() { rotateHome(-1); }); $('div#Content div#IntroRight.homeRotator p').css('opacity', 0); rotateHome(1); } //Fix for error CMS $('div.NavNext input[type=submit], div.nextStep div.label a').click(function() { setTimeout(function() { $('div.error span').each(function() { if ($(this).css('display') == 'inline') { $(this).css('display', 'block'); } }); }, 50) }); Cufon.replace('h1, h2, h3, h4, div#Menu div.AspNet-TreeView > ul > li > a, div#Submenu div.AspNet-TreeView > ul > li > a'); }); function rotateHome(direction) { var rotators = $('div#Content div#IntroRight.homeRotator p'); var newIndex; if (activeRotate == (rotators.length - 1) && direction > 0) { newIndex = 0; } else if (direction > 0) { newIndex = activeRotate + 1; } else if (activeRotate == 0 && direction < 0) { newIndex = rotators.length - 1; } else if (direction < 0) { newIndex = activeRotate - 1; } var newRotate = rotators.eq(newIndex); var oldRotate = rotators.eq(activeRotate); newRotate.css('z-index', rotators.length); newRotate.stop(); oldRotate.stop(); newRotate.fadeTo(1000, 1); oldRotate.fadeTo(1000, 0, function() { $(this).css('z-index', '0') }); activeRotate = newIndex; setTimeout(function() { rotateHome(1) }, 5000); } function leaveMenu() { $(activeMenu).find('ul').stop(true, true); $(activeMenu).find('ul').slideUp(200, function() { $(this).removeClass('hover') }); //activeMenu.removeClass('hover') }