/* Slide */
$(document).ready(function() {
    $('#projects_carousel div').click(function() {
        var id = '_' + this.id.split("videolink_")[1];
    
        if (id != null && document.getElementById('videoslide' + id) != null) {
			if (document.getElementById('videoslide' + id).style.display == 'block') {
				// Element ausblenden
				$('#videoslide' + id).animate({
					height: 'hide',
					opacity: 'hide'
				}, function() {
					$('#videoslide' + id).removeClass("active");	
				});					  
			} else
			{
				// Aktives Element ausblenden
				var active_id = $('#projects_carousel').find('div').filter('.active').attr('id');
				
				if (typeof active_id != 'undefined') {
					var id_active = '_' + active_id.split("videoslide_")[1];
					
					$('#videoslide' + id_active).animate({
						height: 'hide',
						opacity: 'hide'
					}, function() {
						$('#videoslide' + id_active).removeClass("active");	
					});							
				}
				
				// Element einblenden
				$('#videoslide' + id).animate({
					height: 'show',
					opacity: 'show'
				}, 'slow', function() {
					$('#videoslide' + id).addClass("active");
					$('#videoslide' + id + ' a[rel^="prettyPhoto1"]').prettyPhoto({theme: 'dark_rounded'});
					$('#videoslide' + id + ' a[rel^="prettyPhoto2"]').prettyPhoto({theme: 'dark_rounded'});
				});
			}
		}
    });
});

$(document).ready(function() {
    $('#list_start div').click(function() {
        var id = '_' + this.id.split("videolink_")[1];
    
        if (id != null && document.getElementById('videoslide' + id) != null) {
			if (document.getElementById('videoslide' + id).style.display == 'block') {
				// Element ausblenden
				$('#videoslide' + id).animate({
					height: 'hide',
					opacity: 'hide'
				}, function() {
					$('#videoslide' + id).removeClass("active");	
				});					  
			} else
			{
				// Aktives Element ausblenden
				var active_id = $('#list_start').find('div').filter('.active').attr('id');
				
				if (typeof active_id != 'undefined') {
					var id_active = '_' + active_id.split("videoslide_")[1];
					
					$('#videoslide' + id_active).animate({
						height: 'hide',
						opacity: 'hide'
					}, function() {
						$('#videoslide' + id_active).removeClass("active");	
					});							
				}
				
				// Element einblenden
				$('#videoslide' + id).animate({
					height: 'show',
					opacity: 'show'
				}, 'slow', function() {
					$('#videoslide' + id).addClass("active");
					$('#videoslide' + id + ' a[rel^="prettyPhoto1"]').prettyPhoto({theme: 'dark_rounded'});
					$('#videoslide' + id + ' a[rel^="prettyPhoto2"]').prettyPhoto({theme: 'dark_rounded'});
				});
			}
		}
    });
});

$(document).ready(function() {
    $('#list_start_city div').click(function() {
        var id = '_' + this.id.split("videolink_")[1];
    
        if (id != null && document.getElementById('videoslide' + id) != null) {
			if (document.getElementById('videoslide' + id).style.display == 'block') {
				// Element ausblenden
				$('#videoslide' + id).animate({
					height: 'hide',
					opacity: 'hide'
				}, function() {
					$('#videoslide' + id).removeClass("active");	
				});					  
			} else
			{
				// Aktives Element ausblenden
				var active_id = $('#list_start_city').find('div').filter('.active').attr('id');
				
				if (typeof active_id != 'undefined') {
					var id_active = '_' + active_id.split("videoslide_")[1];
					
					$('#videoslide' + id_active).animate({
						height: 'hide',
						opacity: 'hide'
					}, function() {
						$('#videoslide' + id_active).removeClass("active");	
					});							
				}
				
				// Element einblenden
				$('#videoslide' + id).animate({
					height: 'show',
					opacity: 'show'
				}, 'slow', function() {
					$('#videoslide' + id).addClass("active");
					$('#videoslide' + id + ' a[rel^="prettyPhoto1"]').prettyPhoto({theme: 'dark_rounded'});
					$('#videoslide' + id + ' a[rel^="prettyPhoto2"]').prettyPhoto({theme: 'dark_rounded'});
				});
			}
		}
    });
});