
$(function(){
	$('#slider1').anythingSlider({
	  // ** Appearance **
	  theme               : "default", // Theme name
	  expand              : false,     // If true, the entire slider will expand to fit the parent element
	  resizeContents      : true,      // If true, solitary images/objects in the panel will expand to fit the viewport
	  showMultiple        : false,     // Set this value to a number and it will show that many slides at once
	  easing              : "easeInOutExpo",   // Anything other than "linear" or "swing" requires the easing plugin or jQuery UI
	
	  buildArrows         : false,      // If true, builds the forwards and backwards buttons
	  buildNavigation     : true,      // If true, builds a list of anchor links to link to each panel
	  buildStartStop      : false,      // ** If true, builds the start/stop button
	
	  toggleArrows        : false,     // If true, side navigation arrows will slide out on hovering & hide @ other times
	  toggleControls      : false,     // if true, slide in controls (navigation + play/stop button) on hover and slide change, hide @ other times
	
	  startText           : "Start",   // Start button text
	  stopText            : "Stop",    // Stop button text
	  forwardText         : "&raquo;", // Link text used to move the slider forward (hidden by CSS, replaced with arrow image)
	  backText            : "&laquo;", // Link text used to move the slider back (hidden by CSS, replace with arrow image)
	  tooltipClass        : "tooltip", // Class added to navigation & start/stop button (text copied to title if it is hidden by a negative text indent)
	
	navigationFormatter : function(i, panel){
	   return panel.find('span').text();
	  }
	
	});

	$('#slider2').anythingSlider({
	  // ** Appearance **
	  theme               : "default", // Theme name
	  expand              : false,     // If true, the entire slider will expand to fit the parent element
	  resizeContents      : true,      // If true, solitary images/objects in the panel will expand to fit the viewport
	  showMultiple        : false,     // Set this value to a number and it will show that many slides at once
	  easing              : "easeInOutExpo",   // Anything other than "linear" or "swing" requires the easing plugin or jQuery UI
	
	  buildArrows         : false,      // If true, builds the forwards and backwards buttons
	  buildNavigation     : true,      // If true, builds a list of anchor links to link to each panel
	  buildStartStop      : false,      // ** If true, builds the start/stop button
	
	  toggleArrows        : false,     // If true, side navigation arrows will slide out on hovering & hide @ other times
	  toggleControls      : false,     // if true, slide in controls (navigation + play/stop button) on hover and slide change, hide @ other times
	
	  startText           : "Start",   // Start button text
	  stopText            : "Stop",    // Stop button text
	  forwardText         : "&raquo;", // Link text used to move the slider forward (hidden by CSS, replaced with arrow image)
	  backText            : "&laquo;", // Link text used to move the slider back (hidden by CSS, replace with arrow image)
	  tooltipClass        : "tooltip", // Class added to navigation & start/stop button (text copied to title if it is hidden by a negative text indent)
	
	navigationFormatter : function(i, panel){
	   return panel.find('span').text();
	  }

});

});

jQuery(document).ready(function($){

// Scroll page to anchor
	var pos = getUrlVars()["pos"];
	if(pos != null){
		
		var tar = '#content_p' + getUrlVars()["pos"];
		var offset = $(tar).offset().top;
	    $.scrollTo({
	        top: offset,
	        left: 0
	    }, {
	        duration: 1000,
	        easing: 'easeInOutExpo'
	    });
	}


  	$('#vision').hide();

	  $('.vision').click(function() {
		$('h1.team').fadeOut('fast');
	
	  });
	
	  $('.vision').click(function() {
		$('#vision').slideUp('slow');
		$('#vision').fadeIn('fast');
	  });



	});


function getElementsByClass(searchClass, domNode, tagName){
    if (domNode == null) 
        domNode = document;
    if (tagName == null) 
        tagName = '*';
    var el = new Array();
    var tags = domNode.getElementsByTagName(tagName);
    var tcl = " " + searchClass + " ";
    for (i = 0, j = 0; i < tags.length; i++) {
        var test = " " + tags[i].className + " ";
        if (test.indexOf(tcl) != -1) 
            el[j++] = tags[i];
    }
    return el;
}

function scrollAction(number){
    var wrap = '#wrap' + number;
    var tar = '#content_p' + number;
    
    $(wrap).click(function(){
        var target = $(tar);
        $.scrollTo(target, {
            duration: 1000,
            easing: 'easeInOutExpo'
        });
    });
}
/*
function initContentScrollAction(parent, child){

    var box = '#content_p' + parent
    var link = '#content_link_' + child;
    var target = '#content_c' + child;
    
    $(link).click(function(){
        $(box).scrollTo($(target), 2000);
    });
}
*/

function InitScrollActions(numberOfPages){
    for (i = 1; i <= numberOfPages; i++) {
        scrollAction(i);
    }
}

function init(numberOfPages){
    //init die ScrollActions für die Navilinks
    InitScrollActions(numberOfPages)
    
    $.scrollTo($('#content_p1'), {
            duration: 1000,
            easing: 'easeInOutExpo'
        });
    
	// Fade for team pictures
	  $('a.teamPic').hover(function () {
	    $(this).find('strong').stop().fadeTo('normal', 1);
	  }, function () {
	    $(this).find('strong').stop().fadeTo('normal', 0);
	  });
	
}

