var $an = null;
var $anelm = null;
function info(name, elm){
	if($an!=null){
		$an.css('display', 'none');
		$an.css('z-index', 0);
		$anelm.style.color = '#888';
		$an = null;
		$anelm = null;
	}
	if($(name).length>0){
		$(name).css('display', 'block');
		$(name).css('z-index', 10);
		elm.style.color = '#e38';
		$an = $(name);
		$anelm = elm;
	}
}
function gross(obj){
	var $img = obj.src.substr(0,obj.src.length-4);
	$('#gross img').attr('src', $img);
	$('#gross').fadeIn(500);
	$('#gross img').load(function() {
		var width = window.innerWidth-40 || (window.document.documentElement.clientWidth-40 || window.document.body.clientWidth-40);
		var height = window.innerHeight-40 || (window.document.documentElement.clientHeight-40 || window.document.body.clientHeight-40);
		if(this.width > width){
			$('#gross > div > img').attr('width', width);
		}
		if(this.height > height){
			$('#gross > div > img').attr('height', height);
		}
	});
}
function weg(){
	$('#gross').fadeOut(500, function(){
		$('#gross img').unbind();
		$('#gross img').removeAttr('src');
		$('#gross img').removeAttr('width');
		$('#gross img').removeAttr('height');
	});
}
$('document').ready(function(){
	$('form').validVal({supportHtml5: true, language: 'de'});
});
