Cufon.replace('.kolumn h2 a', { fontFamily: 'Etelka', hover: true });
Cufon.replace('#home-content h1', { fontFamily: 'Etelka', hover: true });
Cufon.replace('#content h1', { fontFamily: 'Etelka', hover: true });
Cufon.replace('#footer-info', { fontFamily: 'Etelka', hover: true });
//Cufon.replace('.back_js a, .info a', { fontFamily: 'Etelka', hover: true });

function IsEmailCorrect(email) {
  return email.match(/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+\.)+([a-zA-Z]{2,4})$/)!=null;
}

$(document).ready(function(){
						   
	$("a.stuur_door").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': true, 'overlayOpacity': 0.8, 'hideOnContentClick': false, 'frameWidth': 480, 'frameHeight': 390 });
						   
	$(".change_photo").click(function(){
			$("#photo-to-change").attr('src','/files/1/'+$(this).attr('rel'));
			return false;
		})
	$(".contactform input[name=name]").focus(function(){
			if ($(this).attr('value')=='Uw naam') $(this).attr('value','');
		})
	$(".contactform input[name=name]").blur(function(){
			if ($(this).attr('value')=='') $(this).attr('value','Uw naam');
		})
	$(".contactform input[name=mail]").focus(function(){
			if ($(this).attr('value')=='E-mailadres') $(this).attr('value','');
		})
	$(".contactform input[name=mail]").blur(function(){
			if ($(this).attr('value')=='') $(this).attr('value','E-mailadres');
		})	
	$(".contactform textarea[name=text]").focus(function(){
			if ($(this).attr('value')=='Type hier uw bericht') $(this).attr('value','');
		})
	$(".contactform textarea[name=text]").blur(function(){
			if ($(this).attr('value')=='') $(this).attr('value','Type hier uw bericht');
		})
	$(".contactform").submit(function(){
			if ($(this).find('input[name=name]').attr('value')=='' || $(this).find('input[name=name]').attr('value')=='Naam')
				{
				alert('Graag uw naam invullen');
				return false;
				}
			if (!IsEmailCorrect($(this).find('input[name=mail]').attr('value')))
				{
				alert('Graag uw e-mailadres invullen');
				return false;
				}
			if ($(this).find('textarea[name=text]').attr('value')=='' || $(this).find('textarea[name=text]').attr('value')=='Type hier uw bericht')
				{
				alert('Graag het berichtveld invullen');
				return false;
				}
		});	
	$(".back_js a").click(function() {history.back(); return false;})
	
	//$("#friends form input[name=your_name]").
});

function friends(address,where)
{
	if ($("#friends form input[name=your_name]").attr('value')=='')
		{
			alert('Vul uw naam in');
			return false;
		}
	if (!IsEmailCorrect($("#friends form input[name=your_mail]").attr('value')))
		{
			alert('Vul uw e-mailadres in');
			return false;
		}
	if ($("#friends form input[name=friend_name]").attr('value')=='')
		{
			alert('Vul de naam van uw kennis in');
			return false;
		}
	if (!IsEmailCorrect($("#friends form input[name=friend_mail]").attr('value')))
		{
			alert('Vul het e-mailadres van uw kennis in');
			return false;
		}
	your_name=$("#friends form input[name=your_name]").attr('value');
	your_mail=$("#friends form input[name=your_mail]").attr('value');
	friend_name=$("#friends form input[name=friend_name]").attr('value');
	friend_mail=$("#friends form input[name=friend_mail]").attr('value');
	text=$("#friends form textarea[name=text]").attr('value');
	$("#friends").parent().load( where , { 'your_name': your_name, 'your_mail': your_mail, 'friend_name': friend_name, 'friend_mail': friend_mail, 'text': text, 'sent': 1, 'address': address } );
	return false;

}
