function rearrangeBoxes(autoOpenBox) {

//console.trace('function called: rearrangeBoxes - opening box:' + autoOpenBox);

	  	var screenHeight = ($(window).height());
  		var screenNormHeight = 750;
		
//alert('screenHeight: ' + screenHeight);		
		var whichBox = autoOpenBox;
		
<!-- 2 -->		
		if ( whichBox == 2 ) {
			$('.box#4').css({'position':'absolute', 'left':'0px', 'top':'300px'});

			if (screenHeight > screenNormHeight) {

				$('.box#6').css({'position':'absolute', 'left':'0px', 'top':'600px'});// didn't work 13.09.09
				$('.box#7').css({'position':'absolute', 'left':'0px', 'top':'600px'});// added 13.09.09

			
			} 
		}

<!-- 3 -->
		if ( whichBox == 3 ) {
			$('.box#4').css({'position':'absolute', 'left':'0px', 'top':'300px'});
			$('.box#6').css({'position':'absolute', 'left':'200px', 'top':'300px'}); // didn't work 13.09.09
			$('.box#5').css({'position':'absolute', 'left':'200px', 'top':'300px'}); // added 13.09.09
			
			if (screenHeight > screenNormHeight) {
				$('.box#7').css({'position':'absolute', 'left':'0px', 'top':'600px'});			
				$('.box#8').css({'position':'absolute', 'left':'200px', 'top':'600px'});
			} 
		
		}

<!-- 4 -->
		if ( whichBox == 4 ) {


			$('.box#6').css({'position':'absolute', 'left':'600px', 'top':'0px'}); // didn't work 13.09.09
			$('.box#7').css({'position':'absolute', 'left':'600px', 'top':'0px'});

			$('.box#5').css({'position':'absolute', 'left':'800px', 'top':'0px'}); // added 13.09.09


			
		}	
		
<!-- 5 -->
		if ( whichBox == 5 ) {
		
			$('.box#6').css({'position':'absolute', 'left':'800px', 'top':'0px'});// didn't work 13.09.09
			$('.box#7').css({'position':'absolute', 'left':'800px', 'top':'0px'});// added 13.09.09
	
		}

<!-- 6 -->
		if ( whichBox == 6 ) {
			
			// lefthand nothing to do
				
		}
		
<!-- 7 -->
		if ( whichBox == 7 ) {
		
			$('.box#11').css({'position':'absolute', 'left':'0px', 'top':'600px'}); //9
			
			if (screenHeight > screenNormHeight) {
				$('.box#10').css({'position':'absolute', 'left':'0px', 'top':'900px'}); // didn't work 13.09.09
				
				$('.box#15').css({'position':'absolute', 'left':'0px', 'top':'900px'}); // added 13.09.09

			}

		}
<!-- 8 -->
		if ( whichBox == 8 ) {
		
			$('.box#10').css({'position':'absolute', 'left':'0px', 'top':'600px'}); //9 //didn't work 13.09.09
			$('.box#13').css({'position':'absolute', 'left':'200px', 'top':'600px'}); //10 //didn't work 13.09.09
			
			$('.box#15').css({'position':'absolute', 'left':'0px', 'top':'600px'}); // added 13.09.09
			$('.box#16').css({'position':'absolute', 'left':'200px', 'top':'600px'}); // added 13.09.09
			
			if (screenHeight > screenNormHeight) {

				$('.box#11').css({'position':'absolute', 'left':'0px', 'top':'900px'});			
				$('.box#12').css({'position':'absolute', 'left':'200px', 'top':'900px'}); // didn't work 13.09.09
				
				$('.box#18').css({'position':'absolute', 'left':'200px', 'top':'900px'}); // added 13.09.09
				
			}

		}	
<!-- 9 -->
		if ( whichBox == 9 ) {
		
			$('.box#10').css({'position':'absolute', 'left':'600px', 'top':'300px'}); // didn't work 13.09.09
			$('.box#11').css({'position':'absolute', 'left':'800px', 'top':'300px'});
			
			$('.box#15').css({'position':'absolute', 'left':'600px', 'top':'300px'}); // added 13.09.09


		}		
		
<!-- 10 -->
		if ( whichBox == 10 ) {
		
			$('.box#11').css({'position':'absolute', 'left':'800px', 'top':'300px'});


		}		

<!-- 11 -->
		if ( whichBox == 11 ) {
			
			// lefthand nothing to do
		}		
		
<!-- 12 -->
		if ( whichBox == 12 ) {
		
			$('.box#25').css({'position':'absolute', 'left':'0px', 'top':'900px'}); //14
			
			if (screenHeight > screenNormHeight) {
				$('.box#16').css({'position':'absolute', 'left':'0px', 'top':'1200px'});
			}
		}
		
<!-- 13 -->
		if ( whichBox == 13 ) {
		
			$('.box#16').css({'position':'absolute', 'left':'0px', 'top':'900px'}); //14
			$('.box#18').css({'position':'absolute', 'left':'200px', 'top':'900px'}); //15
			
			if (screenHeight > screenNormHeight) {
				$('.box#20').css({'position':'absolute', 'left':'0px', 'top':'1200px'});			
				$('.box#21').css({'position':'absolute', 'left':'200px', 'top':'1200px'}); //didn't work 13.09.09
				
				$('.box#15').css({'position':'absolute', 'left':'200px', 'top':'1200px'}); //added 13.09.09

			}
			
			
		}


<!-- 14 -->
		if ( whichBox == 14 ) {
		
		
			$('.box#25').css({'position':'absolute', 'left':'600px', 'top':'600px'});//15
			$('.box#16').css({'position':'absolute', 'left':'800px', 'top':'600px'});
		}
		
<!-- 15 -->
		if ( whichBox == 15 ) {
		
			$('.box#16').css({'position':'absolute', 'left':'800px', 'top':'600px'});
		}	
		
<!-- 16 -->
		if ( whichBox == 16 ) {
			
			// lefthand nothing to do
		}
		

<!-- 17 -->
		if ( whichBox == 17 ) {
		
			$('.box#25').css({'position':'absolute', 'left':'0px', 'top':'1200px'});  //19
			
			if (screenHeight > screenNormHeight) {
				$('.box#20').css({'position':'absolute', 'left':'0px', 'top':'1500px'});
			}
		}
		
<!-- 18 -->
		if ( whichBox == 18 ) {
		
			$('.box#20').css({'position':'absolute', 'left':'0px', 'top':'1200px'}); //19
			$('.box#21').css({'position':'absolute', 'left':'200px', 'top':'1200px'}); // didn't work 13.09.09
	
			$('.box#24').css({'position':'absolute', 'left':'200px', 'top':'1200px'}); // added 13.09.09

			
			if (screenHeight > screenNormHeight) {
	
				$('.box#22').css({'position':'absolute', 'left':'0px', 'top':'1500px'});	// didn't work 13.09.09		
				$('.box#23').css({'position':'absolute', 'left':'200px', 'top':'1500px'});
				
				$('.box#25').css({'position':'absolute', 'left':'0px', 'top':'1500px'});	// added 13.09.09		

			}
			
		}		
				
		
<!-- 19 -->
		if ( whichBox == 19 ) {
				
			$('.box#20').css({'position':'absolute', 'left':'600px', 'top':'900px'});
			$('.box#21').css({'position':'absolute', 'left':'800px', 'top':'900px'}); // didn't work 13.09.09

			$('.box#23').css({'position':'absolute', 'left':'800px', 'top':'900px'}); // added 13.09.09

		}
	
<!-- 20 -->
		if ( whichBox == 20 ) {
		
			$('.box#21').css({'position':'absolute', 'left':'800px', 'top':'900px'}); //didn't work 13.09.09
			
			$('.box#23').css({'position':'absolute', 'left':'800px', 'top':'900px'}); //added 13.09.09

			
		}
				
<!-- 21 -->
		if ( whichBox == 21 ) {
			
			// lefthand nothing to do
		}	
		
<!-- 22 -->
		if ( whichBox == 22 ) {
		
			$('.box#24').css({'position':'absolute', 'left':'0px', 'top':'1500px'});
			$('.box#25').css({'position':'absolute', 'left':'800px', 'top':'1500px'});


		}
		
<!-- 23 -->
		if ( whichBox == 23 ) {

			$('.box#24').css({'position':'absolute', 'left':'0px', 'top':'1500px'});			
			$('.box#25').css({'position':'absolute', 'left':'200px', 'top':'1500px'});
		}		
				
		
<!-- 24 -->
		if ( whichBox == 24 ) {
				
			$('.box#25').css({'position':'absolute', 'left':'600px', 'top':'1200px'});

		}
		
			
<!-- 25 -->
		if ( whichBox == 25 ) {

		// nothing to move
		
		}
		
		
		
} // end function

