// JavaScript Document
//domain = ((domain.get('scheme')+'/'+domain.get('host')));

function f(x) {
    if (document.getElementById(x)) {
        if (document.getElementById(x).style.display == 'block') {
            document.getElementById(x).style.display = 'none';
        }
        else {
            document.getElementById(x).style.display = 'block';
        }
    }
}

function changeFacilityState(cid, state) {
    window.location.href = 'strona/kategoria/7/placowki/'+cid+'/'+state;    
    return false;
}

function Sections(togglers, row){
    row.each(function(v,i){
        var toggler = togglers[i];
		toggler.addEvent('click', function(e){
			if(v.hasClass('open')){
				v.removeClass('open');
			}else{
				this.getParent('div.row');		
				v.addClass('open');
			}
			e.stop();
		});
	});
}
window.addEvent('domready', function(){
    // zastępuje target=_blank	
	$$('.targetBlank').addEvent('click', function(e){
        e.stop();
		targetBlank(this);
	});
    /* menu gorne*/
    if(!Browser.Engine.trident ){
        if($$('#menu_top')){
            var menuItems = $$('#menu_top').getElements('li');
            var active = $$('.activ');
            fadingMenu($$(menuItems), active);
        }
    }
    var row = $$('#modFaq .row');
    var togglers = $$('.faq_title');
    Sections(togglers, row);
});

