// do sterowania flashem
var flashObject;

function initializeFlash() {
   if(navigator.appName.indexOf("Microsoft") != -1) {
      flashObject = parent.document.koliba;
   }
   else {
      flashObject = parent.window.document.koliba;
   }
}

function showObject(name) {
    document.getElementById(name).style.visibility = 'visible';
}

//function showObject(name) {
//    setTimeout("showObjectPre('"+name+"')",100);
//}

function showImprezy() {
    showObject('kalendarz_iframe'); 
    showObject('right_iframe');
}

function hideObject(name) {
    document.getElementById(name).style.visibility = 'hidden';
}

function hideAllObj(location) {
    if (location) {
	parent.frames['right_iframe'].location.href = location;
    }

    document.getElementById('kalendarz_iframe').style.visibility = 'hidden';
    document.getElementById('right_iframe').style.visibility = 'hidden';
    document.getElementById('news_iframe').style.visibility = 'hidden';
}

function scrollOn(name, direction) {

	setTrig(1);

    scrollFrame(name, direction);
}

function scrollOff() {
    setTrig(0);
}

function setTrig(val) {
    s_trigg = val;
}

function scrollFrame(name, direction) {
    if (s_trigg) {
	if (direction == 'up') {
	    parent.frames[name].scrollBy(0,-5); setTimeout("scrollFrame('"+name+"', 'up')",2);
	}
	else if (direction == 'down') {
	    parent.frames[name].scrollBy(0,5); setTimeout("scrollFrame('"+name+"', 'down')",2);
	}
	else if (direction == 'left') {
    	    window.right_iframe.left(); setTimeout("scrollFrame('"+name+"', 'left')",2);
	}
        else if (direction == 'right') {
	    window.right_iframe.right(); setTimeout("scrollFrame('"+name+"', 'right')",2);
	}
    }
    
}

