function slideSwitch() {
	/*
	jQuery.container = jQuery('.key-slide');
	jQuery.childs = jQuery.container.children();
	jQuery.len = jQuery.childs.length;
	jQuery.each(jQuery.childs, function(index, value) { 
										alert(value);
  		if(value.attr('class')=='active') {
			jQuery.act = index;
			alert(index);
		}
	});
	*/
	
    jQuery.active = jQuery('.key-slide a.active');
	
	if ( jQuery.active.length == 0 ) jQuery.active = jQuery('.key-slide a:last');
	
	
	    // use this to pull the images in the order they appear in the markup
	    jQuery.next =  jQuery.active.next().length ? jQuery.active.next()
	        : jQuery('.key-slide a:first');
	
    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    jQuery.active.addClass('last-active');
	jQuery.active.fadeOut(2000);

    //jQuery.next.css({opacity: 0.0})
        jQuery.next.addClass('active')
        .fadeIn(2000, function() {
            jQuery.active.removeClass('active last-active');
        });
	
		/*
        .animate({opacity: 1.0}, 1000, function() {
            jQuery.active.removeClass('active last-active');
        });
		*/
}
function slideSwitchSub() {
	
    jQuery.active = jQuery('.key-slide-sub img.active');
	
	if ( jQuery.active.length == 0 ) jQuery.active = jQuery('.key-slide-sub img:last');
	
	    jQuery.next =  jQuery.active.next().length ? jQuery.active.next()
	        : jQuery('.key-slide-sub img:first');


    jQuery.active.addClass('last-active');
	jQuery.active.fadeOut(2000);
        jQuery.next.addClass('active')
        .fadeIn(2000, function() {
            jQuery.active.removeClass('active last-active');
        });
}
jQuery(document).ready(function(){

	// Stores the value of percentage of track loaded
	var global_lp = 0;

	jQuery("#jquery_jplayer").jPlayer({
		ready: function () {
			this.element.jPlayer("setFile", "fileadmin/template_temp/main/mp3/artepuri.mp3").jPlayer("play");
		},
		customCssIds: true
	})
	.jPlayer("onSoundComplete", function() {
		this.element.jPlayer("play");
	});
	
	jQuery.mute = false;
	changeVolume();
});
function changeVolume() {
	if(jQuery.mute==false) {
		jQuery("#soundControl").html('Sound aus');
		jQuery("#soundControl").unbind("click");
		jQuery("#soundControl").click( function() {
			jQuery('#jquery_jplayer').jPlayer("volume", 0);
			jQuery(this).blur();
			changeVolume();
			return false;
		});
		jQuery.mute = true;
	} else {
		jQuery("#soundControl").html('Sound an');
		jQuery("#soundControl").unbind("click");
		jQuery("#soundControl").click( function() {
			jQuery('#jquery_jplayer').jPlayer("volume", 100);
			jQuery(this).blur();
			changeVolume();
			return false;
		});
		jQuery.mute = false;
	}
}