function transparenter(id,start)
{ 
	dist = 0.1;
	int = 50;
	
	currO = parseFloat(id.style.opacity);
	if(currO>0)
	{	
		newO = currO-dist;
		newF = newO*100;
		id.style.opacity = newO;
		id.style.filter = 'alpha(opacity='+newF+')';
		setTimeout (function(){transparenter(id)},int);
	}
	else {
		id.style.display = 'none';
	}
}

function unTransparenter(id,start)
{ 
	dist = 0.1;
	int = 50;
	
	if(start==1){id.style.opacity = 0;}
	currO = parseFloat(id.style.opacity);
	if(currO<1)
	{	
		newO = currO+dist;
		newF = newO*100;
		id.style.opacity = newO;
		id.style.filter = 'alpha(opacity='+newF+')';
		setTimeout (function(){unTransparenter(id)},int);
	}
	else {
		id.style.display = 'block';
	}
}

function switchTab(id,id_parent)
{ 
	var tab = document.getElementById(id_parent).getElementsByTagName('div'); 
	for (i = 0; i < tab.length; i++) {
		if(tab[i].className=='tab') {
			if(tab[i].id!=id){
				//transparenter(tab[i],1);
                tab[i].style.display = 'none'; 
			}
		}
	}
	//unTransparenter(document.getElementById(id),1);
    document.getElementById(id).style.display = 'block';
}

function startSwitching(i,j,id_parent)
{ 
    if(stopSwitching!=true)
    {
        switchTab('tab'+news[j],id_parent); 
        changeClass(document.getElementById('cislo'+i),'cisla');
        var next = j+1; 
        if(next==6){next = 1;}
        i = j+1;
        if(i==6){i = 1;}
        setTimeout(function(){startSwitching(i,next,'showroom');},5000); 
    }
}
