Cufon.replace('.tekst h1, .tekst h2, .call h2, .tekst h3, .nieuws h2, .shop h2, .shop h3, .shoplijst h3, .shoplijst h4, .hoofdcategorie h3, .winkelwagen .h3, span.titel, span.titelCat, .menu a', { fontFamily: 'Zurich Cn BT' });
//Cufon.replace('.slogan h1, .slogan span', { fontFamily: 'zurichi' });

$(function(){ 
    $('.fadein img:gt(0)').hide();
    setInterval(function(){
      $('.fadein :first-child').fadeOut()
         .next('img').fadeIn()
         .end().appendTo('.fadein');}, 
      5000);
});
	
$(function()
{
	$("a.specs").click(function(event) {
	event.preventDefault();
	$("a.specs").hide();
	$("a.close").show();
	$(".expandable").slideToggle();
	});
	
	$("a.close").click(function(event) {
	event.preventDefault();
	$("a.specs").show();
	$("a.close").hide();
	$(".expandable").slideToggle();
	});
	
	$("input.callf").click(function(event) {
	$(".call_form").fadeIn("slow");
	});
});

$(document).ready(function() {
	
	var $currElement = $("#step1");
	
	$('a.lightbox').fancybox({
		'transitionIn'	: 'fade',
		'transitionOut'	: 'fade',
		'titlePosition'	: 'over',
		'overlayShow'	: false
	});
	
	/*
	
	$("a.lightbox").fancybox({
		'title'				: true,
        'transitionIn'		: 'fade',
		'transitionOut'		: 'fade',
		'titlePosition'		: 'over',
		'hideOnContentClick': false
	});
	
	$("a#inline").fancybox({
		// 'hideOnContentClick': true
	});
	
	$("a.maps").fancybox({
		'width'				: 700,
		'title'				: true,
		'titlePosition'		: 'over',
		'height'			: 500,
        'autoScale'     	: false,
        'transitionIn'		: 'fade',
		'transitionOut'		: 'fade',
		'type'				: 'iframe'
		});
	*/
	
	$("#shopBtnCart").click( function()		{ window.location.href = 'http://bnfa.novi.net/nl/shop/winkelwagen'; });
	$("#shopBtnWizard").click( function()		{ window.location.href = 'http://bnfa.novi.net/nl/shop/wizard'; });
	$("#shopBtnAfronden").click( function()	{ window.location.href = 'http://bnfa.novi.net/nl/shop/afronden/gegevens'; });
	$("#shopBtnControle").click( function()	{ window.location.href = 'http://bnfa.novi.net/nl/shop/afronden/controle'; });
	$("#shopBtnVerzenden").click( function()	{ window.location.href = 'http://bnfa.novi.net/nl/shop/afronden'; });
	
	$(".btnAdd").click(function(){
        //Get the id of this clicked item

       pos = this.id;
        alert(pos);
        
        window.location.href = 'http://bnfa.novi.net/nl/shop/winkelwagen';
    });
	
	$(".shopdelete").click(function(){

       pos = '#shop' + this.id;
       
       if( confirm('Weet u het zeker?') )
    	   {
    	   $( pos ).remove();
    	   }        
    });
	
	$(".btnNext").click( function() { wizardVolgendeStap(); } )
	
	function wizardVolgendeStap()
	{
		if( !$currElement.next('.wizardStep').length )
		{
			window.location.href = 'http://bnfa.novi.net/nl/shop/winkelwagen';
		}
		else
		{
			$currElement.removeClass('activeWizardStep').addClass('wizardStep');			
			$currElement = $currElement.next('.wizardStep');			
			$currElement.removeClass('wizardStep').addClass('activeWizardStep');
			
			$.get('shoppages/'+$currElement.attr('id')+'.cfm', function(data){
				$('#wizard_data_content').html(data);
				Cufon.replace('.tekst h1, .tekst h2, .call h2, .tekst h3, .nieuws h2, .shop h2, .shop h3, .shoplijst h3, .shoplijst h4, .hoofdcategorie h3, .winkelwagen .h3, span.titel, span.titelCat, .menu a', { fontFamily: 'Zurich Cn BT' });
				$(".btnNext").click( function() { wizardVolgendeStap(); } )
				 });
		}	
	}
	
	$("#btnBack").click( function() { 
		if( !$currElement.prev('.wizardStep').length )
		{
			window.location.href = 'http://bnfa.novi.net/nl/shop';
		}
		else
		{
			$currElement.removeClass('activeWizardStep').addClass('wizardStep');		
			$currElement = $currElement.prev('.wizardStep');		
			$currElement.removeClass('wizardStep').addClass('activeWizardStep');
			
			$.get('shoppages/'+$currElement.attr('id')+'.cfm', function(data){
				$('#wizard_data_content').html(data);
				Cufon.replace('.tekst h1, .tekst h2, .call h2, .tekst h3, .nieuws h2, .shop h2, .shop h3, .shoplijst h3, .shoplijst h4, .hoofdcategorie h3, .winkelwagen .h3, span.titel, span.titelCat, .menu a', { fontFamily: 'Zurich Cn BT' });
				$(".btnNext").click( function() { wizardVolgendeStap(); } )
				 });
		}
		
	} )	
});

(function($) {
  $.fn.toggleFade = function(settings)
  {
  	settings = jQuery.extend(
  		{
        speedIn: "normal",
        speedOut: settings.speedIn
  		}, settings
  	);
  	return this.each(function()
  	{
  	  var isHidden = jQuery(this).is(":hidden");
      jQuery(this)[ isHidden ? "fadeIn" : "fadeOut" ]( isHidden ? settings.speedIn : settings.speedOut);
    });
  };
})(jQuery);




