﻿function initMenu() {
  $('#submenu ul').hide();
  $('#submenu ul.active').show();
  $('#submenu li a').click(
    function() {
      var checkElement = $(this).next();
      if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
        return false;
        }
      if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
        $('#submenu ul:visible').slideUp('normal');
        checkElement.slideDown('normal');
        return false;
        }
      }
    );
  }

$(document).ready( function(){
    Cufon.replace('#reserveermid', {
        fontFamily: 'centold',
        fontSize: '14px',
        color: '#212121',
        hover: {
    	    color: '#212121'
        }
    });
    
    Cufon.replace('.maintitle, .maintitlebinnen', {
        fontFamily: 'geo',
        fontSize: '23px',
        color: '#25211e'
    });
    
    Cufon.replace('.mainsubtitle', {
        fontFamily: 'geo',
        fontSize: '23px',
        color: '#25211e'
    });
    
    initMenu();
    
    $('#topcontentright').cycle({
        fx: 'fade'
    });
    
    $('#fotoviewer').cycle({ 
        fx:     'fade',
        speed: '200',
        continuous: 0,
        prev: '#prev',
        next: '#next',
        timeout: 0
    });

    $("a.booknow").fancybox({
	    'hideOnContentClick': false,
	    'zoomSpeedIn':	0, 
	    'zoomSpeedOut':	0, 
	    'overlayShow':	true,
	    'overlayColor': '#000',
	    'overlayOpacity': 0.8,
	    'width': 490,
	    'height': 550
    });
    
    $("a.fotoviewer").fancybox({
	    'hideOnContentClick': false,
	    'zoomSpeedIn':	0, 
	    'zoomSpeedOut':	0, 
	    'overlayShow':	true,
	    'overlayColor': '#000',
	    'overlayOpacity': 0.8
    });
    
    $(".youtube").click(function() {
	    $.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'width'		: 680,
			'height'		: 495,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});
	return false;
    });
});
