var filtruCrt = 0;
function change_filtre( nr )
{
	var node = document.getElementById( 'containerFiltre' );
    if ( node == null ) { return; }
    
	filtruCrt = parseInt( nr );
	var crtFID = 'F' + nr;	
	if ( !document.getElementById( crtFID ) )
	{
		filtruCrt = 1;
		crtFID = 'F1';
	}
	
    for ( var child = node.firstChild; child; child = child.nextSibling )
	{	
		// div
		if ( /content_box/i.test(child.className) )
		{
			child.style.display = ( child.id == crtFID ) ? 'block' : 'none';
		}
	}	
	
	for ( var child = node.firstChild; child; child = child.nextSibling )
	{	
		// bilutza:
		if ( child.id )
		{
			var nrID = parseInt( child.id.replace( 'F', '') );
			var bilutzaPre = document.getElementById( 'fpre_' + nrID );
			var bilutza = document.getElementById( 'f_' + nrID );
			var bilutzaAft = document.getElementById( 'faft_' + nrID );			
			
			// pre:
			if ( bilutzaPre )
			{			
				if ( nrID == 1 )
				{
					bilutzaPre.className = ( nrID == filtruCrt ) ? 'filter_tabs_left_blue' : 'filter_tabs_left_lightblue';
				}
				else 
				{
					if ( nrID == filtruCrt )
					{
						bilutzaPre.className = 'filter_tabs_left_lightblue_blue';
					}
					else 
					{
						bilutzaPre.className = ( ( nrID - 1 ) == filtruCrt ) ? 'filter_tabs_left_blue_lightblue' : 'filter_tabs_left_lightblue_lightblue';
					}
				}
			}
			
			// middle:
			if ( bilutza ) 
			{
				bilutza.className = ( nrID == filtruCrt ) ? 'filter_tabs_bg_blue' : 'filter_tabs_bg_lightblue';
			}
			
			// after:
			if ( bilutzaAft )
			{
				bilutzaAft.className = ( nrID == filtruCrt ) ? 'filter_tabs_right_blue' : 'filter_tabs_right_lightblue';
			}
		}
	}
}