var iGlobalHeight;
var pageUrl;

$(document).ready(function(){
		iGlobalHeight = 0;
		pageUrl=location.href;
		// zaladowanie flasha
		fLoadFlash();
	
});

$(window).resize(function() {
	if (iGlobalHeight>0){
		fSetFlashHeight(iGlobalHeight);
	}
});	

/**
 * @desc metoda laduje flasha
 */
function fLoadFlash() {
		
		var params = { base : '.', menu : 'true', wmode : 'opaque', allowScriptAccess: 'always' };
		var attributes = { bgcolor : '#ffffff'};
	
		var flashvars = { 
			iVer: '4'
		}
		
		swfobject.embedSWF("index.swf", "pojFlash", "100%", "100%", "9",'', flashvars, params, attributes);
		swffit.fit( 'pojFlash', 980 , 556 );		

		// jesli nie ma flasha, ladujemy zawartosc dla braku flasha
		if ($('#pojNoFlash').length){				
				$('#pojFlash').css('background-image','url(images/zaslepka.jpg)');
				$('#pojFlash').height(556);
		}else{
				// skalowanie warstwy z flashem tla
				//fSetDocumentHeight();
		}
}

/**
 * @desc metoda ustawia wysokosc flasha
 * @param iHeight
 */
function fSetFlashHeight(iHeight) {
	iGlobalHeight = iHeight;
	swffit.fit("pojFlash", 980, iHeight);
}

function moveToTop() {
	var NURL = new String(pageUrl + "#");
	window.location.href = NURL;
}
