jQuery.noConflict();

jQuery(document).ready(function() {

	jQuery(function(){
		jQuery('ul.sf-menu').superfish({
        	animation:   {height:'show'},
        	speed: 'fast'
		});
	});

	jQuery(function(){       
		jQuery('#search').click(function() {
    		jQuery('#slider').slideToggle('fast');
		});
	});
	
	
	// Callback Funktion der Trainer Detail Seite
	jQuery.validator.addMethod("lettersonly", function(value, element) { 
        return this.optional(element) || /^[a-z\W\s]+$/i.test(value); 
	});
	
	jQuery('#callback').validate({
		rules: {
			'tx_powermail_pi1[uid64]': {
				required: true,
				minlength: 3,
				lettersonly: true
			},
			'tx_powermail_pi1[uid65]': {
				required: true,
				number: true
			}
		},
		
		messages: {
			'tx_powermail_pi1[uid64]': '* Bitte geben Sie Ihren Namen ein.',
			'tx_powermail_pi1[uid65]': '* Bitte geben Sie Ihre Telefonnummer ein.'
		}
	});
	
	
	// Callback Funktion der rechten Sidebar
	jQuery(function(){ 
  		
  		jQuery('#callbackGer').toggle(
    		function(){
    			jQuery('#callbackFormGer').show();
    			jQuery('#callbackFormAt').hide();
    			jQuery('#callbackFormCh').hide();
    		},
    		function(){
    			jQuery('#callbackFormGer').hide();
    	});
  		
  		jQuery('#callbackAt').toggle(
    		function(){
    			jQuery('#callbackFormAt').show();
    			jQuery('#callbackFormGer').hide();
    			jQuery('#callbackFormCh').hide();
    		},
    		function(){
    			jQuery('#callbackFormAt').hide();
    	});
  		
  		jQuery('#callbackCh').toggle(
    		function(){
    			jQuery('#callbackFormCh').show();
    			jQuery('#callbackFormGer').hide();
    			jQuery('#callbackFormAt').hide();
    		},
    		function(){
    			jQuery('#callbackFormCh').hide();
    	});
    });
	
	
	// Validierung der Callback Formulare
	jQuery('#mailformger').validate({
		rules: {
			nameger: {
				required: true,
				minlength: 3
			},
			telefonger: {
				required: true,
				number: true
			}
		},
		
		messages: {
			nameger: '* Pflichtfeld',
			telefonger: '* Pflichtfeld'
		}
	});
	
	jQuery('#mailform').validate({
		rules: {
			nameat: {
				required: true,
				minlength: 3
			},
			telefonat: {
				required: true,
				number: true
			}
		},
		
		messages: {
			nameat: '* Pflichtfeld',
			telefonat: '* Pflichtfeld'
		}
	});
	
	jQuery('#mailformch').validate({
		rules: {
			namech: {
				required: true,
				minlength: 3
			},
			telefonch: {
				required: true,
				number: true
			}
		},
		
		messages: {
			namech: '* Pflichtfeld',
			telefonch: '* Pflichtfeld'
		}
	});
	
	
	
	jQuery(function(){
		var url = document.URL;
		//alert(url);
		
		jQuery('form#mailformger').attr('action', url);
		jQuery('form#mailformch').attr('action', url);
		jQuery('form#mailform').attr('action', url);
	});

});


