// WAIT
jQuery.fn.wait = function(time, type) {
	time = time || 500;
	type = type || "fx";
	return this.queue(type, function() {
		var self = this;
		setTimeout(function() {
			jQuery(self).dequeue();
		}, time);
	});
};
// 4000
// 1500
//var 4000 = 4000
//var 1500 = 1500;
// DIVS AUSBLENDE UND ERSTEN ANZEIGEN
function arrange() {
	// LEFT SLIDE BOX
	jQuery('div.user').each(function(e){
		jQuery(this).hide();
	});
	jQuery('div.user:first').each(function(e){
		jQuery(this).show();
	});
	// RIGHT SLIDE BOX
	jQuery('a.imageSlider').each(function(e){
		jQuery(this).hide();
	});
	jQuery('a.imageSlider:first').each(function(e){
		jQuery(this).show();
	});
}
// IMAGE SLIDE
function imageSlide() {
	var intTime = 0;
    var length = jQuery('a.imageSlider').length;
    jQuery('a.imageSlider').each(function(i){
        var _this = this;
        setTimeout(function(){
			jQuery(_this).fadeTo(1500,1.0);
		}, intTime);
		// am ende..
        if(i == length -1) {
			setTimeout( function(){ 
				arrange();
				jQuery('a.imageSlider').wait(1500);			
				userSlide();
			} , intTime + 4000);
		}
        intTime += 4000;
    });return false;

}

// USER SLIDE
function userSlide() {
	var intTime = 0;
    var length = jQuery('div.user').length;
    jQuery('div.user').each(function(i){
        var _this = this;
        window.setTimeout(function(){
			jQuery(_this).fadeTo(1500,1.0);
		}, intTime);
		// am ende..
        if(i == length -1) {
			window.setTimeout( function(){ 	
				arrange();
				jQuery('div.user').wait(1500);			
				imageSlide();
			} , intTime + 4000);
		}
        intTime += 4000;
    });return false;

}
jQuery(document).ready(function() {
   arrange();
   userSlide();
 });

	

	
