function mycarousel_itemVisibleInCallback(carousel, item, i, state, evt)
{
	var idx = carousel.index(i, mycarousel_itemList.length);
	carousel.add(i, mycarousel_getItemHTML(mycarousel_itemList[idx - 1]));
};

function mycarousel_itemVisibleOutCallback(carousel, item, i, state, evt)
{
	carousel.remove(i);
};

function mycarousel_getItemHTML(item)
{
	return '<a href=\"'+ item.link +'\"><img src=\"' + item.url + '\" width=\"120\" height=\"60\" alt=\"' + item.title + '\" /></a>';
};

function mycarousel_initCallback(carousel)
{
	carousel.buttonNext.bind('mouseover', function() {
		carousel.startAuto(1);
	});
	carousel.buttonPrev.bind('mouseover', function() {
		carousel.startAuto(1);
	});
	carousel.clip.hover(function() {
		carousel.stopAuto();
	}, function() {
		carousel.startAuto();
	});
};


function InEnUitKlappen(id)
{
	if(document.getElementById(id).style.display == 'none')
    {
        document.getElementById(id).style.display = 'block';
    }
    else
    {
        document.getElementById(id).style.display = 'none';
    }
}

function plaatjeWisselen(id,httppad,kleur)
{
	if(document.getElementById(id).src == httppad+'images/iconen/btn_maxi'+kleur+'.gif')
    {
        document.getElementById(id).src = httppad+'images/iconen/btn_mini'+kleur+'.gif';
    }
    else
    {
        document.getElementById(id).src = httppad+'images/iconen/btn_maxi'+kleur+'.gif';
    }
}

function plaatjeWisselen2(obj,httppad) {
	var pad = jQuery(obj).find('img').attr('src');
	if(pad == httppad + 'images/iconen/btn_maxi.gif') {
		jQuery(obj).find('img').attr('src', httppad + 'images/iconen/btn_mini.gif');
	} else {
		jQuery(obj).find('img').attr('src', httppad + 'images/iconen/btn_maxi.gif')
	}
}

function vullingtonen(naam,menunaam,nr,aantal)
{
	for (i=1;i<=aantal;i++)
	{
		document.getElementById(naam+i).style.display = 'none';
		document.getElementById(menunaam+i).className = 'BLOGsubmenuNietActief';
	}
    document.getElementById(naam+nr).style.display = 'block';
    document.getElementById(menunaam+nr).className = 'BLOGsubmenuActief';
}

function vullingtonentype(naam,menunaam,nr,aantal,type)
{
	for (i=1;i<=aantal;i++)
	{
		document.getElementById(naam+i).style.display = 'none';
		document.getElementById(menunaam+i).className = type+'submenuNietActief';
	}
    document.getElementById(naam+nr).style.display = 'block';
    document.getElementById(menunaam+nr).className = type+'submenuActief';
}

/* Profiel functies */
function profileAddItem(name)
{
	option = jQuery("#profiel" + name + " .other input").val();

	if(option != "")
	{
		jQuery("#profiel" + name + " .other").before("<label><input class=\"checkbox\" type=\"checkbox\" name=\"data[" + name + "][]\" value=\"" + option.replace(/\"/g, '&quot;') + "\" checked=\"checked\" />" + option + "</label>");
		jQuery("#profiel" + name + " .other input").val("");
	}
}

function areYouSure(message,link) {
	if(confirm(message)) {
		document.location = link;
	} else {
		return false;
	}
}

function textCounter(field, countfield, limit)
{
    if (field.value.length > limit)
    {
        field.value = field.value.substring(0, limit);
    }
    else
    {
        document.getElementById(countfield).innerHTML = limit - field.value.length + "/"+limit+" karakters over";
    }
}

function copyQuote(reactieid) {
	jQuery('#userreactietxt').append('[quote]'+jQuery('#reactietxt'+reactieid).html()+'[/quote]');
}

function showBlok(blokid) {
	jQuery('.headline').css('display','none');
	jQuery('.blok'+blokid).css('display','block');
	jQuery('.pageLink').css('font-weight','normal');
	jQuery('.link'+blokid).css('font-weight','bold');
}

function showPage(pageid) {
	jQuery('.pageScroller').css('display','none');
	jQuery('.page'+pageid).css('display','block');
	jQuery('.pageLink').css('font-weight','normal');
	jQuery('.link'+pageid).css('font-weight','bold');
}

function FMBChangeVid(videoid) {
	jQuery('#vidContent').html(jQuery('#video'+videoid).html());
	jQuery('#vidTitle').html(jQuery('#videotitle'+videoid).html());
	jQuery('#videotext').html(jQuery('#videotext'+videoid).html());
	jQuery('#videoimage').attr('src',jQuery('#videoimage'+videoid).attr('src'));
}

function openWindow(url,hoogte,breedte) {
	var disp_setting =  "toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,width="+breedte+", height="+hoogte+"";
	window.open(url,"",disp_setting);
	return false;
}