$(document).ready(function() {
	$("a[href$=pdf]").each(
	   function(){
	      $(this).attr('target', '_blank');
	});
	$("a[href^=http]").each(
	   function(){
		  if(this.href.indexOf(location.hostname) == -1) { 
	      $(this).attr('target', '_blank');
	    }
	});
	/* remove last border from footer links */
	$('#footer li a:last').css("border","0 none");
	$('#subnav li a:last').css("border","0 none");
	$('.top-headline .long ').hide();
	$('.content.full .top-headline .long ').show();
	//$('.content.full .top-headline .short ').hide();
	$('.top-headline .short').each(function(){
		myhtml = $(this).html();
		myhtml = myhtml.replace("..."," <span>[...]</span>");
		$(this).html(myhtml);
	});
	// $('.top-headline').click(function(){
	// 		$('.long').hide();
	// 		$('.morelink').show();
	// 		$('.short').removeClass('red');
	// 		$(this).find('a.morelink').hide();
	// 		$(this).find('div.short').addClass('red');
	// 		$(this).find('div.long').show();
	// 	})
	
	//$('#content #archive ul li:even').addClass("even");
	
	// $("#content #archive li").hover(
	// 	  function () {
	// 	    $(this).addClass("over");
	// 		$(this).find("dl").animate({
	// 			opacity: 0.99,
	// 		 }, 700, function() {
	// 		    // Animation complete.
	// 		 });
	// 	  }, 
	// 	  function () {
	// 	     $(this).removeClass("over");
	// 		$(this).find("dl").animate({
	// 			opacity: 0.00,
	// 		 }, 10, function() {
	// 		    // Animation complete.
	// 		 });
	// 	  }
	// 	);
	// 	
	$('.list .top-headline:odd').addClass("odd");
	/* Form Validierungen */                                                                                                   
	$("#form-kontakt.de").validate({
		rules: {
			vorname: "required",
	    		nachname: "required",
	    		wohnort: "required",
	    		telefon: "required",
	    		email: {
	    			required: true,
	    			email: true
	    		},
	    		nachricht: "required"
	    	},
	    	messages: {
	    		wohnort: "Bitte geben Sie Ihren Wohnort ein.",
	    		vorname: "Bitte geben Sie Ihren Vornamen ein.",
			nachname: "Bitte geben Sie Ihren Nachnamen ein.",
	    		telefon: "Bitte geben Sie Ihre Telefonnummer für eventuelle Rückfragen ein.",
	    		email: "Bitte geben Sie eine gültige E-Mailadresse ein.",
	    		nachricht: "Bitte geben Sie Ihre Nachricht ein."
	    	}
	    });
	
		$("#form-kontakt").validate({
			rules: {
				vorname: "required",
	    		nachname: "required",
	    		wohnort: "required",
	    		telefon: "required",
	    		email: {
	    			required: true,
	    			email: true
	    		},
	    		nachricht: "required"
	    	},
	    	messages: {
	    		wohnort: "Please enter your City / Town.",
	    		vorname: "Please enter your First Name.",
				nachname: "Please enter your Last Name.",
	    		telefon: "Please enter your Telephone Number.",
	    		email: "Please enter your valid Email.",
	    		nachricht: "Please enter your message."
	    	}
	    });
});
