
$(document).ready(function() {
 
	 
/* VARIABLES
=======================================================*/
var opacity = 1, toOpacity = 0.8, duration = 400;	 
var fadeDuration = 150;
var checker = false;

/* TERMINANFRAGE
=======================================================*/
replaceCheckbox('.checkbox','tl_files/movios/images/check_on.png','tl_files/movios/images/check_off.png');

$(".checkbox_container span img").tipTip();
$(".formbody .imgbutton8").tipTip();
$(".formbody .imgbutton9").tipTip();

$(".formbody .imgbutton8").click(function(){
	$('#condition_huefte').slideToggle();
});

$(".formbody .imgbutton9").click(function(){
	$('#condition_Knie').slideToggle();
});

$('.group.error').after("<p class='silhouette_error'>Bitte mindestens eine Beschwerdezone markieren</p>");


/*
$('.captcha').focus(function(){
	$('.checkbox').each(function(){
		if($(this).attr('checked') == false){
						alert("Bitte geben Sie mindestens eine Beschwerde an");	
			e.preventDefault();
			$('.terminformular .submit').attr("disabled", "true");
		}
	
	});
});
*/

$('.captcha').focus(function(){
	
		if($(".checkbox").is(":checked")){
			
		}
		else{
			alert("Bitte geben Sie mindestens eine Beschwerde an");
		}
		
	
});



/* SLIDERS BTNS LEITGEDANKE
=======================================================*/

		// verletzung / erkrankung button
 		$('.btn_ve').click(function(){
			$('#leitgedanke_co').scrollTo('#leitgedanke_verletzung', 900, {
	           easing: 'easeInOutExpo'
	     });
	   }); 
	      
	 	$('.btn_di').click(function(){
			$('#leitgedanke_co').scrollTo('#leitgedanke_diagnose', 900, {
	           easing: 'easeInOutExpo'
	     });
	   }); 
	   
	 	$('.btn_th').click(function(){
			$('#leitgedanke_co').scrollTo('#leitgedanke_therapie', 900, {
	           easing: 'easeInOutExpo'
	     });
	   }); 

	 	$('.btn_bc').click(function(){
			$('#leitgedanke_co').scrollTo('#leitgedanke_start', 900, {
	           easing: 'easeInOutExpo'
	     });
	   }); 
	   
	 	$('.btn_pa').click(function(){
			$('#leitgedanke_co').scrollTo('#leitgedanke_start', 900, {
	           easing: 'easeInOutExpo'
	     });
	   }); 
	   

/* HOMEPAGE BTNS
=======================================================*/

	$('.btn_start').css('opacity',opacity).hover(function() {
			$(this).fadeTo(duration,toOpacity);
		}, function() {
			$(this).fadeTo(duration,opacity);
		}
	);
	
/* LEITGEDANKE BTNS
=======================================================*/

	$('.btn_pa').css('opacity',opacity).hover(function() {
			$(this).fadeTo(duration,toOpacity);
		}, function() {
			$(this).fadeTo(duration,opacity);
		}
	);
	
	$('.btn_ve').css('opacity',opacity).hover(function() {
			$(this).fadeTo(duration,toOpacity);
		}, function() {
			$(this).fadeTo(duration,opacity);
		}
	);
	
	$('.btn_di').css('opacity',opacity).hover(function() {
			$(this).fadeTo(duration,toOpacity);
		}, function() {
			$(this).fadeTo(duration,opacity);
		}
	);
	
	$('.btn_th').css('opacity',opacity).hover(function() {
			$(this).fadeTo(duration,toOpacity);
		}, function() {
			$(this).fadeTo(duration,opacity);
		}
	);
	
	
/* CONTENT_NAVIGATION ANIMATION
=======================================================*/

      $('.content_navigation li a').hover(function() {
        $(this).animate({ paddingLeft: '5px' }, fadeDuration);
        $(this).children('span').show().animate({ left: -5 }, fadeDuration);
      }, function() {
        $(this).animate({ paddingLeft: '0px' }, fadeDuration);
        $(this).children('span').animate({ left: -35 }, fadeDuration).fadeOut(fadeDuration);          
      });

$('#grafik').fadeIn(3000);



/* SLIDERS BTNS SCHLEVOIGT
=======================================================*/

		// verletzung / erkrankung button
 		$('.btn_beruf').click(function(){
			$('#schlevoigt_co').scrollTo('#schlevoigt_beruf', 900, {
	           easing: 'easeInOutExpo'
	     });
	   }); 
	      
	 	$('.btn_weitere_qual').click(function(){
			$('#schlevoigt_co').scrollTo('#schlevoigt_quali', 900, {
	           easing: 'easeInOutExpo'
	     });
	   }); 
	   
	 	$('.btn_ausbildung_s').click(function(){
			$('#schlevoigt_co').scrollTo('#schlevoigt_ausbildung', 900, {
	           easing: 'easeInOutExpo'
	     });
	   }); 

	 	$('.btn_back').click(function(){
			$('#schlevoigt_co').scrollTo('#schlevoigt_standard', 900, {
	           easing: 'easeInOutExpo'
	     });
	   });
	   
	   $('.btn_ausbildung_a').click(function(){
			$('#a_schlevoigt_co').scrollTo('#a_schlevoigt_ausbildung', 900, {
	           easing: 'easeInOutExpo'
	     });
	   }); 

	   $('.btn_weitere_qual_a').click(function(){
			$('#a_schlevoigt_co').scrollTo('#a_schlevoigt_weitere_qual', 900, {
	           easing: 'easeInOutExpo'
	     });
	   }); 
	   
	   	   $('.btn_back_a').click(function(){
			$('#a_schlevoigt_co').scrollTo('#schlevoigt_standard', 900, {
	           easing: 'easeInOutExpo'
	     });
	   }); 

});

/* FUNCTIONS
=======================================================*/

// checkbox replacement

function replaceCheckbox(name, on, off)
{
  $(name+':not(.checkbox-replaced)').each(function (index){
    var image = ($(this).is(':checked') ? on : off);
    var imageElement = $('<img class="imgbutton'+index+'" title="'+$(this).next().text()+'" style="cursor:pointer;" src="'+image
      +'" onclick="$(this).next().click();"/>');
   $(this).before(imageElement).hide().addClass('checkbox-replaced');
    imageElement.click(function (){
      $(this).attr('src',(this.src.indexOf(off) > 0 ? on : off));	
     
    });
  });
}


