function aktion()
 {
   var IDListe;
   var length;
   var link;
   var objCheckBoxes;
   var url;
   var ajax = new XMLHttpRequest();
   var element = false;
   
    if(document.forms["profil_aktion"].elements["nav1"]){ /* Deine Auktionen */
			
			objCheckBoxes = document.forms["profil_aktion"].elements["nav1"];
            length        = objCheckBoxes.length;
            link          = document.forms["profil_aktion"].action;
			IDListe       = ArrayListe(objCheckBoxes,length);
	        url           = link+"&ajax=nav1&parameter="+IDListe;
            element       = true;						
	}
	
	if(document.forms["profil_aktion"].elements["nav2"]){ /* Dein Lagerhaus */
	   
	        objCheckBoxes = document.forms["profil_aktion"].elements["nav2"];
            length        = objCheckBoxes.length;
            link          = document.forms["profil_aktion"].action;
			IDListe       = ArrayListe(objCheckBoxes,length);
	        url           = link+"&ajax=nav2&parameter="+IDListe;  
            element       = true;			
	}
	
	if(document.forms["profil_aktion"].elements["nav3"]){  /* Dein Postfach */
	
	        objCheckBoxes = document.forms["profil_aktion"].elements["nav3"];
            length        = objCheckBoxes.length;
            link          = document.forms["profil_aktion"].action;
			IDListe       = ArrayListe(objCheckBoxes,length);
	        url           = link+"&ajax=nav3&parameter="+IDListe;
			element       = true;
	}
	
	if(element){
		ajax.open("GET",url,true);
		ajax.onreadystatechange = function () {
					if (ajax.readyState == 4) {
						document.getElementById("profil_config").innerHTML = ajax.responseText;
					}
				};

		ajax.send();
	}	
 }
 
 
 function ArrayListe(objCheckBoxes,length)
 {
    var IDListe = new Array();
	
	if(objCheckBoxes.length == null){
	   if(objCheckBoxes.checked){
	      IDListe.push(objCheckBoxes.value);
	   }
	}
	
	
    for(var i=0; i < length; i++)
    {
        if(objCheckBoxes[i].checked){
	        var CheckBoxID = objCheckBoxes[i].value;
			IDListe.push(CheckBoxID);
	   }
    }
	
	return IDListe;
 }
 
 
 function Counter(objCheckBoxes,length)
 {
    var counter = 0;
	
	if(objCheckBoxes.length == null){
	   counter = counter +1;
	}
	
	
    for(var i=0; i < length; i++)
    {
        if(objCheckBoxes[i].checked){
	        counter = counter +1;
	   }
    }
	
	return counter;
 }
 
 
function uncheck(id)
{
  var objCheckBoxes;
   
  if(document.forms["profil_aktion"].elements["nav1"]){
      objCheckBoxes = document.forms["profil_aktion"].elements["nav1"];
	  
	  if(objCheckBoxes.length == null){
       objCheckBoxes.checked = false;	
     }
  }
  
  if(document.forms["profil_aktion"].elements["nav2"]){
      objCheckBoxes = document.forms["profil_aktion"].elements["nav2"];
	  
	  if(objCheckBoxes.length == null){
       objCheckBoxes.checked = false;	
     }
  }
  
  if(document.forms["profil_aktion"].elements["nav3"]){
      objCheckBoxes = document.forms["profil_aktion"].elements["nav3"];
	  
	  if(objCheckBoxes.length == null){
       objCheckBoxes.checked = false;	
     }   
  }

  var length  = objCheckBoxes.length;
  for(var i=0; i < length; i++)
    {
        if(objCheckBoxes[i].value == id){
	        objCheckBoxes[i].checked = false;
	   }
    }
    
  aktion();
} 
 
 
 
 function moveItem()
 {
     var combo = document.getElementsByName("aktionsbutton")[0].value;
 
     if(document.forms["profil_aktion"].elements["nav1"]){ navigation(combo,"nav1");}
	 if(document.forms["profil_aktion"].elements["nav2"]){ navigation(combo,"nav2");}
	 if(document.forms["profil_aktion"].elements["nav3"]){ navigation(combo,"nav3");}
 
 }
 
 function navigation(combo,navi)
 {
   var objCheckBoxes = document.forms["profil_aktion"].elements[navi];
   var link          = document.forms["profil_aktion"].action;
   var money         = document.getElementsByName("money")[0].value;
   var IDListe       = ArrayListe(objCheckBoxes,objCheckBoxes.length);
   var counter       = Counter(objCheckBoxes,objCheckBoxes.length);
   var ajax          = new XMLHttpRequest();
   var url;
   var element       = false;
   document.getElementById('money').style.visibility = 'hidden';
   

        if(combo == 1){

			
			if(money != 0){
			   url = link+"&ajax=createItem&money="+money+"&mode="+navi+"&parameter="+IDListe;
			   element = true;
			}else{
					
					if(counter != 0){
						document.getElementById('money').style.visibility = 'visible';
					}
			
			}
			
		}
		
		if(combo == 2){
		   url = link+"&ajax=delete&mode="+navi+"&parameter="+IDListe;
		   element = true;
		}
		
		if(combo == 3){
		   url = link+"&ajax=moveToPost&mode="+navi+"&parameter="+IDListe;
		   element = true;
		}
		
		if(combo == 4){
		   url = link+"&ajax=moveToLager&mode="+navi+"&parameter="+IDListe;
		   element = true;
		}
		
		if(counter == 0){
		   element = false;
		   alert("No Items selected.");
		}
  
  
      if(element){
         ajax.open("GET",url,true);
		 ajax.onreadystatechange = function () {
					if (ajax.readyState == 4) {
						document.getElementById("profil_config").innerHTML = ajax.responseText;
					}
				};

		ajax.send();	
	  }
 }
 
 function select(bool)
 {
    var objCheckBoxes;
   
  if(document.forms["profil_aktion"].elements["nav1"]){
      objCheckBoxes = document.forms["profil_aktion"].elements["nav1"];
	  
	  if(objCheckBoxes.length == null){
       objCheckBoxes.checked = bool;
     }
  }
  
  if(document.forms["profil_aktion"].elements["nav2"]){
      objCheckBoxes = document.forms["profil_aktion"].elements["nav2"];
	  
	  if(objCheckBoxes.length == null){
       objCheckBoxes.checked = bool;	
     }
  }
  
  if(document.forms["profil_aktion"].elements["nav3"]){
      objCheckBoxes = document.forms["profil_aktion"].elements["nav3"];
	  
	  if(objCheckBoxes.length == null){
       objCheckBoxes.checked = bool;	
     }   
  }

   var length  = objCheckBoxes.length;
   for(var i=0; i < length; i++)
    {
	        objCheckBoxes[i].checked = bool;
    }
    
	
  aktion();
 }
 
 
  floatingMenu.add('profil_staticbox',  
        {  
            // Represents distance from left or right browser window  
            // border depending upon property used. Only one should be  
            // specified.  
            // targetLeft: 0,  
            targetRight: 10,  
  
            // Represents distance from top or bottom browser window  
            // border depending upon property used. Only one should be  
            // specified.  
            //targetTop: 0,  
            targetBottom: 1,  
  
            // Uncomment one of those if you need centering on  
            // X- or Y- axis.  
             //centerX: true,  
             //centerY: true,  
  
            // Remove this one if you don't want snap effect  
            snap: true  
        }); 

