// hidden iFrame
	var szParentHtmlFile = parent.szHtmlFile;
	var szSwfFile = 'hiddenFrame.swf'
	var szFlashColor='#CCCCCC'
	var szWidth='100%'
	var szHeight='100%'

//////////////////////////////// KONIEC SEKCJI EDYTOWALENEJ //////////////////////////////////////////////////////////////////////////
// okreslanie nazwy pliku .html
	var szLocation=String(document.location);
	var szHtmlFile = ''
	if (document.location.search.length>0) { // szukamy nazwy .html'a dodatowe obciecie w szLocation na wypadek gdyby np. w parametrach (search) pojawil sie tez '/' ... np. ?szFile='asd/aa.flv'
		var iLocationPos=unescape(szLocation).indexOf(unescape(document.location.search));
		szLocation=unescape(szLocation).substring(0, iLocationPos)
	} else if (document.location.hash.length>0) { // szukamy nazwy .html'a dodatowe obciecie w szLocation na wypadek gdyby np. w parametrach (hash) pojawil sie tez '/' ... np. #szFile='asd/aa.flv'
		var iLocationPos=unescape(szLocation).indexOf(unescape(document.location.hash));
		szLocation=unescape(szLocation).substring(0, iLocationPos)
	}

	szHtmlFile=szLocation.substring(szLocation.lastIndexOf("/")+1);

	var ua = navigator.userAgent.toLowerCase();
	var bisIE = ua.indexOf("msie") >= 0;
	var bisO = ua.indexOf("opera") >= 0;



// definicje funkcji

	function FchangePageHash(sz) { // wywolywana z .swf'a funkcjka ktora zmienia hasha a w przypadku IE zmienia strone 
		if (unescape(sz)!=unescape(parent.document.location.hash))	{
			if (bisIE && !bisO){
//			if (bisIE || bisO){
				document.location.href=szHtmlFile+'?'+sz
			} else {
				parent.document.location.hash=sz;
//				parent.document.location.replace(szParentHtmlFile + "#" + sz)
			}
		} else {
			alert('takie same hashe');
		}
	}


	function FcheckHashForChange(oVars) {
		var pO=oVars['poObj'];
		if (unescape(pO.szHashInitial)!=unescape(pO.parent.document.location.hash)){
			clearInterval(pO.iIntervalIDcheckHashForChange)
			pO.FprepareHiddenFrame();
		}
	}


	function FfillFlashDiv() { // wypelnia div'a ukrytym flashem ... robi tak zawsze na onLoad ... a dla FF tez przy zmianie hasha ...
		//odczytuje zmienne z adresu (hasha) 
		// konstruowanie string'a z parametrami do flasha
		var szFlashVars='&szChannel='+parent.szChannel+'&szHtmlFile='+szHtmlFile

		if (document.location.search.length>0) { // przepisujemy zmienne z searcha 'globalnego'
			szFlashVars+= '&'+unescape(parent.document.location.search).substr(1); // ucinamy '?'
		}

		if (parent.document.location.hash)	{// przepisujemy zmienne z hasha 'globalnego'
			szFlashVars+=unescape(parent.document.location.hash).substr(1)
		}


	//	alert('bisIE:'+bisIE+" bisO:"+bisO);

		// wpisuje flasha do div'a
		var poDiv=document.getElementById("hiddenFrameFlash");
		poDiv.innerHTML = FszGetFlashObjectTag({szSwfFile:szSwfFile, szFlashVars:szFlashVars, szSwfBgColor:szFlashColor, szSwfWidth:szWidth, szSwfHeight:szHeight});

	// zmieniamy title parenta i iframe


		var oPageVars = new Object();
		var a = szFlashVars.split('&')
		var b = new Array()
		for (var i=0; i<a.length; i++)	{
			b=a[i].split('=');
	//		if (b[0] && b[1] && b[0]!='szHtmlFile' && b[0]!='szChannel' && b[0]!='iTimer' && b[0]!='szBrowserTitle'){
				oPageVars[b[0]]=b[1];
	//		}
		}
		delete b;
		delete a;

		if (oPageVars['szBrowserTitle']){
//			alert(" oPageVars['szBrowserTitle']:"+oPageVars['szBrowserTitle']);
			parent.document.title=unescape(oPageVars['szBrowserTitle']);
			document.title=unescape(oPageVars['szBrowserTitle']);
		}

		
		delete oPageVars;
		delete szPageVars;
	}

	function FprepareHiddenFrame() { // wpisuje flasha do div'a i sprawdza czy FF czy IE .. jesli to FF to uruchamia funkcje ktora nasluchuje zmian w hashu -> uruchamiana w onLoad
		szHashInitial=unescape(parent.document.location.hash);

		if (!bisIE){
			iIntervalIDcheckHashForChange = setInterval(FcheckHashForChange, 100, {poObj:this});
		}

	//	var szDebug=''
	//	szDebug += 'szLocation:'+szLocation+'<br>';
	//	szDebug += 'szHtmlFile:'+szHtmlFile+'<br>';
	//	szDebug += 'szFlashVars:'+szFlashVars+'<br>';
	//	szDebug += 'unescape(parent.document.location.hash).substr(1):'+unescape(parent.document.location.hash).substr(1)+'<br>';
	//	szDebug += 'unescape(document.location.search).substr(1):'+unescape(document.location.search).substr(1)+'<br>';
		
	//	var poDivDebug=document.getElementById("debugDiv");
	//	poDivDebug.innerHTML=szDebug	


	//	alert('document.location.search:'+document.location.search+' parent.document.location.hash:'+parent.document.location.hash);

		if (bisIE && !bisO && document.location.search.length && unescape(document.location.search).substr(1)!=unescape(parent.document.location.hash).substr(1)){ // jezeli zmiana byla w IE to wtedy zmieniamy hasha w gornym html'u
//		if ((bisIE || bisO) && document.location.search.length && unescape(document.location.search).substr(1)!=unescape(parent.document.location.hash).substr(1)){ // jezeli zmiana byla w IE to wtedy zmieniamy hasha w gornym html'u
			parent.document.location.hash=unescape(document.location.search).substr(1)
//			parent.document.location.replace(szParentHtmlFile + "#" + unescape(document.location.search).substr(1))
		}
		FfillFlashDiv();
	}
