
	/**
	 * javascript file
	 */
	
			$(document).ready(function(){
		
			
		
				//Starts the slider image script for each slide-wrapper (contains the images)
				$(".slide-wrapper").each(function() {
					$(this).jqSlider();
				});
				
				$(".toggle_text").hide();
				
				$("#content .toggle_content:first").children("h1").next(".toggle_text").show();
				
				//Switch the "Open" and "Close" state per click
				$(".toggle_content h1").toggle(function(){
					$(this).addClass("active");
				}, function () {
					$(this).removeClass("active");
				});

				//Slide up and down on click
				$(".toggle_content h1").click(function(){
					$(this).next(".toggle_text").toggle("slow");
				});

				//Anchor to the beginning of a chapter
				//$('h1').localScroll({
	  			//	target:$(this)
				//});
		
				$('a[href*=#]').bind("click", function(event) {
					event.preventDefault();
					var ziel = $(this).attr("href");

              	 	if ($.browser.opera) {
                	    var target = 'html';
                	} else{
                    	var target = 'html,body';
                	}

					$(target).animate({
						scrollTop: $(ziel).offset().top
					}, 1000 , function (){location.hash = ziel;});
				});
				
				//Changes the alpha-value for the mail icon in profile
				$('.mail_icon').each(function() {
            		$(".contact_person").hover(function() {
                		$(this).children().next().next().children(".mail_icon").stop().animate({ opacity: 1.0 }, 500);
            		},
           			function() {
               			$(this).children().next().next().children(".mail_icon").stop().animate({ opacity: 0.0 }, 500);
          			});
        		});	
				
				//Set headline, subheadline and link for initial image in image bar at startpage
				startHeadline = $(".slide-previews:first p a").html();
				$("#startseite .firstpage_h1 a").html(startHeadline);
				
				startSubHeadline = $(".slide-previews:first span").html();
				$("#startseite .project_info").html(startSubHeadline);
				
				startLinkHeadline = $(".slide-previews:first p").children("a").attr("href");
				$("#startseite .firstpage_h1").children("a").attr("href",startLinkHeadline);
				
				//Changes headlines at start page
				$("#startseite .slide-previews li").click(function(){
					var project_caption = $(this).children("p").text();
					var project_info_text = $(this).children("span").text()
					$("h1 a").text(project_caption);
					$(".project_info").text(project_info_text);
					headlineLink = $(this).children("img").next("span").next("p").children("a").attr("href");
					$("h1 a").attr("href", headlineLink);
				}); 
			
				//Change color of the headlines after click-event
				//Set initial color and class for first open toggle content
				$(".toggle_content:first").children("h1").children("a").css("color", "#000");
				$("h1").click(function(){
					var h1_color = $(this).children("a").css("color");
					if ((h1_color == "rgb(0, 0, 0)") && ($(this).attr("class") == "active")) {
						$(this).children("a").css("color", "#000");
					} else if (h1_color == "rgb(0, 0, 0)"){
						$(this).children("a").css("color", "#878988");
					} else if (h1_color == "rgb(135, 137, 136)"){
						$(this).children("a").css("color", "#000");
					}
				}); 
			
				$(".toggle_content:first").children("h1").click(function(){
					var h1caption1_color = $(this).children("a").css("color");
					if ((h1caption1_color == "rgb(0, 0, 0)") && ($(this).attr("class") == "active") && ($(this).attr("class") != "first_open_caption")) {
						$(this).children("a").css("color", "#878988");
					} 
					$(this).attr("class","first_open_caption")
				});
				
			});
			
			//Dropdown-Menu for projects
			$(function(){
				$('select#speedC').selectmenu({style:'dropdown'});
			});
			
	
			
			

			


			

				







					
					
