var ids=new Array('i1','i2','i3','i4','i5','i6','i7','i8','i9','i10','i11','i12','i13','i14','i15', 'i16');
var idj=new Array('j1','j2','j3','j4');
var idt=new Array('t1','t2','t3','t4','t5','t6','t7','t8','t9');
var idp=new Array('p1','p2','p3','p4');
var id_all=new Array('i1','i2','i3','i4','i5','i6','i7','i8','i12','i13','i14','i15','i16','j1','j2','j3','j4','t1','t2','t3','t4','t5','t6','t7','t8','t9','p1','p2','p3','p4');


function switchid(id, type){	

	if (type == 'ida'){
	
	hideallids_ida();
	showdiv(id);
}
	if (type == 'jogeva'){
	
	hideallids_jogeva();
	showdiv(id);
}
	if (type == 'tartu'){
	
	hideallids_tartu();
	showdiv(id);
}
if (type == 'polva'){
	
	hideallids_polva();
	showdiv(id);
}
if (type == 'all'){
	
	hideallids_main();
	showdiv(id);
}	
	}
	

function hideallids_main(){

	//loop through the array and hide each element by id
	for (var i=0;i<id_all.length;i++){
		hidediv(id_all[i]);
	}		  
}
function hideallids_ida(){

	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function hideallids_jogeva(){

	//loop through the array and hide each element by id
	for (var i=0;i<idj.length;i++){
		hidediv(idj[i]);
	}		  
}

function hideallids_tartu(){

	//loop through the array and hide each element by id
	for (var i=0;i<idt.length;i++){
		hidediv(idt[i]);
	}		  
}

function hideallids_polva(){

	//loop through the array and hide each element by id
	for (var i=0;i<idp.length;i++){
		hidediv(idp[i]);
	}		  
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}