﻿/*
window.onunload = function() {
	getLocationFN = null;
}
*/

function getLocationFN() {
	return window.location;
}

var hashStrTmp = null;

function changeHashFN(hashSTR, lang)
{
	if (hashSTR == "null") {
		hashSTR = "#";
	}
	window.location.hash = encodeURI(hashSTR);
//	gemiusStatByHashUrl(hashSTR, lang);
}

function gemiusStatByHashUrl(hashStr, lang)
{
	// jeżeli wywołujemy drugi raz ten sam hashUrl (co się zdarza przy przeładowaniu flasha)
	// albo tablica punktów statystycznych jest pusta - wróć
	if (hashStr == hashStrTmp || hashUrlsStats == null || hashUrlsStats.length == 0) {
		return;
	}

	hashStrTmp = hashStr;
	for (var i = 0; i < hashUrlsStats.length; i++) {
		var stat = hashUrlsStats[i].stat;
		// jeżeli bieżący hashUrl pasuje do regexpa z tablicy oraz nie ma jeszcze kodu w kukizie
		// (czyli strona nie została odwiedzona), to zapisz w kukizie i wywołaj gemiooza
		if (hashStr.search(new RegExp(hashUrlsStats[i].hashUrl)) > -1 && getCookie(stat) == null) {
			setCookie(stat, 1);
			gemius_stat(stat);
			break;
		}
	}
}

var docOBJ;
var defaultBackgroundColor;
var blendBackgroundColor;


function initBlendFN() {
	docOBJ = document.getElementsByTagName("body").item(0);
	defaultBackgroundColor = docOBJ.style.backgroundColor;
	blendBackgroundColor = "#EB8838";
}

function blendOnFN() {
	var docOBJ = document.getElementsByTagName("body").item(0);
	defaultBackgroundColor = docOBJ.style.backgroundColor;
	docOBJ.style.backgroundColor = "#EB8838";
	return 1;
}
function blendOffFN() {
	var docOBJ = document.getElementsByTagName("body").item(0);
	docOBJ.style.backgroundColor = defaultBackgroundColor;
	return 1;
}
/*
function resizePollFN(height) {
	var pollDivOBJ = document.getElementById("sonda");
	var pollFlashOBJ = document.getElementById("pollFlash");
	pollDivOBJ.style.height = height;
	pollFlashOBJ.style.height = height;
	return true;
}
*/
