$(document).ready(function() {
	
	// Minimale Hoehe links anpassen
	/*
	var hoeheRight = 0;
	
	$("#image_right img").each(function(){
		var hthis = $(this).height();
		hoeheRight = hoeheRight+hthis+20;
		alert(hthis);
	});




	$("#content").css({
		minHeight: hoeheRight+"px",
		height: "auto !important",
		height: hoeheRight+"px"
	});
	
	
	$("#search-query:[class!=hasBeenFocused]").live("focus", function(){
		$(this).val("").addClass("hasBeenFocused");
	});
	*/
	
	$(".styleswitcher a").click(function(){
		var color = $(this).find("img").attr("alt");

		$.get("ajax.php", { aktion: "setStyle", color: color },
		function(data){
			if(color == "") {
				$("head").append('<link href="/_css/default.css" type="text/css" rel="stylesheet" media="screen" />');
				$("#logo img").attr({src:'/_bilder/logo-cc-stey.png'});
			} else {
				$("head").append('<link href="/_css/'+color+'.css" type="text/css" rel="stylesheet" media="screen" />');
				$("#logo img").attr({src:'/_bilder/logo-cc-stey-'+color+'.png'});
			}
		});
	});
	
	
	
});


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;
}

function checktimeformat(time){
	var dateformat = /^\d{2}(\:)\d{2}$/;
	var result = dateformat.test(time);
	return result;
}
