$(document).ready(function() {
	
	// Minimale Hoehe links anpassen
	var hoeheRight = $("#right").height();
	$("#left").css({
		minHeight: hoeheRight+"px",
		height: "auto !important",
		height: "hoeheRight+4px"
	});
	
	$("#search-query:[class!=hasBeenFocused]").live("focus", function(){
		$(this).val("").addClass("hasBeenFocused");;
	});
	
	function hrefVimeo(ref) {
		ref = ref.split("/");
		ref = ref[ref.length-1];
		ref = 'http://player.vimeo.com/video/'+ref+'?portrait=0&amp;color=99cd66&amp;autoplay=1';
		return ref;	
	}
	
	$("a.iframe").each(function(){
		var ref = hrefVimeo( $(this).attr("href") );	
		$(this).attr({href:ref});
	});
	
	$("a.iframe").fancybox({
		'overlayColor'	: '#333',
		'overlayOpacity': 0.9,
		'cyclic'		: true,
		'padding'		: 0,
		'speedIn'			:500
	});
	
});


function validEmail(email) {
  var strReg = "^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$";
  var regex = new RegExp(strReg);
  return(regex.test(email));
}

function checkdateformat(datum){
	var dateformat = /^\d{2}(\.)\d{2}(\.)\d{4}$/;
	var result = dateformat.test(datum);
	return result;
}
