	$(document).ready(function() {
			
    	$('#slideshow #warp').cycle({
			fx:     'scrollHorz',
			cleartypeNoBg: true, 
    		prev:   '#prev', 
    		next:   '#next', 
    		timeout: 5000,
    		 pause:         1
		});

		
			  		
  		// By suppling no content attribute, the library uses each elements title attribute by default
   		$('ul#filter li').qtip({
      	// Simply use an HTML img tag within the HTML string
      		content: '<img src="./images/tooltip.png" />', // Set the tooltip content to the current corner
      		position: {
      			corner: {
        			tooltip: 'bottomRight', // Use the corner...
					target: 'topRight' // ...and opposite corner
        		}
      		},
      		style: {
      			border:0,
				padding:0,
        		margin:0      
      		}               
  		});
  		
 

		$('#myForm').ajaxForm(function(data) {
            if (data==1){
            	$('#senden').fadeOut("slow");
                $('#success').fadeIn("slow");
                $('#myForm').resetForm();
                        
            }            
            else if (data==2)
            {
            	$('#senden').fadeOut("slow");
                $('#bademail').fadeIn("slow");
            }
        });
        $('#myForm').submit(function(){
        	$('#badserver').fadeOut("fast");
        	$('#success').fadeOut("fast");
        	$('#bademail').fadeOut("fast");
        	$('#senden').fadeIn("fast");
        	return false;
        });
        
        
        $('ul#filter a').click(function() {
			$(this).css('outline','none');
			$('ul#filter .current').removeClass('current');
			$(this).parent().addClass('current');
		
			var filterVal = $(this).attr("title");			
				
			if(filterVal == 'all') {
				$('ul#portfolio li.hidden').fadeIn('slow').removeClass('hidden');
			} else {
			
				$('ul#portfolio li').each(function() {
					if(!$(this).hasClass(filterVal)) {
						$(this).fadeOut('normal').addClass('hidden');
					} else {
						$(this).fadeIn('slow').removeClass('hidden');
					}
				});
			
			}
			$('html, body').animate({ scrollTop: 500}, 1000); 
			return false;
		});
	
	
	
		$('input[title], textarea[title]').each(function() {
			if($(this).val() === '') {
				$(this).val($(this).attr('title'));	
			}
		
			$(this).focus(function() {
				if($(this).val() == $(this).attr('title')) {
					$(this).val('').addClass('focused');	
				}
			});
			$(this).blur(function() {
				if($(this).val() === '') {
					$(this).val($(this).attr('title')).removeClass('focused');	
				}
			});
		});
	
	
		$('a[href=#Kontakt]').click(function(){
			$('html, body').animate({ scrollTop: $(document).height()- $(window).height() }, 3000); 
			return false;
		});
		
			
  	});
  	

  	

