
function getElement(id)
{
	if (document.all)
		return document.all[id];
	else if (document.getElementById)
		return document.getElementById(id);
	else
		return false;
}


  function setButtonStyle(button,state) {

    if (document.all) {

      btn = eval(button+".style");

    } else if (document.layers) {

      btn = eval(button);

    } else if (document.getElementById) {

      /*btn1 = document.getElementById(button);

      btn = btn1.style;*/

	  // GJ: w 'button' przekazywana jest pelna nazwa obiektu.
	  // Powyzszy kod nie dzialal na Mozilla 5.0
	  btn = eval(button+".style");

    } else return false; 

    if (state=='on') {

      btn.backgroundImage="url(cms/images/buttons/button01_b.gif)";

    } else {

      btn.backgroundImage="url(cms/images/buttons/button01_a.gif)";    

    }

  }


//
// Otwiera nowe okno popup.
//
function openPopupWindow(strName, strLocation, width, height)
{
	if ( strLocation.indexOf("popup=1")<0 )
	{
		// dodaj popup=1 do URL'a
		if ( strLocation.indexOf('?') >=0 )
			strLocation += "&popup=1";
		else
			strLocation += "?popup=1";
	}
	var popupWindow = window.open(strLocation, strName, 'toolbar=no, location=no, height='+height+', width='+width+', '+
		'status=no, menubar=no, scrollbars=yes, resizable=yes, top=' +
		(window.screen.height/2 - height/2) + ', left=' + (window.screen.width/2 - width/2));
	//setTimeout("popupWindow.focus()", 1000);
	popupWindow.focus();
	return popupWindow;
}

//--------------------------------------

/*

function lib_bwcheck(){ //Browsercheck (needed)

	this.ver=navigator.appVersion

	this.agent=navigator.userAgent

	this.dom=document.getElementById?1:0

	this.opera5=this.agent.indexOf("Opera 5")>-1

	this.opera6=this.agent.indexOf("Opera 6")>-1  

	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5 && !this.opera6)?1:0; 

	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5 && !this.opera6)?1:0;

	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;

	this.ie=this.ie4||this.ie5||this.ie6

	this.mac=this.agent.indexOf("Mac")>-1

	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 

	this.ns4=(document.layers && !this.dom)?1:0;

	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5 || this.opera6);

	return this

}

var bw=new lib_bwcheck();

*/

function setSelectValue( select , valueToSelect )
{
	var count = select.options.length;

	for( var i=0; i<count; i++ )
		if( select.options[i].value == valueToSelect )
		{
			select.selectedIndex = i;
			break;
		}
}

/*
 * Zmienna, która być może przykryję tę z gemiusa.
 */
var better_gemius_bla_bla;

