(function($) {
	$(function() {
	
	// CLEAR INPUT FIELD
	$('.setclear').each(function() {
		var default_value = this.value;
		$(this).focus(function(){
			if(this.value == default_value) {
				this.value = '';
			}
		});

		$(this).blur(function(){
			if(this.value == '') {
				this.value = default_value;
			}
		});
	});
	
	//$('section.post a.link').click(function(event) {
		//event.preventDefault();
		//window.location ='/category/news';
	//});
    
	var boxheight=$('div#main').css('height');
	boxheight=parseInt(boxheight.replace("px", ""))-248;

	if (boxheight>40) { 
	$('.colorbox').height(boxheight).show();
	}
    
	$('a.link.cbox').colorbox({iframe:true, innerWidth:520, innerHeight:480});

	$('.lupe').append('<div class="lupe"></div>');
	
	$('#google').click(function(event){
			event.preventDefault();
			var adresse = $("#anfahrt").val();
			window.open("http://maps.google.com/maps?f=d&source=s_d&saddr="+adresse+"&daddr=Altheimerstrasse+1+89435+Mörslingen&hl=de&ie=UTF8&t=h&z=9&", "_blank", "NEW WINDOW")
			});
		
	})
})(jQuery)
