function loadtwo(link1, link2, link3, link4, link5)
			{
			
			if (link1) parent.parent.frameA.location.href=link1;
			if (link2) parent.frameB.location.href=link2;
			if (link3) parent.frameC.location.href=link3;
			if (link4) parent.parent.frameD.location.href=link4;
			if (link5) parent.frameBC.location.href=link5;
			}

function loadmain(link1)
			{
			if (link1) top.main.location.href=link1;
			}

function loadfromA(link1, link2, link3, link4, link5)
			{
			if (link1) parent.frameA.location.href=link1;
			if (link2) parent.frameBCD.frameB.location.href=link2;
			if (link3) parent.frameBCD.frameC.location.href=link3;
			if (link4) parent.frameBCD.frameD.location.href=link4;
			if (link5) parent.frameBCD.location.href=link5;
			}

function loadfromB(link1, link2, link3, link4, link5)
			{
			if (link1) parent.parent.frameA.location.href=link1;
			if (link2) parent.frameB.location.href=link2;
			if (link3) parent.frameC.location.href=link3;
			if (link4) parent.frameD.location.href=link4;
			if (link5) parent.parent.frameBCD.location.href=link5;
			}

function loadfromM(link1)
			{
			if (link1) parent.parent.main.location.href=link1;
			}

function DisableLinkStatus()
	{
	document.onmouseover = function ( e ) {   
	if ( !e ) e = window.event;   
	var el = e.target ? e.target : e.srcElement;   
	while ( el != null && el.tagName != "A" ) el = el.parentNode;   
	if ( el == null ) return;   
	if ( e.preventDefault ) e.preventDefault();   
	else e.returnValue = true;};
	}


var preEl;
var preClickEl;
var preOverEl;

function setPointerClass(theRow, action)
	{

	/* stworzenie tablicy klas CSS na podstawie kolejnych parametrów */
	argsnum = setPointerClass.arguments.length;
	var classArr = new Array ();
	var arr = new Array ();

	for (i=0; i<=argsnum; i++)
		{
		classArr[i] = setPointerClass.arguments[i+2];
		}
	/*****************************************************************/
	
	if (action == 'click' && theRow != preEl) 
		{
		if (typeof(preEl)!='undefined')
			{
			
		}
		if (typeof(preEl)!='undefined')			// jesli bylo cos wczesniej klikniete to
			{	
			if (theRow == preEl) return true;	// jesli to byl ten sam wiersz to nic nie robic

			arr = _getClassArray(preClickEl);	// tworzy tablice klassCSS dla obiektu zaznaczonego wczesniej wiersza
			_setPointerClass(preEl, arr);		// odznacza stary wiersz
			}
		preClickEl = preOverEl.cloneNode(true);	
		_setPointerClass(theRow, classArr);		// zaznaczenie kliknietego wiersza
		preEl = theRow;							// zapamietanie obiektu wskazanego
		preOverEl = theRow.cloneNode(true);		// ustawienie obiektu do podstawienia przy zdjeciu kursora
		}
	else if (action == 'over') 
		{
		preOverEl = theRow.cloneNode(true);		// wykonanie kopii obiektu przed wskazaniem pointerem
		_setPointerClass(theRow, classArr);		// ustawienie nowych class styli dla obiektu
		}
	else if (action == 'out') 
			{
			arr = _getClassArray(preOverEl);
			_setPointerClass(theRow, arr);
			}

	return true
	}

function _setPointerClass(theRow, classArr)
	{
	if (typeof(document.getElementsByTagName) != "undefined") 
		{
		var theCells = theRow.getElementsByTagName("td");
		}
	else if (typeof(theRow.cells) != "undefined") 
		{
		var theCells = theRow.cells;
		}
	else 
		{
		return false;
		}
	var rowCellsCnt  = theCells.length;
	for (var c = 0; c < rowCellsCnt; c++) 
		{
		if (classArr[c] == "" || classArr[c] == "undefined") theCells[c].className='';
		else theCells[c].className = classArr[c];
		}
	return true;
	}

function _getClassArray(theRow)
	{
	var classArr = new Array ();

	if (typeof(document.getElementsByTagName) != "undefined") 
		{
		var theCells = theRow.getElementsByTagName("td");
		}
	else if (typeof(theRow.cells) != "undefined") 
		{
		var theCells = theRow.cells;
		}
	else 
		{
		return false;
		}
	var rowCellsCnt  = theCells.length;
	for (var c = 0; c < rowCellsCnt; c++) 
		{
		classArr[c] = theCells[c].className;
		}
	return classArr;
	}

function PrintDocument(page)
	{
	var newWin=null;

  newWin = window.open(page, 'print', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=50,height=10');
  newWin.focus();
  newWin.print();
	}

function PrintPage()
	{
	window.print();
	window.close();
	}

function OpenPrintPage(page)
	{
	var newWin=null;
	newWin = window.open(page, 'print', 'width=640,height=880,top=0,left=0,scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes');
	}

function OpenPreviewPage(page)
	{
	var newWin=null;
	newWin = window.open(page, 'print', 'width=600,height=470,top=0,left=0,scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no');
	newWin.focus();
	//newWin.blur();
	}

