              // FORM PLACEHOLDER
$(document).ready(function(){  
    $("#kontaktform").validate();
    
    function placeholder(){  
        $("input[type=text], input[type=password], textarea").each(function(){  
            var phvalue = $(this).attr("placeholder");  
            $(this).val(phvalue);  
        });  
    }  
    placeholder();  
    $("input[type=text], input[type=password], textarea").focusin(function(){  
        var phvalue = $(this).attr("placeholder");  
        if (phvalue == $(this).val()) {  
        $(this).val("");  
        }  
    });  
    $("input[type=text], input[type=password], textarea").focusout(function(){  
        var phvalue = $(this).attr("placeholder");  
        if ($(this).val() == "") {  
            $(this).val(phvalue);  
        }  
    });  
}); 

// Banner Slider
$(function() {
    $('#slide').cycle({ 
		prev: '#slidePrev',
		next: '#slideNext'
	});
});


function sliderwthumb(uid) {
    $(uid).nivoSlider({
        effect: 'fade',
        directionNav: false,
        pauseTime: 3000,
        animSpeed: 400,
        controlNavThumbs:true,
        controlNavThumbsFromRel: true

    }); 
}

$(window).load(function () {
    sliderwthumb("#slider");
});

// Accordion (Subnavigation)
$(function() {
	$('#navigation li.sub').hide(); // zuerst alle schlieÃŸen
	$('#navigation li#active').show(); // active ID geÃ¶ffnet

	$('#navigation li.top').click( function() {
		var cur = $(this).next();
		var old = $('#navigation li.sub:visible');

		/* Zweifacher Klick auf ein Element */
		if ( cur.is(':visible') ) {
			cur.slideToggle(400);
			/*old.prev().stop().animate( {
				paddingLeft:"0"		
			} );*/
			//$('#navigation li.sub').removeClass('subClick');
			
			return false;
		}

		/* Animationszeit */
		old.slideToggle(400);
		cur.stop().slideToggle(400);

		/* Aktives Element Animation 
		$(this).stop().animate( {
			paddingLeft:"12px"
		} );
		old.prev().stop().animate( {
			paddingLeft:"0"
		} );*/
		//$('#navigation li.sub').removeClass('subClick');	
		//$(this).addClass('subClick');			
	} );
});

$(function() {
	$("#apple img[rel]").overlay({effect: 'apple'});
});

// Font Size-changer
$(document).ready(function(){
	$("a.changer").click(function(){
		var $mainText = $('div.news p');
		var currentSize = $mainText.css('font-size');
		var num = parseFloat(currentSize, 14);
		var unit = currentSize.slice(-2);
		if (this.id == 'linkLarge'){
		num = num * 1.2;
		} else if (this.id == 'linkSmall'){
		num = num / 1.2;
		}
		// jQuery lets us set the font Size value of the mainText div
		$mainText.css('font-size', num + unit);
		   return false;
	});
	$("a.restore").click(function(){
		$('div.news p').css('font-size', '14px');
	});
	
	
});

