
var complyance =
{
	openedArticle: '',
	openedLayer: '',
	openedRow: '',
	
	openArticle: function(id_article, offClass, onClass)
	{
		if( !offClass ) offClass = 'article';
		if( !onClass ) onClass = 'article-on';
		
		var el = document.getElementById(id_article);
		if( !el )
			return;
		
		var on = (' '+el.className+' ').indexOf(' '+onClass+' ') > -1;
		el.className = offClass + (on ? '' : ' '+onClass);
	},
    
    closeArticle: function(id_article, offClass)
    {
        if( !offClass ) offClass = 'article';
		
		var el = document.getElementById(id_article);
        el.className = offClass;
        this.openedArticle = '';
    },
	
	switchTab: function(oldTab, newTab, oldClass, newClass)
	{
		var elNew = document.getElementById(newTab);
		var elOld = document.getElementById(oldTab);
		elNew.className = newClass;
		elOld.className = oldClass;
	},
	
	openRow: function(id_row)
	{
		if ( this.openedRow == id_row )
		{
			this.closeRow(this.openedRow);
		}
		else
		{
			if ( this.openedRow ) { this.closeRow(this.openedRow); }
			var el = document.getElementById(id_row);
			el.className = 'app_details-on';
			this.openedRow = id_row;
		}
	},
	
	closeRow: function(id_row)
	{
		var el = document.getElementById(id_row);
		el.className='app_details';
		this.openedRow = '';
	},
	
	openLayer: function(id)
	{
		if ( this.openedLayer ) { this.closeLayer(this.openedLayer); }
		var el = document.getElementById(id);
		var objTop = (getWindowHeight()/2) + getScrollTop() - 165;
		el.style.top = objTop + "px";
		el.style.display = 'block';
		this.openedLayer = id;
	},
	
	closeLayer: function(id)
	{
		var el = document.getElementById(id);
		el.style.display='none';
	},
    
	confirmFileDelete: function(url)
	{
		if( confirm('Biztosan törölni kívánja a fájlt?') )
		{
			/*var url = url_pref + (url_pref && url_pref.indexOf('?') > -1 ? '&' : '?') + 'cmd=filedelete&table=' + table;
			if( filter )
			{
				var fs = [];
				for( var k in filter )
					if( typeof filter[k] == 'string' )
						fs.push(k+'|'+filter[k]);
				
				url += '&filters=' + fs.join(';');
			}*/
			
			window.location = url;
		}
	}
}


