var timeDiff  =  {
    setStartTime:function (){
        d = new Date();
        time  = d.getTime();
    },

    getDiff:function (){
        d = new Date();
        return (d.getTime()-time);
    }
};
//timeDiff.setStartTime();
Cufon.set('fontFamily', 'FUTURAN').replace('a.hoofdmenu',{hover: true});
Cufon.set('fontFamily', 'FUTURAH').replace('h1.title')
('h1.maintitle')
('h1.crosstitle')
('#mandT')
('#homeslide2')
('td.formheader_left')
('td.formheader_right')
('h4.tussenkopje')
('div.formrighttitle')
('a.cartmenu',{hover: true})
('span.cartmenu',{hover: true});

$(document).ready(function(){
	
	$('#akkoord').click(function(){
		if($(this).is(':checked')){
			$('#gotostap2').removeClass('volgendestap_off');
			$('#gotostap2').addClass('volgendestap');
			$('#gotostap2').text('Verder met bestellen - ga naar stap 2');
			$('#gotostap2').attr({href: $('#gotostap2').attr('hrefon')});
			$('#divsaver').load('modules/ajax.load.shop.savestep1.php?akkoord=ja');		
		}else{
			$('#gotostap2').removeClass('volgendestap');
			$('#gotostap2').addClass('volgendestap_off');
			$('#gotostap2').text('Accepteer eerst de voorwaarden!');
			$('#gotostap2').attr({href: $('#gotostap2').attr('hrefoff')});
			$('#divsaver').load('modules/ajax.load.shop.savestep1.php?akkoord=nee');	
		}		
	});
	
	$('#homeslide').cycle();
	//$('#homeslide2 ul').cycle();
	
	$('#faq').change(function(){
		$('#accordion').load('modules/faqlist.inc.php?id='+$(this).val(), false, function(){
			$('#accordion').accordion({ 
				collapsible: true,
				active: false,
				autoHeight: false,
				clearStyle: true
			});			
		});
	});
	
	$('#prodslideshow').cycle({
		pager:  '#prodpager', 
   		pagerAnchorBuilder: function(idx, slide) { 
        	return '#prodpager a:eq(' + idx + ')'; 
    	} 		
	});
	
	$("a.fancybox").fancybox();
	$("a.cartfoto").fancybox();
	
	$("form.shopper").submit(function(){
		
		tb_show('Toevoegen', $(this).attr('action')
								+'&aantal='+ $('#aantal').val()
								+'&versieid='+ $('#versieid').val() 
								+'&productid='+ $('#productid').val() 
								+'&placeValuesBeforeTB_=savedValues&height=184&width=463&modal=true', ''); 
								
		
		$('#mand1').load('includes/winkelwagenaantal.php?aantal=aantal');
		$('#mand2').load('includes/winkelwagenaantal.php?aantal=prijs');
	
	return false;
		
	});
	
	$("#inlogform3").submit(function(e){
		e.preventDefault();
		dataString = $(this).serialize();
		targetDiv = $(this).attr('target');
		
		$.ajax({  
		  type: "post",  
		  url: $(this).attr('action'),  
		  data: dataString,  
		  dataType: 'text',
		  success: function(data, textStatus) {  
			 $(targetDiv).html(data);
		  }  
	});
	
	}) 
	
	
});

