document.write('<style type="text/css">.portfolio, .portfolio-content {display:none;}</style>');


$(document).ready(function() 
{	
		
		// fade in content.
		
		$( '.portfolio' ).fadeIn("slow");
		$( '.portfolio-content' ).fadeIn("slow");
	
}); 



 $(document).ready(function() {
    $('a.external').attr('target', '_blank');    
    });

$(document).ready(function() { 
	
	// bind 'myForm' and provide a simple callback function 
	if($('#form').ajaxForm)	{
		$('#form_handler').val("ajax");
		$('#form').ajaxForm(function(retval) {
			if(retval) {
				$('#error').show();
				$('#form *').removeClass("error");
				$.each(retval.split(","), function(index, value) {
					if(value) $('#' + value).addClass("error");
				});

				if ($.browser.opera) {
					//Wenn Browser Opera
					var target = 'html';
				}else{
					//Wenn der Browser NICHT Opera
					var target = 'html,body';
				}

				$(target).animate({ scrollTop: $('#error').offset().top }, 500 , function (){});
			} else {
				$('#error').hide();
				$('#form').hide();
				$('#BewerbungIntro').hide();
				$('#thxMessage').show();
			}
		});
	}
	
	if($('#Position')) $('#Position').bind("change", function(event) {
		// Standard Verhalten unterdrücken
		event.preventDefault();
		if($(this).val() == "Initiativ") {
			$('#StellennameBlock').show();
		} else {
			$('#StellennameBlock').hide();
		}
	});
			
});
	

(function($){

    $.fn.me1 = function(){
        
        var o = {
            fadeSpeed : 600,
            subTimeout : null
        }
	  var arrow = $('.arrow');
        
        o = jQuery.extend(o);
        
        return $(this).each(function() {
            
            var lis = $(this).children('li');
            
            lis.children('a').hover(
                function() {
                    
                    $(this).siblings('.levelSub').stop(true, true).slideDown(o.fadeSpeed);
                },
                function() {
                }
            );
            
            lis.hover(
                
                function() {
                   $(this).children('.levelSub').css('display', 'none');
			 arrow.fadeIn();
                },
                function() {
                    $(this).children('.levelSub:hidden').css('display', 'block');
	              $(this).children('.levelSub').stop(true, true).slideUp(o.fadeSpeed);
			  arrow.fadeOut();
                }
            );
     
        });
    }
    
})(jQuery)


$(document).ready(function() {
		// Alle internen Links auswählen
		$('.top a[href*=#], .nextItem a[href*=#], .more a[href*=#], a.more[href*=#]' ).bind("click", function(event) {
			// Standard Verhalten unterdrücken
			event.preventDefault();
			// Linkziel in Variable schreiben
			var ziel = $(this).attr("href");
			//Browserweiche
			if ($.browser.opera) {
                    //Wenn Browser Opera
					var target = 'html';
                }else{
					//Wenn der Browser NICHT Opera
                    var target = 'html,body';
                }
			//Scrollen der Seite animieren, body benötigt für Safari
			//Variable für Browserweiche
			//$('html,body').animate({
			$(target).animate({
				//Zum Ziel scrollen (Variable)
				scrollTop: $(ziel).offset().top
			// Dauer der Animation und Callbackfunktion die nach der Animation aufgerufen wird, sie stellt das Standardverhalten wieder her und ergänzt die URL
			}, 1000 , function (){location.hash = ziel;});
	   });
	return false;
	});



