function displayStatusMsg(msgStr) {
  status=msgStr;
  // document.MM_returnValue = true;
}

function ShowHide(elem, id)
{
  elem = document.getElementById(elem);
  if(elem != null)
  {
    if(elem.innerHTML == '[+]')
    {
      new Effect.BlindDown(id);
      new Effect.Appear(id);
      elem.innerHTML = '[&ndash;]';
      elem.title = "zwiń";
    }
    else
    {
      new Effect.BlindUp(id);
      new Effect.Fade(id);
      elem.innerHTML = '[+]';
      elem.title = "rozwiń";
    }
  }
}


function ajax_simple_updater( strUrl, strPlaceholder, strParams )
{
    var url = strUrl;
    var pars = strParams;
    var myAjax = new Ajax.Updater(
    strPlaceholder,
    url,
        {
            method: 'post',
            parameters: pars,
            asynchronous: true,
            evalScripts : true
            /*
            onLoading: function()
            {
            	initLightbox();
            },
            onComplete: function()
            {
            }
            */
        }
    )
}
function loadMarkets( cityId )
{
     advAJAX.get
    (
        {
            url: "?module=Newsletter&action=LoadMarkets",
            parameters:
            {
                "cityId": cityId
            },
            onSuccess: function( obj )
            {
                document.getElementById( 'marketsDiv' ).innerHTML = obj.responseText;
            },
            onError: function( obj )
            {
                document.getElementById( 'marketsDiv' ).innerHTML = 'Wystąpił błąd, ponów.';
            }
        }
    );
  
}
function addProduct()
{
    len = document.getElementById( 'products' ).options.length;
	i = document.getElementById('allProducts').selectedIndex;
	document.getElementById( 'products' ).options[len] = new Option( document.getElementById( 'allProducts' ).options[ i ].text, document.getElementById('allProducts').value );
	document.getElementById( 'productSet[]' ).value = getProducts();
}
function delProduct()
{
    i = document.getElementById('products').selectedIndex;
	document.getElementById( 'products' ).options[i] = null;
    document.getElementById( 'productSet[]' ).value = getProducts();
}

function getProducts()
{
	len = document.getElementById( 'products' ).options.length;
	
	for ( i=0; i<len; i++ )
	{
		document.getElementById( 'products' ).options[i].selected = true;
	}
	
}



function signIn ( )
{
      advAJAX.get
        (
            {
                url: "?module=Default&action=ajax_NewsletterSignIn",
                parameters:
                {
                    "privacy": document.getElementById( 'privacy').checked,
                    "address" : document.getElementById( 'address').value,
                    "sectionId" : document.getElementById( 'sectionId').value
                },
                onSuccess: function( obj )
                {
                    document.getElementById( 'info_text' ).innerHTML = obj.responseText;
                },

				onLoading: function( obj )
                {
                    document.getElementById( 'info_text' ).innerHTML = 'wysyłanie... ';
                }
            }
        );
}


	function PokazAkapit(id_paragrafu, id_linku)
	{
		var akapit = document.getElementById(id_paragrafu);
        var odnosnik = document.getElementById(id_linku);

		var view = akapit.style.display;

        if (view == "block")
		{
            odnosnik.innerHTML = "więcej";
			akapit.style.display = "none";
		}

		if (view == "none")
		{
            odnosnik.innerHTML = "schowaj";
			akapit.style.display = "block";
		}

	};
	
function ShowHide() {
	$('.box .opis').hide();

	$('.box h4').show().bind('click', function() {
		if($(this).hasClass('selected')) {
			$(this).removeClass('selected').parent().find('.opis').hide('fast');
		}
		else {
			$(this).addClass('selected').parent().find('.opis').show('fast');
		}
	});
}

function CloseBrandmark(){

    $('#brandmark').hide();

}

/* Document ready
 ==================================== */


/*
	Horodecki labs: BPlayer
	file: js/functions.js
	encoding: UTF-8
	author: Dawid Horodecki, http://horodecki.eu
	
	File under Creative Commons license, http://creativecommons.org/licenses/by-nc-sa/3.0/
	
	Table of contents:	
		Document ready
*/


/*	Document ready
	==================================== */

/*$('#first').BPlayer({
interval: firstint,
hasbutton: 0,
hasswitch: 0
});*/

$(document).ready(function() {

  setTimeout(function(){ 
        CloseBrandmark(); 
      }, 29500 );
      
      $('#brandmark').click(function()
    	{ 
    	  CloseBrandmark();	
    	});
	
	// cookies + brandmark

	

//	var COOKIE_NAME = 'zysk50plus';



//	if($.cookie(COOKIE_NAME) != "test")

	   // {

		//	$.cookie(COOKIE_NAME, 'test', { path: '/', expires: 7 });

            	/* wyskakujacy flash */

	
    
 /*  PONIZEJ JEST KOD ODPOWEDZIALNY ZA WIDOCZNY NA STRONIE BANEREK I JESZCZE NIZEJ TEZ JAKEST KAWALEK KODU    CZESC 1/3
  	var width = screen.width;

		var left = width/2 - 200+"px";

		$('#brandmark').show().css({"position":"absolute", "top":"50px", "left": left, "z-index":"299"});

		$('#brandmark').flash({

			src: './swf/50plus_v2.swf',

			width: 300,

			height: 300,

			wmode: 'transparent'

		});   */
		
		
		
		

		/*$('#brandmark').bind("click", function(){

			$(this).hide();

			funkcja_ktorej_niema();

			return false;

		});*/

	//	}

//	else {

//	};
	


/* TU JEST RESZTA KODU I JESZCZE   CZESC 2/3
	
	
	$('#fontsizers a').bind("click",function(){
		var rozmiar = $(this).attr("class");
		$('body').removeClass();
		$('body').addClass(rozmiar);	
	});
	
    ShowHide();
    
    $('#top-banner').flash({
		src: './swf/banner.swf',
		width: 981,
		height: 166,
		wmode: 'transparent'
	});

	$('#baner_at_left_menu').BPlayer({
		interval: baner_at_left_menu_firstint,
		hasbutton: 0,
		hasswitch: 0
	});
	
	
	
	
/*	$('#baner_at_top').BPlayer({
		interval: baner_at_top_firstint,
		hasbutton: 0,
		hasswitch: 0
	});
*/
	
	
/*      I JESZCZE TUTAJ  JEST KOD 3/3

	$('#baner_under_main_menu').BPlayer({
		interval: baner_under_main_menu_firstint,
		hasbutton: 0,
		hasswitch: 0
	});		
	
	$('a[rel="lightbox"]').lightbox();
	*/

});
	
