function renderFonts()
{
	Cufon.replace('#slogan', {hover: true});
}


function plaatsInWinkelwagen(id,aantal,el,forceerAantal){
	if($(el).find('.aantalinwinkelwagen').length)
		var oudAantal = parseInt($(el).find('.aantalinwinkelwagen').html().replace('(',''));
	else
		var oudAantal = 0;
	$.getScript('/ajax/webshop/winkelwagen/toevoegen/'+id+'/'+aantal+'/'+(forceerAantal==true?1:0),function(data){
		if (data)
			$(el).fadeTo(300,0.7,function(){ $(el).find('.aantalinwinkelwagen').html('('+(oudAantal>0?oudAantal+aantal:1)+')'); $(el).fadeTo(300,1); })
	});
	
	$('#winkelwagen').css('background','#EEE');
	$('#winkelwagen').css('border-radius','5px');
	setTimeout(function(){
		$('#winkelwagen').css('background','transparent');
		$('#winkelwagen ').css('border-radius','0');
	},500);
	
	$.get('/ajax/winkelwagenlink', function(link) {
		setTimeout(function(){
			window.location = link;
		},200);
	});
	
}
function zoekPagina(nummer){
	$('#zoeken').append('<input type="hidden" name="page" value="' + nummer + '">');
	$('#zoeken').submit();
}
function vulInlogformulier(emailadres,wachtwoord){
	if ($('#inloggen input[name=gebruikersnaam]').val()=='')
		$('#inloggen input[name=gebruikersnaam]').val(emailadres);
	if ($('#inloggen input[name=wachtwoord]').val()=='')
		$('#inloggen input[name=wachtwoord]').val(wachtwoord);
}

var d=document, imgs = new Array(), zInterval = null, current=0, pause=false, sfeerfotosInterval, sfeerfotosFadeSnelheid;

function sfeerfotosInit() {
    if (!sfeerfotosInterval)
        sfeerfotosInterval = 5000;
    if(!sfeerfotosFadeSnelheid)
        sfeerfotosFadeSnelheid = 20; // +/- 1 sec. afhankelijk van de snelheid van je browser/computer
    if(!d.getElementById || !d.createElement)return;

    imgs = $('.uitgelicht');
    for(i=1;i<imgs.length;i++)
        imgs[i].xOpacity = 0;
    imgs[0].style.display = "block";
    imgs[0].xOpacity = .99;

    setTimeout(so_xfade,sfeerfotosInterval);
}

function so_xfade() {
    cOpacity = imgs[current].xOpacity;
    nIndex = imgs[current+1]?current+1:0;

    nOpacity = imgs[nIndex].xOpacity;
    cOpacity-=0.02;
    nOpacity+=0.02;

    imgs[nIndex].style.display = "block";
    imgs[current].xOpacity = cOpacity;
    imgs[nIndex].xOpacity = nOpacity;

    setOpacity(imgs[current]);
    setOpacity(imgs[nIndex]);

    if(cOpacity<=0) {
        imgs[current].style.display = "none";
        current = nIndex;
        setTimeout(so_xfade,sfeerfotosInterval);
    } else {
        setTimeout(so_xfade,sfeerfotosFadeSnelheid);
    }

    function setOpacity(obj) {
        if(obj.xOpacity>.99) {
            obj.xOpacity = .99;
            return;
        }
        obj.style.opacity = obj.xOpacity;
        obj.style.MozOpacity = obj.xOpacity;
        obj.style.filter = "alpha(opacity=" + (obj.xOpacity*100) + ")";
    }
}
