// JavaScript Document

  	function size_select(row, col) {
		switch(row) {
			case 1: switch(col) {
				case 1:
					number = 1;
					area_min = 2;
					area_max = 4;
					vol_min = 5;
					vol_max = 10;
					break;
				case 2:
					number = 2;
					area_min = 3;
					area_max = 5;
					vol_min = 10;
					vol_max = 15;
					break;
				case 3:
					number = 3;
					area_min = 5;
					area_max = 9;
					vol_min = 15;
					vol_max = 25;
					break;
				case 4:
					number = 4;
					area_min = 9;
					area_max = 12;
					vol_min = 25;
					vol_max = 35;
					break;
				case 5:
					number = 5;
					area_min = 12;
					area_max = 15;
					vol_min = 35;
					vol_max = 50;
					break;
			}
			line1 = "<p><strong>Anzahl Zimmer:</strong> " + number + "</p>";
//			line2 = "<p><strong>Bodenfl&auml;che:</strong> " + area_min + " bis " + area_max + "m&sup2;</p>";
			line3 = "<p><strong>Volumen:</strong> " + vol_min + " bis " + vol_max + "m&sup3;</p>";
			var icons = $$('#room_row td');
			for(var i = 1; i <= col; i++) {
				icons[i].style.backgroundImage = "url('/fileadmin/images/house_icon.png')";
			}
			break;
			case 2: switch(col) {
				case 1:
					number = 30;
					area_min = 1;
					area_max = 1;
					vol_min = 3;
					vol_max = 1;
					break;
				case 2:
					number = 60;
					area_min = 1;
					area_max = 2;
					vol_min = 6;
					vol_max = 6;
					break;
				case 3:
					number = 90;
					area_min = 2;
					area_max = 3;
					vol_min = 9;
					vol_max = 9;
					break;
				case 4:
					number = 120;
					area_min = 3;
					area_max = 4;
					vol_min = 12;
					vol_max = 12;
					break;
				case 5:
					number = 150;
					area_min = 4;
					area_max = 6;
					vol_min = 15;
					vol_max = 18;
					break;
			}
			line1 = "<p><strong>Anzahl Kartons:</strong> " + number + "</p>";
//			line2 = "<p><strong>Bodenfl&auml;che:</strong> " + area_min + " bis " + area_max + "m&sup2;</p>";
			line3 = "<p><strong>Volumen:</strong> " + vol_min + "m&sup3;</p>";
			var icons = $$('#box_row td');
			for(var i = 1; i <= col; i++) {
				icons[i].style.backgroundImage = "url('/fileadmin/images/box_icon.png')";
			}
			break;
			case 3: switch(col) {
				case 1:
					type = 'gro&szlig;er Kombi';
					area_min = 1;
					area_max = 1;
					vol_min = 2;
					vol_max = 4;
					break;
				case 2:
					type = 'kleiner Lieferwagen';
					area_min = 3;
					area_max = 4;
					vol_min = 8;
					vol_max = 10;
					break;
				case 3:
					type = 'kleiner M&ouml;belwagen';
					area_min = 4;
					area_max = 5;
					vol_min = 12;
					vol_max = 16;
					break;
				case 4:
					type = 'gro&szlig;er M&ouml;belwagen';
					area_min = 5;
					area_max = 7;
					vol_min = 18;
					vol_max = 22;
					break;
				case 5:
					type = 'LKW';
					area_min = 10;
					area_max = 15;
					vol_min = 30;
					vol_max = 45;
					break;
			}
			line1 = "<p><strong>Fahrzeug Typ:</strong> " + type + "</p>";
//			line2 = "<p><strong>Bodenfl&auml;che:</strong> " + area_min + " bis " + area_max + "m&sup2;</p>";
			line3 = "<p><strong>Volumen:</strong> " + vol_min + " bis " + vol_max + "m&sup3;</p>";
			var icons = $$('#lorry_row td');
			for(var i = 1; i <= col; i++) {
				icons[i].style.backgroundImage = "url('/fileadmin/images/lorry_icon.png')";
			}
			break;
		}
		$('result_col').update(line1 + line3);
	}
	function size_unselect() {
		$('result_col').update('');
		var houses = $$('#room_row td');
		var boxes = $$('#box_row td');
		var lorries = $$('#lorry_row td');
		for(var i = 1; i <= 5; i++) {
			houses[i].style.backgroundImage = "url('/fileadmin/images/house_icon_off.png')";
			boxes[i].style.backgroundImage = "url('/fileadmin/images/box_icon_off.png')";
			lorries[i].style.backgroundImage = "url('/fileadmin/images/lorry_icon_off.png')";
		}
	}
	
	function toggleTab(num, numelems) {
    	if($('tabContent' + num).style.display == 'none') {
        	for(var i = 1; i <= numelems; i++) {
               	var temph = 'tabHeader' + i;
                var h = $(temph);
   	            if(!h) {
       	            var h = $('tabHeaderActive');
           	        h.id = temph;
                }
   	            var tempc = 'tabContent' + i;
       	        var c = $(tempc);
           	    if(c.style.display != 'none') {
//					c.style.display = 'none';
					Effect.Fade(tempc, { duration: 0.5, queue: { scope: 'menus', limit: 3} });
                }
        	}
	        var h = $('tabHeader' + num);
    	    if (h)
        	    h.id = 'tabHeaderActive';
	        h.blur();
    	    var c = $('tabContent' + num);
//			c.style.display = 'block';
			Effect.Appear('tabContent' + num, { duration: 0.5, queue: { scope: 'menus', position: 'end', limit: 3 } });
	    }
	}
