

/*************************SOCIAL NETWORKS******************************/
(function($){$.fn.pageSlide=function(options){var settings=$.extend({width:"300px",duration:"normal",direction:"left",modal:false,_identifier:$(this)},options);var pageslide_slide_wrap_css={position:'fixed',width:'0',top:'0',height:'100%',zIndex:'999'};var pageslide_body_wrap_css={position:'relative',zIndex:'0'};var pageslide_blanket_css={position:'absolute',top:'0px',left:'0px',height:'100%',width:'100%',opacity:'0.0',backgroundColor:'black',zIndex:'1',display:'none'};function _initialize(anchor){if($("#pageslide-body-wrap, #pageslide-content, #pageslide-slide-wrap").size()==0){var psBodyWrap=document.createElement("div");$(psBodyWrap).css(pageslide_body_wrap_css);$(psBodyWrap).attr("id","pageslide-body-wrap").width($("body").width());$("body").contents().wrapAll(psBodyWrap);var psSlideContent=document.createElement("div");$(psSlideContent).attr("id","pageslide-content").width(settings.width);var psSlideWrap=document.createElement("div");$(psSlideWrap).css(pageslide_slide_wrap_css);$(psSlideWrap).attr("id","pageslide-slide-wrap").append(psSlideContent);$("body").append(psSlideWrap)}if($("#pageslide-blanket").size()==0&&settings.modal==true){var psSlideBlanket=document.createElement("div");$(psSlideBlanket).css(pageslide_blanket_css);$(psSlideBlanket).attr("id","pageslide-blanket");$("body").append(psSlideBlanket);$("#pageslide-blanket").click(function(){return false})}$(window).resize(function(){$("#pageslide-body-wrap").width($("body").width())});$(anchor).attr("rel","pageslide")};function _openSlide(elm){if($("#pageslide-slide-wrap").width()!=0)return false;_showBlanket();if(settings.direction=="right"){direction={right:"-"+settings.width};$("#pageslide-slide-wrap").css({left:0});_overflowFixAdd()}else{direction={left:"-"+settings.width};$("#pageslide-slide-wrap").css({right:0})}$("#pageslide-slide-wrap").animate({width:settings.width},settings.duration);$("#pageslide-body-wrap").animate(direction,settings.duration,function(){$.ajax({type:"GET",url:$(elm).attr("href"),success:function(data){$("#pageslide-content").css("width",settings.width).html(data).queue(function(){$(this).dequeue();$(this).find('.pageslide-close').unbind('click').click(function(elm){_closeSlide(elm);$(this).find('pageslide-close').unbind('click')})})}})})};function _closeSlide(event){if($(event)[0].button!=2&&$("#pageslide-slide-wrap").css('width')!="0px"){$.fn.pageSlideClose(settings)}};function _showBlanket(){if(settings.modal==true){$("#pageslide-blanket").toggle().animate({opacity:'0.8'},'fast','linear')}};function _overflowFixAdd(){($.browser.msie)?$("body, html").css({overflowX:'hidden'}):$("body").css({overflowX:'hidden'})}_initialize(this);return this.each(function(){$(this).unbind("click").bind("click",function(){_openSlide(this);$("#pageslide-slide-wrap").unbind('click').click(function(e){if(e.target.tagName!="A")return false});if(settings.modal!=true){$(document).unbind('click').click(function(e){if(e.target.tagName!="A"){_closeSlide(e);return false}})}return false})})}})(jQuery);(function($){$.fn.pageSlideClose=function(options){var settings=$.extend({width:"300px",duration:"normal",direction:"left",modal:false,_identifier:$(this)},options);function _hideBlanket(){if(settings.modal==true&&$("#pageslide-blanket").is(":visible")){$("#pageslide-blanket").animate({opacity:'0.0'},'fast','linear',function(){$(this).hide()})}}function _overflowFixRemove(){($.browser.msie)?$("body, html").css({overflowX:''}):$("body").css({overflowX:''})}_hideBlanket();direction=($("#pageslide-slide-wrap").css("left")!="0px")?{left:"0"}:{right:"0"};$("#pageslide-body-wrap").animate(direction,settings.duration);$("#pageslide-slide-wrap").animate({width:"0"},settings.duration,function(){$("#pageslide-content").css("width","0px").empty();$('#pageslide-body-wrap, #pageslide-slide-wrap').css('left','');$('#pageslide-body-wrap, #pageslide-slide-wrap').css('right','');_overflowFixRemove()})}})(jQuery);(function($){$(document).ready(function(){$(document).keyup(function(event){if(!$("#pageslide-blanket").is(":visible")&&event.keyCode==27)$.fn.pageSlideClose()})})})(jQuery);
(function($){
	  $.fn.pageSlide = function(options) {
	    
	    var settings = $.extend({
	width: "300px", // Accepts fixed widths
	duration: "normal", // Accepts standard jQuery effects speeds (i.e. fast, normal or milliseconds)
	direction: "left", // default direction is left.
	modal: true, // if true, the only way to close the pageslide is to define an explicit close class.
	_identifier: $(this)
	}, options);

	// these are the minimum css requirements for the pageslide elements introduced in this plugin.

	var pageslide_slide_wrap_css = {
	position: 'fixed',
	      width: '0',
	      top: '0',
	      height: '100%',
	      zIndex:'999'
	};

	var pageslide_body_wrap_css = {
	position: 'relative',
	zIndex: '0'
	};

	var pageslide_blanket_css = {
	position: 'absolute',
	top: '0px',
	left: '0px',
	height: '0px',
	width: '0px',
	opacity: '0.0',
	backgroundColor: 'none',
	zIndex: '1',
	display: 'none'
	};

	function _initialize(anchor) {
	      
	      // Create and prepare elements for pageSlide
	      if ($("#pageslide-body-wrap, #pageslide-content, #pageslide-slide-wrap").size() == 0) {
	        
	        var psBodyWrap = document.createElement("div");
	        $(psBodyWrap).css(pageslide_body_wrap_css);
	        $(psBodyWrap).attr("id","pageslide-body-wrap").width( $("body").width() );
	        $("body").contents().wrapAll( psBodyWrap );
	  
	        var psSlideContent = document.createElement("div");
	        $(psSlideContent).attr("id","pageslide-content").width( settings.width );

	        var psSlideWrap = document.createElement("div");
	        $(psSlideWrap).css(pageslide_slide_wrap_css);
	        $(psSlideWrap).attr("id","pageslide-slide-wrap").append( psSlideContent );
	        $("body").append( psSlideWrap );
	  
	      }
	      
	      // introduce the blanket if modal option is set to true.
	      if ($("#pageslide-blanket").size() == 0 && settings.modal == true) {
	        var psSlideBlanket = document.createElement("div");
	        $(psSlideBlanket).css(pageslide_blanket_css);
	        $(psSlideBlanket).attr("id","pageslide-blanket");
	        $("body").append( psSlideBlanket );
	   $("#pageslide-blanket").click(function(){ return false; });
	      }
	          
	// Callback events for window resizing
	$(window).resize(function(){
	        $("#pageslide-body-wrap").width( $("body").width() );
	      });
	      
	      // mark the anchor!
	      $(anchor).attr("rel","pageslide");
	      
	};

	function _openSlide(elm) {
	if($("#pageslide-slide-wrap").width() != 0) return false;
	_showBlanket();
	// decide on a direction
	if (settings.direction == "right") {
	direction = {right:"-"+settings.width};
	$("#pageslide-slide-wrap").css({left:0});
	        _overflowFixAdd();
	}
	else {
	direction = {left:"-"+settings.width};
	$("#pageslide-slide-wrap").css({right:0});
	}
	     $("#pageslide-slide-wrap").animate({width: settings.width}, settings.duration);
	$("#pageslide-body-wrap").animate(direction, settings.duration, function() {
	$.ajax({
	   type: "GET",
	   url: $(elm).attr("href"),
	   success: function(data){
	   $("#pageslide-content").css("width",settings.width).html(data)
	   .queue(function(){
	   $(this).dequeue();
	  
	   // add hook for a close button
	   $(this).find('.pageslide-close').unbind('click').click(function(elm){
	   _closeSlide(elm);
	   $(this).find('pageslide-close').unbind('click');
	   });
	   });
	   }
	   });
	});
	};

	function _closeSlide(event) {
	if ($(event)[0].button != 2 && $("#pageslide-slide-wrap").css('width') != "0px") { // if not right click.
	        $.fn.pageSlideClose(settings);
	      }
	};

	// this is used to activate the modal blanket, if the modal setting is defined as true.
	function _showBlanket() {
	if(settings.modal == true) {
	$("#pageslide-blanket").toggle().animate({opacity:'0.8'}, 'fast','linear');
	}
	};

	// fixes an annoying horizontal scrollbar.
	function _overflowFixAdd(){($.browser.msie) ? $("body, html").css({overflowX:'hidden'}) : $("body").css({overflowX:'hidden'});}

	    // Initalize pageslide, if it hasn't already been done.
	    _initialize(this);
	    return this.each(function(){
	      $(this).unbind("click").bind("click", function(){
	     _openSlide(this);
	     $("#pageslide-slide-wrap").unbind('click').click(function(e){ if(e.target.tagName != "A") return false; });
	     if (settings.modal != true) {
	   $(document).unbind('click').click(function(e) { if(e.target.tagName != "A"){ _closeSlide(e); return false } });
	   }
	     return false;
	     });
	    });
	    
	  };
	})(jQuery);

	// pageSlideClose allows the system to automatically close any pageslide that is currently open in the view.
	(function($){
	  $.fn.pageSlideClose = function(options) {
	    
	    var settings = $.extend({
	width: "300px", // Accepts fixed widths
	duration: "normal", // Accepts standard jQuery effects speeds (i.e. fast, normal or milliseconds)
	direction: "left", // default direction is left.
	modal: false, // if true, the only way to close the pageslide is to define an explicit close class.
	_identifier: $(this)
	}, options);

	function _hideBlanket() { if(settings.modal == true && $("#pageslide-blanket").is(":visible")) {
	      $("#pageslide-blanket").animate({opacity:'0.0'}, 'fast','linear',function(){$(this).hide();});
	    }}
	    
	    function _overflowFixRemove(){($.browser.msie) ? $("body, html").css({overflowX:''}) : $("body").css({overflowX:''});}

	    _hideBlanket();
	    direction = ($("#pageslide-slide-wrap").css("left") != "0px") ? {left: "0"} : {right: "0"};
	$("#pageslide-body-wrap").animate(direction, settings.duration);
	    $("#pageslide-slide-wrap").animate({width: "0"}, settings.duration, function() {
	      // clear bug
	      $("#pageslide-content").css("width","0px").empty();
	      $('#pageslide-body-wrap, #pageslide-slide-wrap').css('left','');
	      $('#pageslide-body-wrap, #pageslide-slide-wrap').css('right','');
	      _overflowFixRemove();
	    });
	    
	  }
	})(jQuery);

	// this adds the ability to close pageSlide with the 'escape' key, if not modal.
	(function($){
	  $(document).ready(function(){
	    $(document).keyup(function(event){
	      if (!$("#pageslide-blanket").is(":visible") && event.keyCode == 27) $.fn.pageSlideClose();
	    });
	  });
	})(jQuery);

	
/*************************SMOOTH SCROLL******************************/
var ss = {
		  fixAllLinks: function() {
		    // Get a list of all links in the page
		    var allLinks = document.getElementsByTagName('a');
		    // Walk through the list
		    for (var i=0;i<allLinks.length;i++) {
		      var lnk = allLinks[i];
		      if ((lnk.href && lnk.href.indexOf('#') != -1) && 
		          ( (lnk.pathname == location.pathname) ||
			    ('/'+lnk.pathname == location.pathname) ) && 
		          (lnk.search == location.search)) {
		        // If the link is internal to the page (begins in #)
		        // then attach the smoothScroll function as an onclick
		        // event handler
		        ss.addEvent(lnk,'click',ss.smoothScroll);
		      }
		    }
		  },

		  smoothScroll: function(e) {
		    // This is an event handler; get the clicked on element,
		    // in a cross-browser fashion
		    if (window.event) {
		      target = window.event.srcElement;
		    } else if (e) {
		      target = e.target;
		    } else return;

		    // Make sure that the target is an element, not a text node
		    // within an element
		    if (target.nodeName.toLowerCase() != 'a') {
		      target = target.parentNode;
		    }
		  
		    // Paranoia; check this is an A tag
		    if (target.nodeName.toLowerCase() != 'a') return;
		  
		    // Find the <a name> tag corresponding to this href
		    // First strip off the hash (first character)
		    anchor = target.hash.substr(1);
		    // Now loop all A tags until we find one with that name
		    var allLinks = document.getElementsByTagName('a');
		    var destinationLink = null;
		    for (var i=0;i<allLinks.length;i++) {
		      var lnk = allLinks[i];
		      if (lnk.name && (lnk.name == anchor)) {
		        destinationLink = lnk;
		        break;
		      }
		    }
		    if (!destinationLink) destinationLink = document.getElementById(anchor);

		    // If we didn't find a destination, give up and let the browser do
		    // its thing
		    if (!destinationLink) return true;
		  
		    // Find the destination's position
		    var destx = destinationLink.offsetLeft; 
		    var desty = destinationLink.offsetTop;
		    var thisNode = destinationLink;
		    while (thisNode.offsetParent && 
		          (thisNode.offsetParent != document.body)) {
		      thisNode = thisNode.offsetParent;
		      destx += thisNode.offsetLeft;
		      desty += thisNode.offsetTop;
		    }
		  
		    // Stop any current scrolling
		    clearInterval(ss.INTERVAL);
		  
		    cypos = ss.getCurrentYPos();
		  
		    ss_stepsize = parseInt((desty-cypos)/ss.STEPS);
		    ss.INTERVAL =
		setInterval('ss.scrollWindow('+ss_stepsize+','+desty+',"'+anchor+'")',10);
		  
		    // And stop the actual click happening
		    if (window.event) {
		      window.event.cancelBubble = true;
		      window.event.returnValue = false;
		    }
		    if (e && e.preventDefault && e.stopPropagation) {
		      e.preventDefault();
		      e.stopPropagation();
		    }
		  },

		  scrollWindow: function(scramount,dest,anchor) {
		    wascypos = ss.getCurrentYPos();
		    isAbove = (wascypos < dest);
		    window.scrollTo(0,wascypos + scramount);
		    iscypos = ss.getCurrentYPos();
		    isAboveNow = (iscypos < dest);
		    if ((isAbove != isAboveNow) || (wascypos == iscypos)) {
		      // if we've just scrolled past the destination, or
		      // we haven't moved from the last scroll (i.e., we're at the
		      // bottom of the page) then scroll exactly to the link
		      window.scrollTo(0,dest);
		      // cancel the repeating timer
		      clearInterval(ss.INTERVAL);
		      // and jump to the link directly so the URL's right
		      location.hash = anchor;
		    }
		  },

		  getCurrentYPos: function() {
		    if (document.body && document.body.scrollTop)
		      return document.body.scrollTop;
		    if (document.documentElement && document.documentElement.scrollTop)
		      return document.documentElement.scrollTop;
		    if (window.pageYOffset)
		      return window.pageYOffset;
		    return 0;
		  },

		  addEvent: function(elm, evType, fn, useCapture) {
		    // addEvent and removeEvent
		    // cross-browser event handling for IE5+,  NS6 and Mozilla
		    // By Scott Andrew
		    if (elm.addEventListener){
		      elm.addEventListener(evType, fn, useCapture);
		      return true;
		    } else if (elm.attachEvent){
		      var r = elm.attachEvent("on"+evType, fn);
		      return r;
		    } else {
		      alert("Handler could not be removed");
		    }
		  } 
		}

		ss.STEPS = 25;

		ss.addEvent(window,"load",ss.fixAllLinks);
			
			
/*************************TEXT AREA EXPANDER******************************/
(function($) {

	// jQuery plugin definition
	$.fn.TextAreaExpander = function(minHeight, maxHeight) {

		var hCheck = !($.browser.msie || $.browser.opera);

		// resize a textarea
		function ResizeTextarea(e) {

			// event or initialize element?
			e = e.target || e;

			// find content length and box width
			var vlen = e.value.length, ewidth = e.offsetWidth;
			if (vlen != e.valLength || ewidth != e.boxWidth) {

				if (hCheck && (vlen < e.valLength || ewidth != e.boxWidth)) e.style.height = "0px";
				var h = Math.max(e.expandMin, Math.min(e.scrollHeight, e.expandMax));

				e.style.overflow = (e.scrollHeight > h ? "auto" : "hidden");
				e.style.height = h + "px";

				e.valLength = vlen;
				e.boxWidth = ewidth;
			}

			return true;
		};

		// initialize
		this.each(function() {

			// is a textarea?
			if (this.nodeName.toLowerCase() != "textarea") return;

			// set height restrictions
			var p = this.className.match(/expand(\d+)\-*(\d+)*/i);
			this.expandMin = minHeight || (p ? parseInt('0'+p[1], 10) : 0);
			this.expandMax = maxHeight || (p ? parseInt('0'+p[2], 10) : 99999);

			// initial resize
			ResizeTextarea(this);

			// zero vertical padding and add events
			if (!this.Initialized) {
				this.Initialized = true;
				$(this).css("padding-top", 0).css("padding-bottom", 0);
				$(this).bind("keyup", ResizeTextarea).bind("focus", ResizeTextarea);
			}
		});

		return this;
	};

})(jQuery);


// initialize all expanding textareas
jQuery(document).ready(function() {
	jQuery("textarea[class*=expand]").TextAreaExpander();
});

			
			
/*************************DRAG N DROP******************************/
//Das Objekt, das gerade bewegt wird.
var dragobjekt = null;

// Position, an der das Objekt angeklickt wurde.
var dragx = 0;
var dragy = 0;

// Mausposition
var posx = 0;
var posy = 0;


function draginit() {
 // Initialisierung der Ãœberwachung der Events

  document.onmousemove = drag;
  document.onmouseup = dragstop;
}


function dragstart(element) {
   //Wird aufgerufen, wenn ein Objekt bewegt werden soll.

  dragobjekt = element;
  dragx = posx - dragobjekt.offsetLeft;
  dragy = posy - dragobjekt.offsetTop;
}


function dragstop() {
  //Wird aufgerufen, wenn ein Objekt nicht mehr bewegt werden soll.

  dragobjekt=null;
}


function drag(ereignis) {
  //Wird aufgerufen, wenn die Maus bewegt wird und bewegt bei Bedarf das Objekt.

  posx = document.all ? window.event.clientX : ereignis.pageX;
  posy = document.all ? window.event.clientY : ereignis.pageY;
  if(dragobjekt != null) {
    dragobjekt.style.left = (posx - dragx) + "px";
    dragobjekt.style.top = (posy - dragy) + "px";
  }
}
//-->

			
			

			





$(document).ready(function () {
	/*********slide maniNavi**********/
    $('li.identity').hover(function () {
    	$('ul.identity_items').slideToggle('medium');
    });
    $('li.development').hover(function () {
    	$('ul.development_items').slideToggle('medium');
    });
    $('li.envoirnments').hover(function () {
    	$('ul.envoirnments_items').slideToggle('medium');
    });
    $('li.art').hover(function () {
    	$('ul.art_items').slideToggle('medium');
    });
    /*********slide labeö**********/
    $('li.labels').hover(function () {
    	$('ul.labels_item').slideToggle('medium');
    });
    /****************LATEST NEWS*****************/
    $('#latestNews').animate({left: +0}, 800).delay(2000).animate({left: -100}, 800);
	/****************STOERER *****************/
    $('#stoerer').animate({left: +0}, 800).delay(2000).animate({left: -100}, 800);
    setTimeout(function(){ 
    $(".intro").fadeOut("slow"); 
  }, 8000 ); 
	 $('.close').click(function() {
    	  $('.content').fadeOut('medium', function() {
    	  });
    	});
	 $('.closeMain').click(function() {
    	  $('.intro').fadeOut('slow', function() {
    	  });
    	});
        $(function() {                 
         $(".topMenu li").click(function() {
         $(this).addClass("selected");
    });
});
});

			

/*************************FADE IN******************************/			
			var fade_in = 1;
			var fade_out = 0.50;
			
/****************FADE IN GALLERY / TEAM*****************/				
			var team_in = 1;
			var team_out = 0.01;

	

			

			
				/****************GALEERY*****************/
			$(document).ready(function(){
				/* This code is executed after the DOM has been completely loaded */

				var totWidth=0;
				var positions = new Array();

				$('.slides .slide').each(function(i){
					/* Loop through all the slides and store their accumulative widths in totWidth */
					positions[i]= totWidth;
					totWidth += $(this).width();

					/* The positions array contains each slide's commulutative offset from the left part of the container */

					if(!$(this).width())
					{
						alert("Please, fill in width & height for all your images!");
						return false;
					}
				});

				$('.slides').width(totWidth);

				/* Change the cotnainer div's width to the exact width of all the slides combined */

				$('.menu ul li a').click(function(e){

					/* On a thumbnail click */
					$('li.menuItem').removeClass('act').addClass('inact');
					$(this).parent().addClass('act');

					var pos = $(this).parent().prevAll('.menuItem').length;

					$('.slides').stop().animate({marginLeft:-positions[pos]+'px'},450);
					/* Start the sliding animation */

					e.preventDefault();
					/* Prevent the default action of the link */
				});

				$('.menu ul li.menuItem:first').addClass('act').siblings().addClass('inact');
				/* On page load, mark the first thumbnail as active */
			});
