// 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);
	}
    }
    
}

function showFlashContent(id_name, file_name, width, height, background, params)

	{

	var text = '';

	text = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+width+'" height="'+height+'" id="'+id_name+'" align="center">';
	text += '<param name="allowScriptAccess" value="always" /> ';
	text += '<param name="movie" value="'+file_name+'"> ';
	text += '<param name="loop" value="false"> ';
	text += '<param name="menu" value="false"> ';
	text += '<param name="quality" value="high"> ';
	text += '<param name="FlashVars" value="'+params+'"/> ';
	text += '<param name="scale" value="exactfit"> ';
	
	if (background == 'transparent')

		{

		text += '<param name="wmode" value="transparent" /> ';
		bg = 'wmode="transparent"';

		}

	else

		{

		text += '<param name="bgcolor" value="' + background + '" /> ';
		bg = 'bgcolor="' + background + '"';
		}

	text += '<embed flashvars="'+params+'" src="'+file_name+'" loop="false" menu="false" quality="high" scale="exactfit" ' + bg + ' width="'+width+'" height="'+height+'" name="'+id_name+'" align="center" allowScriptAccess="always" type="application/x-shockwave-flash" pluginpage="http://www.macromedia.com/go/getflashplayer"></embed>';
	text += '</object>';

	return text;

	}
