function getAccordionParams()
{
	var params={
		expandedBg          : '#ffcf00',
		hoverBg             : '#f3f3f3',
		collapsedBg         : '#ffcf00',
		expandedTextColor   : '#000000',
		expandedFontWeight  : 'bold',
		hoverTextColor      : '#000000',
		collapsedTextColor  : '#666666',
		collapsedFontWeight : 'normal',
		hoverTextColor      : '#000000',
		borderColor         : '#ffffff',
		panelHeight         : 300,
		onHideTab           : null,
		onShowTab           : null,
		onLoadShowTab       : 0
	};
	return params;
}

Rico.Selector = Class.create();

var selectorcount=0;

Rico.Selector.prototype = {

   initialize: function(selectioncallback) {
      this.dropZones                = new Array();
      this.draggables               = new Array();
      this.currentDragObjects       = new Array();
      this.dragElement              = null;
      this.lastSelectedDraggable    = null;
      this.currentDragObjectVisible = false;
      this.interestedInMotionEvents = false;
      this.selectorcount = ++selectorcount;
      this._mouseDown = this._mouseDownHandler.bindAsEventListener(this);
      this._mouseMove = this._mouseMoveHandler.bindAsEventListener(this);
      this._mouseUp = this._mouseUpHandler.bindAsEventListener(this);
      this.selectioncallback = selectioncallback;
   },

   log: function(str) {
      new Insertion.Bottom( $('logger'), "<span class='logMsg'>selector "+this.selectorcount+":" + str + "</span><br>" );
      $('logger').scrollTop = $('logger').lastChild.offsetTop;

   },
	getSelectionCount: function()
	{
		var cnt=0,i;
		for(i=0;i<this.draggables.length;i++)
			if(this.draggables[i].isSelected()) cnt++;
		return cnt;
	},
	
	getSelectedValues: function()
	{
		var i;
		var res = new Array();
		for(i=0;i<this.draggables.length;i++)
			if(this.draggables[i].isSelected()) res.push(this.draggables[i].getValue());
		return res;
	},
	
	getAllValues:function()
	{
		var i;
		var res = new Array();
		for(i=0;i<this.draggables.length;i++)
			res.push(this.draggables[i].getValue());
		return res;
	},
	
	getSelectedIndeces: function()
	{
		var i;
		var res = new Array();
		for(i=0;i<this.draggables.length;i++)
			if(this.draggables[i].isSelected()) res.push(i);
		return res;
	},
	
	getItemByIndex:function(i)
	{
		return this.draggables[i];
	},

	selectAllItems: function()
	{
		var i;
		for(i=0;i<this.draggables.length;i++)
			if(!this.draggables[i].isSelected()) 
			{
				this.draggables[i].select();
				
			}
		
	},
	deselectAllButFirst: function()
	{
		var i, haveFirst=false;
		for(i=0;i<this.draggables.length;i++)
			if(this.draggables[i].isSelected()) 
			{
				if(haveFirst) this.draggables[i].deselect();
				else haveFirst=true;
				
			}
		if(!haveFirst)
		{
			for(i=0;i<this.draggables.length;i++)
				if(this.draggables[i].isVisible()) 
					if(!haveFirst) 
					{
						this.updateSelection( this.draggables[i],false);
						this.draggables[i].select();
						haveFirst=true;
					}
		}
	},
	xremoveSelectedItems: function()
	{
		var res = new Array();
		var i;
		for(i=0;i<this.draggables.length;i++)
			if(this.draggables[i].isSelected()) 
			{
				this.draggables[i].deselect();
				this.draggables[i].hide();
				
			}
	},
	
	removeAllItems: function()
	{
		var res = new Array();
		var i;
		
		for(i=0;i<this.draggables.length;i++)
		{
			var c = this.draggables[i].getMouseDownHTMLElement()
			var p = c.parentNode;
			if(p) p.removeChild(c);
		}
		this.draggables=new Array();
	},
   removeSelectedItems: function()
	{
		var res = new Array();
		var i;
		
		for(i=0;i<this.draggables.length;i++)
			if(!this.draggables[i].isSelected()) 
			{
				res.push(this.draggables[i]);
			} else
			{
				var c = this.draggables[i].getMouseDownHTMLElement()
				var p = c.parentNode;
				this.draggables[i].deselect();
				this.draggables[i].hide();
				//p.removeChild(c);
			}
		this.draggables=res;
	},
   registerDropZone: function(aDropZone) {
   
      this.dropZones[ this.dropZones.length ] = aDropZone;
      this.log("registerDropZone cnt="+this.dropZones.length);
   },

   deregisterDropZone: function(aDropZone) {
       this.log("deregisterDropZone cnt="+this.dropZones.length);
     var newDropZones = new Array();
      var j = 0;
      for ( var i = 0 ; i < this.dropZones.length ; i++ ) {
         if ( this.dropZones[i] != aDropZone )
            newDropZones[j++] = this.dropZones[i];
      }

      this.dropZones = newDropZones;
   },

   clearDropZones: function() {
        this.log("clearDropZones cnt="+this.dropZones.length);
     this.dropZones = new Array();
   },

   registerSelectable: function( aDraggable ) {
   	
      this.draggables[ this.draggables.length ] = aDraggable;
      this._addMouseDownHandler( aDraggable );
   },

   clearSelection: function() {
      for ( var i = 0 ; i < this.currentDragObjects.length ; i++ )
         this.currentDragObjects[i].deselect();
      this.currentDragObjects = new Array();
      this.lastSelectedDraggable = null;
   },

   hasSelection: function() {
      return this.currentDragObjects.length > 0;
   },

   setStartDragFromElement: function( e, mouseDownElement ) {
      this.origPos = RicoUtil.toDocumentPosition(mouseDownElement);
      this.startx = e.screenX - this.origPos.x
      this.starty = e.screenY - this.origPos.y
      //this.startComponentX = e.layerX ? e.layerX : e.offsetX;
      //this.startComponentY = e.layerY ? e.layerY : e.offsetY;
      //this.adjustedForDraggableSize = false;

      this.interestedInMotionEvents = this.hasSelection();
      this._terminateEvent(e);
   },

   updateSelection: function( draggable, extendSelection ) {
      if ( ! extendSelection )
         this.clearSelection();
try{
	 if ( draggable.isSelected() ) {
         this.currentDragObjects.removeItem(draggable);
         draggable.deselect();
         if ( draggable == this.lastSelectedDraggable )
            this.lastSelectedDraggable = null;
         if(this.selectioncallback) this.selectioncallback();
         
      }
      else {
         this.currentDragObjects[ this.currentDragObjects.length ] = draggable;
         draggable.select();
         this.lastSelectedDraggable = draggable;
         if(this.selectioncallback) this.selectioncallback();
         
      }
} catch(e) {}	  
   },

   _mouseDownHandler: function(e) {
      if ( arguments.length == 0 )
         e = event;

      // if not button 1 ignore it...
      var nsEvent = e.which != undefined;
      if ( (nsEvent && e.which != 1) || (!nsEvent && e.button != 1))
         return;

      var eventTarget      = e.target ? e.target : e.srcElement;
      var draggableObject  = eventTarget.draggable;

      var candidate = eventTarget;
      while (draggableObject == null && candidate.parentNode) {
         candidate = candidate.parentNode;
         draggableObject = candidate.draggable;
      }
   
      if ( draggableObject == null )
         return;

      this.updateSelection( draggableObject, e.ctrlKey );

      // clear the drop zones postion cache...
      if ( this.hasSelection() )
         for ( var i = 0 ; i < this.dropZones.length ; i++ )
            this.dropZones[i].clearPositionCache();

			try{
      this.setStartDragFromElement( e, draggableObject.getMouseDownHTMLElement() );
	  } catch(e) {}
   },


   _mouseMoveHandler: function(e) {
      var nsEvent = e.which != undefined;
      if ( !this.interestedInMotionEvents ) {
         //this._terminateEvent(e);
         return;
      }

      if ( ! this.hasSelection() )
         return;

      if ( ! this.currentDragObjectVisible )
         this._startDrag(e);

      if ( !this.activatedDropZones )
         this._activateRegisteredDropZones();

      //if ( !this.adjustedForDraggableSize )
      //   this._adjustForDraggableSize(e);

      this._updateDraggableLocation(e);
      this._updateDropZonesHover(e);

      this._terminateEvent(e);
   },

   _makeDraggableObjectVisible: function(e)
   {
      if ( !this.hasSelection() )
         return;

      var dragElement;
      if ( this.currentDragObjects.length > 1 )
         dragElement = this.currentDragObjects[0].getMultiObjectDragGUI(this.currentDragObjects);
      else
         dragElement = this.currentDragObjects[0].getSingleObjectDragGUI();

      // go ahead and absolute position it...
      if ( RicoUtil.getElementsComputedStyle(dragElement, "position")  != "absolute" )
         dragElement.style.position = "absolute";


      // need to parent him into the document...
      if ( dragElement.parentNode == null || dragElement.parentNode.nodeType == 11 )
         document.body.appendChild(dragElement);

      this.dragElement = dragElement;
      this._updateDraggableLocation(e);

      this.currentDragObjectVisible = true;
   },

   /**
   _adjustForDraggableSize: function(e) {
      var dragElementWidth  = this.dragElement.offsetWidth;
      var dragElementHeight = this.dragElement.offsetHeight;
      if ( this.startComponentX > dragElementWidth )
         this.startx -= this.startComponentX - dragElementWidth + 2;
      if ( e.offsetY ) {
         if ( this.startComponentY > dragElementHeight )
            this.starty -= this.startComponentY - dragElementHeight + 2;
      }
      this.adjustedForDraggableSize = true;
   },
   **/

   _leftOffset: function(e) {
	   return e.offsetX ? document.body.scrollLeft : 0
	},

   _topOffset: function(e) {
	   return e.offsetY ? document.body.scrollTop:0
	},

		
   _updateDraggableLocation: function(e) {
      var dragObjectStyle = this.dragElement.style;
      dragObjectStyle.left = (e.screenX + this._leftOffset(e) - this.startx) + "px"
      dragObjectStyle.top  = (e.screenY + this._topOffset(e) - this.starty) + "px";
   },

   _updateDropZonesHover: function(e) {
      var n = this.dropZones.length;
      for ( var i = 0 ; i < n ; i++ ) {
         if ( ! this._mousePointInDropZone( e, this.dropZones[i] ) )
            this.dropZones[i].hideHover();
      }

      for ( var i = 0 ; i < n ; i++ ) {
         if ( this._mousePointInDropZone( e, this.dropZones[i] ) ) {
            if ( this.dropZones[i].canAccept(this.currentDragObjects) )
               this.dropZones[i].showHover();
         }
      }
   },

   _startDrag: function(e) {
      for ( var i = 0 ; i < this.currentDragObjects.length ; i++ )
         this.currentDragObjects[i].startDrag();

      this._makeDraggableObjectVisible(e);
   },

   _mouseUpHandler: function(e) {
      if ( ! this.hasSelection() )
         return;

      var nsEvent = e.which != undefined;
      if ( (nsEvent && e.which != 1) || (!nsEvent && e.button != 1))
         return;

      this.interestedInMotionEvents = false;

      if ( this.dragElement == null ) {
         this._terminateEvent(e);
         return;
      }
      if ( this._myplaceDraggableInDropZone(e) )
      {
      
         this._completeDropOperation(e);
        }
      else {
         this._terminateEvent(e);
         new Rico.Effect.Position( this.dragElement,
                              this.origPos.x,
                              this.origPos.y,
                              200,
                              20,
                              { complete : this._doCancelDragProcessing.bind(this) } );
      }

     Event.stopObserving(document.body, "mousemove", this._mouseMove);
     Event.stopObserving(document.body, "mouseup",  this._mouseUp);
   },

   _retTrue: function () {
      return true;
   },

   _completeDropOperation: function(e) {

      if ( this.dragElement != this.currentDragObjects[0].getMouseDownHTMLElement() ) {
         if ( this.dragElement.parentNode != null )
            this.dragElement.parentNode.removeChild(this.dragElement);
      }

      this._deactivateRegisteredDropZones();
      this._endDrag();
      //this.clearSelection();
      this.dragElement = null;
      this.currentDragObjectVisible = false;
      this._terminateEvent(e);
   },

   _doCancelDragProcessing: function() {
      this._cancelDrag();

        if ( this.dragElement != this.currentDragObjects[0].getMouseDownHTMLElement() && this.dragElement)
           if ( this.dragElement.parentNode != null )
              this.dragElement.parentNode.removeChild(this.dragElement);


      this._deactivateRegisteredDropZones();
      this.dragElement = null;
      this.currentDragObjectVisible = false;
   },


   _myplaceDraggableInDropZone: function(e) {
   	
      var foundDropZone = false;
      var n = this.dropZones.length;
      this.log('_myplaceDraggableInDropZone cnt='+this.dropZones.length);
      for ( var i = 0 ; i < n ; i++ ) {
         if ( this._mousePointInDropZone( e, this.dropZones[i] ) )
         {
      this.log('_myplaceDraggableInDropZone:'+i);
           if ( this.dropZones[i].canAccept(this.currentDragObjects) ) {
               this.dropZones[i].hideHover();
               this.dropZones[i].callback();
               foundDropZone = true;
               break;
            }
        
         }
      }

      return foundDropZone;
   },

   _placeDraggableInDropZone: function(e) {
   	
      var foundDropZone = false;
      var n = this.dropZones.length;
      this.log('_placeDraggableInDropZone cnt='+this.dropZones.length);
      for ( var i = 0 ; i < n ; i++ ) {
         if ( this._mousePointInDropZone( e, this.dropZones[i] ) )
         {
      this.log('_placeDraggableInDropZone:'+i);
         	
            if ( this.dropZones[i].canAccept(this.currentDragObjects) ) {
               this.dropZones[i].hideHover();
               this.dropZones[i].accept(this.currentDragObjects);
               foundDropZone = true;
               break;
            }
         }
      }

      return foundDropZone;
   },

   _cancelDrag: function() {
      for ( var i = 0 ; i < this.currentDragObjects.length ; i++ )
         this.currentDragObjects[i].cancelDrag();
   },

   _endDrag: function() {
      for ( var i = 0 ; i < this.currentDragObjects.length ; i++ )
         this.currentDragObjects[i].endDrag();
   },

   _mousePointInDropZone: function( e, dropZone ) {

      var absoluteRect = dropZone.getAbsoluteRect();

      return e.clientX  > absoluteRect.left + this._leftOffset(e) &&
             e.clientX  < absoluteRect.right + this._leftOffset(e) &&
             e.clientY  > absoluteRect.top + this._topOffset(e)   &&
             e.clientY  < absoluteRect.bottom + this._topOffset(e);
   },

   _addMouseDownHandler: function( aDraggable )
   {
       htmlElement  = aDraggable.getMouseDownHTMLElement();
      if ( htmlElement  != null ) { 
         htmlElement.draggable = aDraggable;
         Event.observe(htmlElement , "mousedown", this._onmousedown.bindAsEventListener(this));
         Event.observe(htmlElement, "mousedown", this._mouseDown);
      }
   },

   _activateRegisteredDropZones: function() {
      var n = this.dropZones.length;
      for ( var i = 0 ; i < n ; i++ ) {
         var dropZone = this.dropZones[i];
         if ( dropZone.canAccept(this.currentDragObjects) )
            dropZone.activate();
      }

      this.activatedDropZones = true;
   },

   _deactivateRegisteredDropZones: function() {
      var n = this.dropZones.length;
      for ( var i = 0 ; i < n ; i++ )
         this.dropZones[i].deactivate();
      this.activatedDropZones = false;
   },

   _onmousedown: function () {
  //   Event.observe(document.body, "mousemove", this._mouseMove);
     Event.observe(document.body, "mouseup",  this._mouseUp);
   },

   _terminateEvent: function(e) {
      if ( e.stopPropagation != undefined )
         e.stopPropagation();
      else if ( e.cancelBubble != undefined )
         e.cancelBubble = true;

      if ( e.preventDefault != undefined )
         e.preventDefault();
      else
         e.returnValue = false;
   },


	   initializeEventHandlers: function() {
	      if ( typeof document.implementation != "undefined" &&
	         document.implementation.hasFeature("HTML",   "1.0") &&
	         document.implementation.hasFeature("Events", "2.0") &&
	         document.implementation.hasFeature("CSS",    "2.0") ) {
	         document.addEventListener("mouseup",   this._mouseUpHandler.bindAsEventListener(this),  false);
	         document.addEventListener("mousemove", this._mouseMoveHandler.bindAsEventListener(this), false);
	      }
	      else {
	         document.attachEvent( "onmouseup",   this._mouseUpHandler.bindAsEventListener(this) );
	         document.attachEvent( "onmousemove", this._mouseMoveHandler.bindAsEventListener(this) );
	      }
	   }
	}


//-------------------- ricoDraggable.js
Rico.Selectable = Class.create();

Rico.Selectable.prototype = (new Rico.Draggable()).extend({

   initialize: function( type, htmlElement,myval,title ) {
      this.type          = type;
      this.htmlElement   = $(htmlElement);
      this.selected      = false;
      this.myvalue		 = myval;
      this.visible       = true;
      this.title		 = (title?title:$(htmlElement).innerHTML);
      
   },
   log: function(str) {
      new Insertion.Bottom( $('logger'), "<span class='logMsg'>selectable:" + str + "</span><br>" );
      $('logger').scrollTop = $('logger').lastChild.offsetTop;

   },

   /**
    *   Returns the HTML element that should have a mouse down event
    *   added to it in order to initiate a drag operation
    *
    **/
   getMouseDownHTMLElement: function() {
      return this.htmlElement;
   },

	getValue: function()
	{
		return this.myvalue;
	},
	
	setValue: function(val)
	{
		this.myvalue=val;
	},
	getTitle: function()
	{
		return this.title;
	},

   select: function() {
      this.selected = true;
      var htmlElement = this.getMouseDownHTMLElement();

		htmlElement.className='einbenutzersel';

		return;

    },

	hide: function()
	{
		var x,y;
		this.visible=false;
		eval('x=function() {'+
			'document.getElementById(\''+this.htmlElement.id+'\').style.display=\'none\';'+
			'var c = document.getElementById(\''+this.htmlElement.id+'\');'+
			'var p = c.parentNode;'+
			'p.removeChild(c);'+
			'};');
		
		eval('y=function() {new Rico.Effect.Size( \''+this.htmlElement.id+'\', null, 1, 250, 5, {complete:x} );};');
		
		
		new Rico.Effect.FadeTo( this.htmlElement.id, 0, // width = 450px 
		250, // 500ms (1/2 second) 
		5, // 10 steps 
		{complete:y} );
		
		//this.htmlElement.style.display='none';
	},

	

   deselect: function() {
      this.selected = false;
      var htmlElement = this.getMouseDownHTMLElement();
      htmlElement.className='einbenutzer';
      this.showingSelected = false;
   },

   isSelected: function() {
      return this.selected;
   },
   
   isVisible:function()
   {
   	return this.visible;
	},

   startDrag: function() {
      var el = this.htmlElement;
      this.select();
     
      this.log("startDrag: [" + this.myvalue +"]");
   	
   },

  cancelDrag: function() {
      var el = this.htmlElement;
      this.log("cancelDrag: [" + this.myvalue +"]");
   },

   endDrag: function() {
      var el = this.htmlElement;
      this.log("endDrag: [" + this.myvalue +"]");
   },



   getSingleObjectDragGUI: function() {
     var el = this.htmlElement;

      var div = document.createElement("div");
      div.className = 'einbenutzersel';
      div.style.width = this.htmlElement.offsetWidth - 10;
      
      new Insertion.Top( div, this.title );
      return div;
   },

   getMultiObjectDragGUI: function( draggables ) {
     var el = this.htmlElement;

      var names = "";
      for ( var i = 0 ; i < draggables.length ; i++ ) 
      {
         names += "<div class='einbenutzersel'>"+draggables[i].title+"</div>";
         if ( i != (draggables.length - 1) )
            names += "";
      }

      var div = document.createElement("div");
      //div.className = 'einbenutzersel';
      div.style.width = this.htmlElement.offsetWidth - 10;
      new Insertion.Top( div, names );
      return div;
   },

   orggetMultiObjectDragGUI: function( draggables ) {
     var el = this.htmlElement;

      var names = "";
      for ( var i = 0 ; i < draggables.length ; i++ ) {
         names += draggables[i].htmlElement.innerHTML;
         if ( i != (draggables.length - 1) )
            names += ",<br/>";
      }

      var div = document.createElement("div");
      div.className = 'einbenutzersel';
      div.style.width = this.htmlElement.offsetWidth - 10;
      new Insertion.Top( div, names );
      return div;
   },

   getDroppedGUI: function() {
      return this.htmlElement;
   },

   toString: function() {
      return this.type + ":" + this.htmlElement + ":";
   }

})





Rico.SelectorDropzone = Class.create();

Rico.SelectorDropzone.prototype = (new Rico.Dropzone()).extend( {

   initialize: function( htmlElement,callback ) {
      this.htmlElement  = $(htmlElement);
      this.absoluteRect = null;
      this.callback=callback;
   },
  activate: function() {
      new Effect.FadeTo( this.htmlElement, .4, 250, 4 );
   },


   getHTMLElement: function() {
      return this.htmlElement;
   },

   clearPositionCache: function() {
      this.absoluteRect = null;
   },

   getAbsoluteRect: function() {
      if ( this.absoluteRect == null ) {
         var htmlElement = this.getHTMLElement();
         var pos = RicoUtil.toViewportPosition(htmlElement);

         this.absoluteRect = {
            top:    pos.y,
            left:   pos.x,
            bottom: pos.y + htmlElement.offsetHeight,
            right:  pos.x + htmlElement.offsetWidth
         };
      }
      return this.absoluteRect;
   },

   activate: function() {
      var htmlElement = this.getHTMLElement();
      if (htmlElement == null  || this.showingActive)
         return;

      this.showingActive = true;
      this.saveBackgroundColor = htmlElement.style.background;
return;
      var fallbackColor = "#ffea84";
      var currentColor = Rico.Color.createColorFromBackground(htmlElement);
      if ( currentColor == null )
         htmlElement.style.background = fallbackColor;
      else {
         currentColor.isBright() ? currentColor.darken(0.2) : currentColor.brighten(0.2);
         htmlElement.style.background = currentColor.asHex();
      }
   },

   deactivate: function() {
      var htmlElement = this.getHTMLElement();
      if (htmlElement == null || !this.showingActive)
         return;

      htmlElement.style.background = this.saveBackgroundColor;
      this.showingActive = false;
      this.saveBackgroundColor = null;
   },

   showHover: function() {
      var htmlElement = this.getHTMLElement();
      if ( htmlElement == null || this.showingHover )
         return;

      this.saveBorderWidth = htmlElement.style.borderWidth;
      this.saveBorderStyle = htmlElement.style.borderStyle;
      this.saveBorderColor = htmlElement.style.borderColor;
	  this.saveBackgroundColor = htmlElement.style.background;
      this.showingHover = true;
   //   htmlElement.style.borderWidth = "1px";
   //   htmlElement.style.borderStyle = "solid";

   //   htmlElement.style.borderColor = "#0000ff";
      htmlElement.style.background = "#e5e5f5";
   },

   hideHover: function() {
      var htmlElement = this.getHTMLElement();
      if ( htmlElement == null || !this.showingHover )
         return;

      htmlElement.style.borderWidth = this.saveBorderWidth;
      htmlElement.style.borderStyle = this.saveBorderStyle;
      htmlElement.style.borderColor = this.saveBorderColor;
      htmlElement.style.background  = this.saveBackgroundColor;
      this.showingHover = false;
   },

   canAccept: function(draggableObjects) {
      return true;
   },

   accept: function(draggableObjects) {
      var htmlElement = this.getHTMLElement();
      if ( htmlElement == null )
         return;

      n = draggableObjects.length;
      for ( var i = 0 ; i < n ; i++ )
      {
         var theGUI = draggableObjects[i].getDroppedGUI();
         if ( RicoUtil.getElementsComputedStyle( theGUI, "position" ) == "absolute" )
         {
            theGUI.style.position = "static";
            theGUI.style.top = "";
            theGUI.style.top = "";
         }
         htmlElement.appendChild(theGUI);
      }
   }
});


var waits=0;
function makeWait()
{
	if(waits==0)
	{
	var obj = $('waiter');
	obj.style.position='fixed';
	obj.style.top='0';
	obj.style.left='0';
	obj.style.zindex=1000;
	if(window.innerWidth)
	{
		obj.style.width=(window.innerWidth-20)+'px';
		obj.style.height=(window.innerHeight-5)+'px';
	} else
	if(document.documentElement.clientWidth) 
	{
		obj.style.width=(document.documentElement.clientWidth-20)+'px';
		obj.style.height=(document.documentElement.clientHeight-5)+'px';
		
	}
//	obj.focus();
	
	
	new Rico.Effect.FadeTo( 'waiter', .0, // 20% opacity 
	5, // 	500ms (1/2 second) 
	1, // 10 steps 
	{complete:function() {}} );
	} 
	waits++;
		
	
}

function makeDone()
{
	if(waits==1)
	{
	var obj = $('waiter');
	obj.style.position='fixed';
	obj.style.top='0';
	obj.style.left='0';
	obj.style.zindex=1000;
	obj.style.width='1px';
	obj.style.height='1px';
	
	
	new Rico.Effect.FadeTo( 'waiter', .0, // 20% opacity 
	5, // 	500ms (1/2 second) 
	1, // 10 steps 
	{complete:function() {}} );
	}
	waits--;
}
function mySendRequestAndUpdate(a,b,c)
{
	var i;
	for(var key in jgajaxElements)
		ajaxEngine.registerAjaxElement(key);
		
	ajaxEngine.registerAjaxElement(b);
	if(c) 
	{
		makeWait();
		if(c.myOnComplete)
		{
			c.onComplete=function(){makeDone();c.myOnComplete();}
		} else
		{
			c.onComplete=function(){makeDone();}
		}
	}
	ajaxEngine.sendRequestAndUpdate(a,b,c);
 }

