$(document).ready(function () {
	
	Cufon.replace('.entry-title');
	Cufon.replace('#about h2');
	Cufon.replace('#sponsors h2');
	Cufon.replace('#contact h2');
	Cufon.replace('#access');
	Cufon.replace('.xoxo li h1');
	Cufon.replace('#catsss li');
	
	Cufon.replace('.cat h1');
	Cufon.replace('.fotos h2');
	Cufon.replace('.widget-title');
	
	$("#newsemail").click(function(){
		if($("#newsemail").val()=="your email"){
			$("#newsemail").val("");	
		}
	});
	
	
	$(".nextbtn").click(function(){
		var paro=$(this).parent().parent().find('div');
		var curId=parseInt($(this).parent().parent().find('.curid').html());
		
		if(curId<paro.find("img").length-1){
			curId = parseInt(curId + 1);
			$(this).parent().parent().find('.curid').html(curId);
			
			
			
			
			var breedte=0;
			var id=0;
			paro.find('img').each(function(){
				if(id<curId){
	       			breedte = Math.floor(parseInt(breedte + $(this).width()));
	       		}
	       		id=parseInt(id+1);
		    });
			
			breedte = parseInt(-breedte)+'';
			paro.animate({"marginLeft":breedte},'fast');
		}
		return false;
	});
	
	
	$(".prevbtn").click(function(){
		var paro=$(this).parent().parent().find('div');
		var curId=parseInt($(this).parent().parent().find('.curid').html());
		
		if(curId>0){
			curId = parseInt(curId - 1);
			$(this).parent().parent().find('.curid').html(curId);
			
			var breedte=0;
			var id=0;
			paro.find('img').each(function(){
				if(id<curId){
		   			breedte = Math.floor(parseInt(breedte + $(this).width()));
		   		}
		   		id=parseInt(id+1);
		    });
		    
			breedte = parseInt(-breedte)+'';
			paro.animate({"marginLeft":breedte},'fast');
		}
		return false;
	});
	
});
