// Initialise scripts
$(document).ready(function () {
    // Nav-main submenu
    $('#nav-main > li').hover(function () {
        $(this).addClass('active');
        $(this).find('ul').show();
    },
			function () {
			    $(this).removeClass('active');
			    $(this).find('ul').hide();
			}
		);
    $('#nav-main > li > ul').hover(function () {
        $(this).prev().addClass('active');
    },
			function () {
			    $(this).prev().removeClass('active');
			}
		);

    // Hide email
    $('span.mailme').mailme();

    // Put label in input fields
    // Search
    $('#header label').hide();
    $('#header input[type=text]').labelify({
        text: "label"
    });
    // Newsletter
    $('#footer label').hide();
    $('#footer input[type=text]').labelify({
        text: "label"
    });
    // Sidebar box type 1
    $('.sb-box-1 label').hide();
    $('.sb-box-1 input[type=text]').labelify({
        text: "label"
    });

    // temp page
    $('#tijdpag label').hide();
    $('#tijdpag input[type=text]').labelify({
        text: "label"
    });
    // Frm
    $('.frm label').hide();
    $('.frm input[type=text]').labelify({
        text: "label"
    });
    $('.frm textarea').labelify({
        text: "label"
    });

    // Content
    $('#content .col ul').prev('p').css('margin-bottom', '0');
    $('#content .col ol').prev('p').css('margin-bottom', '0');

    // TEMPLATES
    // Template-5
    $('.templ5 .full').hide();
    $('.templ5 .lnk-continue').click(function (event) {
        //event.preventDefault();
        //$(this).hide().next().toggle();
    });
    // Template-1 bis 1
    $('.templ1.bis1 .full').hide();
    $('.templ1.bis1 .lnk-continue').click(function (event) {
        //event.preventDefault();
        //$(this).hide().next().toggle();
    });

    // NEWS
    $('#tmplnews .lnk-continue').click(function (event) {
        //event.preventDefault();
        //$(this).hide().next().toggle();
    });

    // INIT TABS
    $('#tabs').slideShow();
    $('#tabs-nav li:odd a').addClass('odd');
    $('#tabs-nav li a').append('<span></span>');
    /*$('#tabs-panes li').hover(function(){
    $(this).find('a').css('text-decoration', 'underline');
    }, function(){
    $(this).find('a').css('text-decoration', 'none');	
    }
    );*/

    // Definition lists (used on Q&A)
    $('dd').addClass('hide');
    $('dt').hover(function () {
        $(this).css({ 'text-decoration': 'underline', 'cursor': 'pointer' });
    }, function () {
        $(this).css('text-decoration', 'none');
    });
    $('dt').click(function () {
        $(this).parent().find("dd").addClass('hide');
        $(this).toggleClass('open').next('dd').toggleClass('hide');
    });

    //segments
    $('.slideshow').cycle({ fx: 'fade', timeout: 3000 });
});

