	var bStartPage = true;

	$(document).ready( function(){
			// zakladki z kalkulatoramui
			$('#pojPanelNav').tabs()
			
			if ( $("#fHomeContactForm").size() ){
					fInitContactForm();
					fInitRadiobuttonsCheckboxes();
			} 
			
			// jesli menu na gorze sklada sie z 2 linijek, przesun right column w dol oraz powieksz pojStrona
			if ($('#pojNavTwoLines').length > 0) {
					// taki zapis ze wzgledu na ie
					$('#pojRightCol').attr('style','top: 156px !important');
					if ( !$('#pojStrona').hasClass('hasNews') ){
						$('#pojStrona').height('362px');
					}
			}
	
			// wygonerowanie napisow w  zakladkach kalkulatorów
			$('#pojPanelNav li a')
					.each( function() { $(this).css('background-image','url(txt_start_tabs,'+MD5($(this).attr('rel').replace('+', '^^'))+'.jpeg?sText='+$(this).attr('rel')+')' );	})
					.hover(	function(){	$(this).parent().addClass('hover'); },	function(){	$(this).parent().removeClass('hover') } );
			
			// wyświetlenie obrazków innych niż png (wtedy bez filtra) pod ie6
			if ($.browser.msie && $.browser.version<=6) {
				$("img.alpha").not("[src*='\.png']").removeClass('alpha');
			}
			
			
			// przesuwanie stopki ew. w dół
			if ($('#pojRightCol').height() + parseInt($('#pojRightCol').css('top'))-$('#pojStopkaNav').height() >= $('#pojStopkaNav').offset().top ) {
				var iDelta = $('#pojRightCol').height() + parseInt($('#pojRightCol').css('top')) - $('#pojStrona').height() - 20;
				$('.pojSzybkiDostep').height(iDelta);

			}
			$('#pojStopkaNav, #pojStopkaSecond, #pojStopkaThird').css('visibility','visible');

			//console.log($('#pojRightCol').height() + parseInt($('#pojRightCol').css('top'))-20-$('#pojStopkaNav').height(), '>=', $('#pojStopkaNav').offset().top);
	
	});


	/**
	 * przekazanie parametrow z flahsa do formularza
	 * 
	 * @param {Object} oVars
	 */
	var FsetVarsFromCalculator = function (oVarsAll) {
		/*if (typeof console != 'undefined')*/ 
		var sz = new Array();
		for (var j in oVarsAll['oCookieVars']){
			sz.push(j+':'+oVarsAll['oCookieVars'][j]);
		}
		
		
		$.cookie('calcTransmission', sz.join(';'));
		

		/*var oVars = oVarsAll.oPrint;
		if ($('#pojFlashInfoData').length==0) {
			$('.pojAddonUtilityContent .boxFlash').after('<div id="pojFlashInfoData"></div>');
		} else {
			$('#pojFlashInfoData').empty();
		}
		//var sz=''
		for (var j in oVars){			
			
			if (typeof(aSlownik[j]) != 'undefined' && typeof oVars[j]!='undefined' && oVars[j]!='undefined') {
				if (aSlownik[j] == 'stan cywilny') {

					$('#pojFlashInfoData').append('<span>' + aSlownik[j]+ ': </span><span><b>' + aStanCywilny[oVars[j]] + '</b></span><br/>');
				}
				else if (j == 'szErrorMsg') {
					$('#pojFlashInfoData').append('<span><b style="color:red;">' + oVars[j] + '</b></span><br/>');
				} else {
					if (j != 'szCardDesc' && oVars[j].toString().charAt(0).match(/^[0-9]$/) == null) {
						oVars[j] = oVars[j].charAt(0).toLowerCase() + oVars[j].substring(1);
						if (oVars[j] == 'pelny') oVars[j] = 'pełny';
					}
					$('#pojFlashInfoData').append('<span>' + aSlownik[j] + ': </span><span><b>' + oVars[j] + '</b></span><br/>');
				}
				
				//sz += ' ' + j + ':' + oVars[j]
			} else {
				
			}
		}
		
		if (typeof oVarsAll.oPrint.iHeight != 'undefined') {
			$('.boxFlash object, .boxFlash embed').attr('height', parseInt(oVarsAll.oPrint.iHeight)+1);
		}
		
		if (typeof console != 'undefined') {
			console.log(oVarsAll);
		}*/
		

	}
	
	/**
	 * aktywacja formaularza
	 */ 
	function fInitContactForm(){
		  var options = { 
		      beforeSubmit:  function(){
							$('#fHomeContactForm').hide();
							$('#boxFormLoading').removeClass('disable');
					}, 
		      success:  function( responseXML , statusText ){
							$('#boxContactForm').html( $(responseXML).find('content').text() );
							if ($(responseXML).find('content').text().indexOf('<div id="txtFormThx">')>=0)
								if (typeof pageTracker != 'undefined') {
									pageTracker._trackPageview('kontaktglowna,thx.html');
								}
							$('#fHomeContactForm').show();
							$('#boxFormLoading').addClass('disable');
							fInitContactForm();
							fInitRadiobuttonsCheckboxes();
					}, 
		      dataType:  'xml' 
		
		  }; 
		  $('#fHomeContactForm').ajaxForm(options);
			//$("#fHomeContactForm input[name='telefon']").keyfilter(/[\d]/);	
	} //fInitContactForm
	
	/**
	 * podmiana radiobuttonow
	 */ 
	function fInitRadiobuttonsCheckboxes(){
		
			// checkbox zgoda
			if (true == $('#fZgoda input').is(':checked')) {
					$( '#fZgoda .accept' ).addClass('checked');
			}
		
			$('#fZgoda input').change(function(){
					if ( true == $(this).is(':checked') ){
					// checkbox jest zaznaczony
							$( '#fZgoda .accept' ).addClass('checked');
					
					} else {
					// checkbox jest odznaczony 
							$( '#fZgoda .accept' ).removeClass('checked');						
					}
			});		
			
			// dla IE
			if($.browser.msie){
				
					$('#fZgoda small').click(function(){
								if ( false == $( '#fZgoda .accept' ).hasClass('checked') ){
								// checkbox jest zaznaczony
										$('#fZgoda .accept' ).addClass('checked');
										$('#fZgoda input').attr('checked','checked');
								
								} else {
								// checkbox jest odznaczony 
										$('#fZgoda .accept' ).removeClass('checked');
										$('#fZgoda input').removeAttr('checked');				
								}
					});
			
			}
			
			//********** radio buttony
			$('.pojRadioButton input').each(function() {
					if (true == $(this).is(':checked')) {
							$(this).siblings( '.accept' ).addClass('checked');
					}	
			});
		
			$('.pojRadioButton input').change(function(){
				
					$(this).parent().parent().find('label').removeClass('checked');
				
					if ( true == $(this).is(':checked') ){
					// checkbox jest zaznaczony
							$(this).siblings( ' .accept' ).addClass('checked');
					
					} else {
					// checkbox jest odznaczony 
							$(this).siblings(' .accept' ).removeClass('checked');						
					}
					
			});
			
			// dla IE
			if($.browser.msie || $.browser.opera){
				
					$('.pojRadioButton small').click(function(){
								//alert( $(this).parent().attr('class'));
								
								if ( false == $(this).parent().parent().find('.accept' ).hasClass('checked') ){
								// checkbox jest zaznaczony
										$(this).parent().parent().parent().find('label').removeClass('checked');
										$(this).parent().parent().find('input').click();
										$(this).parent().parent().find(' .accept' ).addClass('checked');
										$(this).parent().parent().find(' input').attr('checked','checked');
								
								}
					});
			}
	} //fInitRadiobuttonsCheckboxes

	var bannerStats = function() {
		if (!sBannerName)
			return;
		pageTracker._trackPageview("/banner_"+sBannerName);
		if (arguments.length>0)
			document.location = arguments[0];
		else
			document.location = sRedirectUrl;

	}
	