/*
 * Fade Slider Toggle plugin
 * 
 * Copyright(c) 2009, Cedric Dugas
 * http://www.position-relative.net
 *	
 * A sliderToggle() with opacity
 * Licenced under the MIT Licence
 */

 jQuery.fn.fadeSliderToggle = function(settings) {
 	 settings = jQuery.extend({
		speed:800,
		easing : "swing"
	}, settings)

	caller = this
 	if($(caller).css("display") == "none"){
 		$(caller).animate({
 			opacity: 1,
 			height: 'toggle'
 		}, settings.speed, settings.easing);
	}else{
		$(caller).animate({
 			opacity: 0,
 			height: 'toggle'
 		}, settings.speed, settings.easing);
	}
};

// Img hover effekt, und toggle Infobox
$(document).ready(function(){
	
  var $boxL = $('#info div.infoLeft').hide();
  $('#toggle').click(function() {
    $boxL.fadeSliderToggle()		 
		return false;
  });
  var $boxR = $('#info div.infoRight').hide();
  $('#toggle').click(function() {
    $boxR.fadeSliderToggle()		 
		return false; 
  });
  var $dropdown = $('#ul.2nd');
  $('ul.1st li a').hover(function() {
    $dropdown.fadeTo(200, 0.7); 
  });
		
	$("a img.imgfade").each(function() {
		$(this).parent("a").hover(function(){
			$("img.imgfade", this).stop().fadeTo(200, 0.7);
		},function(){
			$("img.imgfade", this).stop().fadeTo(500, 1);
		});
	})
		
});

/*
	Class:    	dwFadingLinks
	Author:   	David Walsh
	Website:    http://davidwalsh.name
	Version:  	1.0.0
	Date:     	10/08/2008
	Built For:  jQuery 1.2.6
*/
jQuery.fn.dwFadingLinks = function(settings) {
	settings = jQuery.extend({
		color: '#999',
		duration: 300
	}, settings);
	return this.each(function() {
		var original = $(this).css('color');
		$(this).mouseover(function() { $(this).animate({ color: settings.color },settings.duration); });
		$(this).mouseout(function() { $(this).animate({ color: original },settings.duration); });
	});
};

$(document).ready(function() { 
	$('#navi a').dwFadingLinks({ 
		color: '#000', 
		 duration: 300 
	 }); 
 });

$(document).ready(function() { 
	$('#headlinks a').dwFadingLinks({ 
		color: '#000', 
		 duration: 300 
	 }); 
 });



// Links in neuem Fenster
$(document).ready(function(){
	$("a[href^=http://]").not("a[href^=http://www.teil.ch]").attr("target", "_blank");			
 });
