//wait for DOM ready
$(document).ready(function(){

	
//input funktionen
jQuery.fn.DefaultValue = function(){
		// Scope\
		var elements = this;
		var args = arguments;
		var c = 0;
		return(
			elements.each(function(){
				// Default values within scope
				var el = $(this);
				var def = args[c++];
 
				el.val(def).focus(function(){
					$(this).addClass('hasfocus');
					if(el.val() == def){
						el.val("");
					}
					el.blur(function(){
					$(this).removeClass('hasfocus');
						if(el.val() == ""){
							el.val(def);
					}
				});
			});
		})
	);
};
$('input.kname').DefaultValue('Ihr Name');
$('input.ktel').DefaultValue('Ihre Telefonnummer');
$('input.kmail').DefaultValue('Ihre E-Mail Adresse');
$('.kmsg').DefaultValue('Ihre Nachricht');

$('#logo').css('cursor','pointer').click(function(){
	window.location.href = '/';
});


$('.tgl-cont').hide();
$('.tgl').click(function(){
	$(this).next('.tgl-cont').slideToggle('fast');
	return false;
});



//lightbox
$(function(){
	$('.bilder-kanzlei a').lightBox();
});


//email spamschutz
$('a.email').attr('href','mailto:Kanzlei@IhreAnwaelte.de').html('Kanzlei@IhreAnwaelte.de');


//faux link anwälte
$('.anwaelte-info div').css('cursor','pointer').click(function(){
	var href = $(this).children('a').attr('href');
	window.location.href = href;
});


//tel klick -> kontakt
$('div.tel').css('cursor','pointer').click(function(){
	window.location.href = '/kontakt';
});


//ende DOM ready
});
