/**
*   @version $Id$
*/
	/*var txtToStart = "";
	var pageToStart = "";

	function goingToStartFunction()
	{
		if( ( txtToStart != "" ) && ( pageToStart != "" ) )
		{
			if( confirm( txtToStart ) )
			{
				window.location = pageToStart;
			}
		}
	}*/

/**--------------------------------------------------------------------
*	tu funkcje dla obrazkow glownie z wysiwyg
*	DO NOT REMOVE UNDER ANY CIRCUMSTANCES !!!
*---------------------------------------------------------------------*/

	/**global object that contains popup image data */
	var popupImageObj;

	/**
	* Function is used to show image popup window.
	* Window is created after complete image loading
	* @param popupImageObj global variable - image to show object
	*/
	function showImagePopupWindow()
	{
		if( popupImageObj.complete == true )
		{
			windowWidth = popupImageObj.width + 20;
			windowHeight = popupImageObj.height + 30;
			verticalPosition = (document.body.clientWidth - windowWidth) / 2;
			if(verticalPosition < 0) verticalPosition = 0;
			horizontalPosition = (document.body.clientHeight - windowHeight) / 2;
			if(horizontalPosition < 0) horizontalPosition = 0;
			popupWindowObj = window.open(   popupImageObj.src, 
							"image_window", 
							"channelmode=no, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, titlebar=no, \
							width="+ windowWidth +", height="+ windowHeight +", \
							left="+ verticalPosition +", top="+ horizontalPosition +"" );
			popupWindowObj.focus();
		}
		else
		{
			setTimeout( "showImagePopupWindow()", 10 );
		}
	}

	/**
	*	Opis: pokazuje obrazek w nowym dopasowanym oknie
	*/
	function showImage( pathToImage )
	{
		popupImageObj = new Image();
		popupImageObj.src = pathToImage;
		showImagePopupWindow( popupImageObj );
	}

	/**
	*	Opis: funkcja zalatwia nam obsluge PNG w IE // correctly handle PNG transparency in Win IE 5.5 & 6.
	*/
	/**
	function correctPNG()
	{
		var arVersion = navigator.appVersion.split( "MSIE" );
		var version = parseFloat( arVersion[1] );
		if( ( version >= 5.5 ) && ( document.body.filters ) ) 
		{
			for( var i = 0 ; i < document.images.length; i++ )
			{
				var img = document.images[i];
				var imgName = img.src.toUpperCase();
				if( imgName.substring( imgName.length-3, imgName.length ) == "PNG" )
				{
					var imgID = ( img.id ) ? "id='" + img.id + "' " : ""
					var imgClass = ( img.className ) ? "class='" + img.className + "' " : "";
					var imgTitle = ( img.title ) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
					var imgStyle = "display: inline-block;" + img.style.cssText;
					if( img.align == "left" )
					{
						imgStyle = "float: left;" + imgStyle;
					}
					if( img.align == "right" )
					{
						imgStyle = "float: right;" + imgStyle;
					}
					if( img.parentElement.href )
					{
						imgStyle = "cursor: hand;" + imgStyle;
					}
					var strNewHTML = "<span " + imgID + imgClass + imgTitle
							+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
							+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
							+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>";
					img.outerHTML = strNewHTML;
					i = i-1;
				}
			}
		}    
	}
	window.attachEvent( "onload", correctPNG );
	*/

/**-------------------------------------------------------------------*/


/**--------------------------------------------------------------------
*	to nam zalatwia poprawne wyswietlanie flashy w Internet Exploderze
*---------------------------------------------------------------------*/

	/**
	 * SWFObject v1.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
	 *
	 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
	 * http://www.opensource.org/licenses/mit-license.php
	 *
	 * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
	 *   legal reasons.
	 */
	if( typeof deconcept == "undefined" )
	{
		var deconcept = new Object();
	}
	if( typeof deconcept.util == "undefined" )
	{
		deconcept.util = new Object();
	}
	if( typeof deconcept.SWFObjectUtil == "undefined" )
	{
		deconcept.SWFObjectUtil = new Object();
	}
	deconcept.SWFObject = function( _1, id, w, h, _5, c, _7, _8, _9, _a, _b )
	{
		if( !document.createElement || !document.getElementById )
		{
			return;
		}
		this.DETECT_KEY = _b ? _b : "detectflash";
		this.skipDetect = deconcept.util.getRequestParameter( this.DETECT_KEY );
		this.params = new Object();
		this.variables = new Object();
		this.attributes = new Array();
		if( _1 )
		{
			this.setAttribute( "swf", _1 );
		}
		if( id )
		{
			this.setAttribute( "id", id );
		}
		if( w )
		{
			this.setAttribute( "width", w );
		}
		if( h )
		{
			this.setAttribute( "height", h);
		}
		if( _5 )
		{
			this.setAttribute( "version", new deconcept.PlayerVersion( _5.toString().split( "." ) ) );
		}
		this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion( this.getAttribute( "version" ), _7 );
		if( c )
		{
			this.addParam( "bgcolor", c );
		}
		var q = _8 ? _8 : "high";
		this.addParam( "quality", q );
		this.setAttribute( "useExpressInstall", _7 );
		this.setAttribute( "doExpressInstall", false );
		var _d = ( _9 ) ? _9 : window.location;
		this.setAttribute( "xiRedirectUrl", _d );
		this.setAttribute( "redirectUrl", "" );
		if( _a )
		{
			this.setAttribute( "redirectUrl", _a );
		}
	};
	deconcept.SWFObject.prototype = { 
		setAttribute:function( _e, _f )
		{
			this.attributes[_e] = _f;
		}
		, getAttribute:function( _10 )
		{
			return this.attributes[_10];
		}
		, addParam:function( _11, _12)
		{
			this.params[_11]=_12;
		}
		, getParams:function()
		{
			return this.params;
		}
		, addVariable:function( _13, _14 )
		{
			this.variables[_13] = _14;
		}
		, getVariable:function( _15 )
		{
			return this.variables[_15];
		}
		, getVariables:function()
		{
			return this.variables;
		}
		, getVariablePairs:function()
		{
			var _16 = new Array();
			var key;
			var _18 = this.getVariables();
			for( key in _18 )
			{
				_16.push( key + "=" + _18[key] );
			}
			return _16;
		}
		, getSWFHTML:function()
		{
			var _19 = "";
			if( navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length )
			{
				if( this.getAttribute( "doExpressInstall" ) )
				{
					this.addVariable( "MMplayerType", "PlugIn" );
				}
				_19 = "<embed type=\"application/x-shockwave-flash\" src=\"" + this.getAttribute( "swf" ) + "\" width=\"" + this.getAttribute( "width" ) + "\" height=\"" + this.getAttribute( "height" ) + "\"";
				_19 += " id=\"" + this.getAttribute( "id" ) + "\" name=\"" + this.getAttribute( "id" ) + "\" ";
				var _1a = this.getParams();
				for( var key in _1a )
				{
					_19 += [key] + "=\"" + _1a[key] + "\" ";
				}
				var _1c = this.getVariablePairs().join( "&" );
				if( _1c.length > 0 )
				{
					_19 += "flashvars=\"" + _1c + "\"";
				}
				_19 += "/>";
			}
			else
			{
				if( this.getAttribute( "doExpressInstall" ) )
				{
					this.addVariable( "MMplayerType", "ActiveX" );
				}
				_19 = "<object id=\"" + this.getAttribute( "id" ) + "\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"" + this.getAttribute( "width" ) + "\" height=\"" + this.getAttribute( "height" ) + "\">";
				_19 += "<param name=\"movie\" value=\"" + this.getAttribute( "swf" ) + "\" />";
				var _1d = this.getParams();
				for( var key in _1d )
				{
					_19 += "<param name=\"" + key + "\" value=\"" + _1d[key] + "\" />";
				}
				var _1f = this.getVariablePairs().join( "&" );
				if( _1f.length > 0 )
				{
					_19 += "<param name=\"flashvars\" value=\"" + _1f + "\" />";
				}
				_19 += "</object>";
			}
			return _19;
		}
		, write:function( _20 )
		{
			if( this.getAttribute( "useExpressInstall" ) )
			{
				var _21 = new deconcept.PlayerVersion( [6, 0, 65] );
				if( this.installedVer.versionIsValid( _21 ) && !this.installedVer.versionIsValid( this.getAttribute( "version" ) ) )
				{
					this.setAttribute( "doExpressInstall", true );
					this.addVariable( "MMredirectURL", escape( this.getAttribute( "xiRedirectUrl" ) ) );
					document.title = document.title.slice( 0, 47 ) + " - Flash Player Installation";
					this.addVariable( "MMdoctitle", document.title );
				}
			}
			if( this.skipDetect || this.getAttribute( "doExpressInstall" ) || this.installedVer.versionIsValid( this.getAttribute( "version" ) ) )
			{
				var n = ( typeof _20 == "string" ) ? document.getElementById( _20 ) : _20;
				n.innerHTML = this.getSWFHTML();
				return true;
			}
			else
			{
				if( this.getAttribute( "redirectUrl" ) != "" )
				{
					document.location.replace( this.getAttribute( "redirectUrl" ) );
				}
			}
			return false;
		}
	};
	deconcept.SWFObjectUtil.getPlayerVersion = function( _23, _24 )
	{
		var _25 = new deconcept.PlayerVersion( [0, 0, 0] );
		if( navigator.plugins && navigator.mimeTypes.length )
		{
			var x = navigator.plugins[ "Shockwave Flash" ];
			if( x && x.description )
			{
				_25 = new deconcept.PlayerVersion( x.description.replace( /([a-z]|[A-Z]|\s)+/, "" ).replace( /(\s+r|\s+b[0-9]+)/, "." ).split( "." ) );
			}
		}
		else
		{
			try
			{
				var axo = new ActiveXObject( "ShockwaveFlash.ShockwaveFlash" );
				for( var i = 3; axo != null; i++ )
				{
					axo = new ActiveXObject( "ShockwaveFlash.ShockwaveFlash." + i );
					_25 = new deconcept.PlayerVersion( [i, 0, 0] );
				}
			}
			catch( e ){}
			if( _23 && _25.major > _23.major )
			{
				return _25;
			}
			if( !_23 || ( ( _23.minor != 0 || _23.rev != 0 ) && _25.major == _23.major ) || _25.major != 6 || _24 )
			{
				try
				{
					_25 = new deconcept.PlayerVersion( axo.GetVariable( "$version" ).split( " " )[1].split( "," ) );
				}
				catch( e ){}
			}
		}
		return _25;
	};
	deconcept.PlayerVersion = function( _29 )
	{
		this.major = parseInt( _29[0] ) != null ? parseInt( _29[0] ) : 0;
		this.minor = parseInt( _29[1] ) || 0;
		this.rev = parseInt( _29[2] ) || 0;
	};
	deconcept.PlayerVersion.prototype.versionIsValid = function( fv )
	{
		if( this.major < fv.major )
		{
			return false;
		}
		if( this.major > fv.major )
		{
			return true;
		}
		if( this.minor < fv.minor )
		{
			return false;
		}
		if( this.minor > fv.minor )
		{
			return true;
		}
		if( this.rev < fv.rev )
		{
			return false;
		}
		return true;
	};
	deconcept.util = {
		getRequestParameter:function( _2b )
		{
			var q = document.location.search || document.location.hash;
			if( q )
			{
				var _2d = q.indexOf( _2b + "=" );
				var _2e = ( q.indexOf( "&", _2d ) >- 1 ) ? q.indexOf( "&", _2d ) : q.length;
				if( q.length > 1 && _2d >- 1 )
				{
					return q.substring( q.indexOf( "=", _2d ) + 1, _2e );
				}
			}
			return "";
		}
	};
	if( Array.prototype.push == null )
	{
		Array.prototype.push = function( _2f )
		{
			this[this.length] = _2f;
			return this.length;
		};
	}
	var getQueryParamValue = deconcept.util.getRequestParameter;
	var FlashObject = deconcept.SWFObject; // for backwards compatibility
	var SWFObject = deconcept.SWFObject;

	/**
	*	Opis: funkcja zalatwia problem z wstawianiem flashy do IE
	*/
	function drawFlash( path, param, quality, bgcolor, width, height, name, flashDiv )
	{
	var so = new SWFObject( path, name, width, height, "8", bgcolor );
	so.addParam( "quality", quality );
		var par = param.split( "&" );
		for( var i = 0; i < par.length; i++ )
		{
			var p = par[i].split( "=" );
			so.addVariable( p[0], p[1] );
		}
		so.addParam( "wmode", "transparent" );
	so.write( flashDiv );
	}

	/**
	*	Opis: funkcja zalatwia problem z wstawianiem flashy do IE
	*/
	function drawFlashOld( path, param, quality, bgcolor, width, height, name )
	{
		document.write( '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+width+'" height="'+height+'" id="mainElem" align="middle">' );
		document.write( '<param name="allowScriptAccess" value="always" />' );
		document.write( '<param name="movie" value="'+path+'" />' );
		document.write( '<param name="quality" value="'+quality+'" />' );
		document.write( '<param name="bgcolor" value="'+bgcolor+'" />' );
		document.write( '<param name="wmode" value="transparent" >' );
		document.write( '<param name="FlashVars" value="'+param+'" >' );
		document.write( '<embed src="'+path+'?'+param+'" quality="'+quality+'" bgcolor="'+bgcolor+'" width="'+width+'" height="'+height+'" name="'+name+'" wmode="transparent" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />' );
		document.write( '</object>' );
	}

/**-------------------------------------------------------------------*/


/**--------------------------------------------------------------------
*	tu funkcje rozne, czasem przydatne, czasem nie
*---------------------------------------------------------------------*/

	/**
	*	Opis: funkcja usowa taby z textarea
	*/
	function clearTabulators()
	{
		if( oTar = document.getElementsByTagName("TEXTAREA") )
		{
			for( i = 0; i < oTar.length; i++ )
			{
				re = /[\t]+/g;
				vTxt = oTar[i].value;
				oTar[i].value = vTxt.replace( re, "" );
				re = /[\f\n\r]+$/g;
				vTxt = oTar[i].value;
				oTar[i].value = vTxt.replace( re, "" );
			}
		}
	}

	/**
	*	Opis: funkcja otwiera nowe okno z zawartoscia do wydruku
	*/
	function docPrinter( a_url )
	{
		a_text = ""+document.getElementById( "pagecontent" ).value+"";
		winObj = window.open( a_url, "_blank", "channelmode=no, toolbar=yes, location=yes, directories=yes, status=yes, menubar=yes, scrollbars=yes, resizable=yes, titlebar=yes, fullscreen=yes" );
		winObj.document.open();
		winObj.document.write( a_text );
		winObj.document.close();
	}

	/**
	*	Opis: funkcja odkrywa jeden element ukrywajac pozostale
	*/
	function showChosen( a_name, a_nr )
	{
		docid = a_name+"0";
		i = 0;
		while( oObj = document.getElementById( docid ) )
		{
			if( i != a_nr )
			{
				oObj.style.display = 'none';
			}
			i++;
			docid = a_name+""+i+"";
		}
		docid = a_name+""+a_nr+"";
		oObj = document.getElementById( docid );
		oObj.style.display = 'block';
	}

	/**
	*	Opis: funkcja chowa lub pokazuje to co ukryte/odkryte
	*/
	function showHideAll( a_name, a_nr, a_ilosc )
	{
		for( i = 0; i < a_ilosc; i++ )
		{
			if( i != a_nr )
			{
				docid = a_name+""+i+"";
				document.getElementById( docid ).style.display = 'none';
			}
		}
		docid = a_name+""+a_nr+"";
		obj = document.getElementById( docid );
		if( obj.style.display == 'none' )
		{
			obj.style.display = 'block';
		}
		else
		{
			obj.style.display = 'none';
		}
	}

	/**
	*	Opis: funkcja chowa lub pokazuje to co ukryte/odkryte
	*/
	function showHide( a_docid )
	{
		obj = document.getElementById( a_docid );
		if( obj.style.display == 'none' )
		{
			obj.style.display = 'block';
		}
		else
		{
			obj.style.display = 'none';
		}
	}

	/**
	*	Opis: zmienia rozmiar okna
	*/
	function resizeImageWindow( imageObj, winObj )
	{
		if( imageObj.complete == true )
		{
			l_width = imageObj.width+30;
			l_height = imageObj.height+90;
			winObj.resizeTo( l_width, l_height );
		}
		else
		{
			setTimeout( "resizeImageWindow( imageObj, winObj )", 10 );
		}
	}

	/**
	*	Opis: zmienia lokacje na podany adres
	*/
	function go_to_location( a_location )
	{
		window.location = a_location;
	}

	/**
	*	Opis: przycina tekst do wskazanej dlugosci
	*/
	function checkNumChars( id, num )
	{
		oTxt = document.getElementById( id );
		vTxt = oTxt.value;
		if( vTxt.length > num )
		{
			vTxt = vTxt.substr( 0, num );
			oTxt.value = vTxt;
		}
	}

	/**
	*	Opis: funkcja sprawdza, czy grafika jest aktywna, czy nie
	*/
	function checkIsOn( a_id )
	{
		oButton = document.getElementById( a_id );
		sSrc = oButton.src;
		iLen = sSrc.length;
		sRoz = sSrc.substr( iLen-6, 2 );
		if( sRoz == "_a" )
		{
			return 1;
		}
		else
		{
			return 0;
		}
	}

	/**
	*	Opis: funkcja podmienia obrazki bez tekstu przy wywolaniu
	*/
	function changeImage2( a_name, on_off ) 
	{
		old_img = document.getElementById( a_name );
		old_src = old_img.src;
		len = old_src.length;
		roz = old_src.substr( len-4, len );
		new_src = old_src;
		if( on_off == 1 )
		{
			if( checkIsOn( a_name ) == 0 )
			{
				new_src = old_src.substr( 0, len-4 ) + "_a" + roz;
			}
		}
		else
		{
			if( checkIsOn( a_name ) == 1 )
			{
				new_src = old_src.substr( 0, len-6 ) + roz;
			}
		}
		old_img.src = new_src;
	} 

	/**
	*	Opis: zmienia lokacje strony na podany adres
	*/
	function LocationFromMenu( adres )
	{
		window.location = adres;
	}

	/**
	*	Opis: usuwa nadmiarowe spacje ze stringa
	*/
	function erase_space( str )
	{
		newstr = "";
		i = 0;
		strlen = str.length;
		znak = str.charAt(i);
		while( ( znak != "" ) && ( i < strlen ) )
		{
			if( znak == " " )
			{
				i++;
			}
			else
			{
				while( ( znak != "" ) && ( znak != " " ) && ( i < strlen ) )
				{
					newstr = newstr + znak;
					i++;
					znak = str.charAt(i);
				}
				newstr = newstr + "+";
				i++;
			}
			znak = str.charAt(i);
		}
		len = newstr.length;
		znak = newstr.charAt( len-1 );
		if( znak == "+" )
		{
			newstr = newstr.substr( 0, len-1 );
		}
		return newstr;
	}

	/**
	*	Opis: funkcja otwiera nowe okno z zawartoscia do wydruku
	*/
	function openMinimized( a_url )
	{
		winObj = window.open( a_url, "_blank", "channelmode=no, toolbar=yes, location=yes, directories=yes, status=yes, menubar=yes, scrollbars=no, resizable=yes, titlebar=yes, fullscreen=no, modal=no" );
		//winObj.moveTo( 0, 0 );
	}

	/**
	*	Opis: funkcja sprawdza, czy ciag jest liczba calkowita o okreslonej ilosci znakow
	*/
	function myIsInt( v, i, j )
	{
		len = v.length;
		if( !isNaN( v ) && ( len >= i ) && ( len <= j ) )
		{
			return 1;
		}
		return 0;
	}

	/**
	*	Opis: funkcja sprawdza, czy ciag jest poprawnym adresem e-mail
	*/
	function isEMail( email )
	{
		re = /^[-a-z0-9!#$%&\'*+\/=?^_`{|}~]+(\.[-a-z0-9!#$%&\'*+\/=?^_`{|}~]+)*@(([a-z]([-a-z0-9]*[a-z0-9]+)?){1,63}\.)+([a-z]([-a-z0-9]*[a-z0-9]+)?){2,63}$/g;
		check = email.replace( re, "" );
		if( check == '' )
		{
			return 1;
		}
		return 0;
	}

	/**
	*	Opis: funkcja sprawdza, czy ciag jest poprawna data
	*/
	function isDate( vDate )
	{
		re = /\./g;
		vDate = vDate.replace( re, "-" );
		re = /^(1|2)[0-9]{3}-(0{0,1}[1-9]|(1[0-2]))-(0{0,1}[1-9]|([1-3][0-9]))$/g;
		if( vDate.match( re, "" ) )
		{
			sDate = vDate.split( "-" );
			y = ( sDate[0] * 1 );
			m = ( sDate[1] * 1 ) - 1;
			d = ( sDate[2] * 1 );
			oldDate = y+"-"+m+"-"+d;
			if( oD = new Date( y, m, d ) )
			{
				newDate = oD.getFullYear()+"-"+oD.getMonth()+"-"+oD.getDate();
				if( oldDate == newDate )
				{
					return 1;
				}
			}
		}
		return 0;
	}

	/**
	*	Opis: odsyla do wyszukiwania ze stronicowania
	*/
	function sendPaging( a_adres )
	{
		document.forms.searchmod.action = a_adres;
		document.forms.searchmod.submit();
	}

	/**
	*	Opis: odsyla do wyszukiwania ze stronicowania
	*/
	function sendModuleSearch( a_adres )
	{
		document.getElementById( "moduleSearch1" ).value = 0;
		document.forms.searchmod.action = a_adres;
		document.forms.searchmod.submit();
	}

	/**
	*	Opis: formatuje cene
	*/
	function formatPrice( id )
	{
		oPrice = document.getElementById( id );
		price = oPrice.value;
		pos = price.indexOf( "," )
		if( pos >= 0 )
		{
			val = price.split( "," );
			price = val[0] + "." + val[1];
		}
		pF = parseFloat( price );
		price = "" + pF + "";
		if( isNaN( pF ) || ( pF < 0 ) )
		{
			oPrice.value = "0.00";
		}
		else
		{
			if( price.indexOf( "." ) >= 0 )
			{
				val = price.split( "." );
				begin = val[0];
				end = val[1];
				if( end.length > 0 )
				{
					pI = parseInt( end );
					if( isNaN( pI ) )
					{
						price = begin + ".00";
					}
					else
					{
						if( end.length > 2 )
						{
							end = end.substr( 0, 2 );
						}
						else if( end.length < 2 )
						{
							end += "0";
						}
					}
					price = begin + "." + end;
				}
				else
				{
					price = begin + ".00";
				}
			}
			else
			{
				price += ".00"
			}
			if( parseFloat( price ) > 999999999999.99 )
			{
				price = "999999999999.99";
			}
			oPrice.value = price;
		}
	}

	/**
	*	Opis: odsyla do wyszukiwania ze stronicowania
	*/
	function formatNumber( id )
	{
		oNum = document.getElementById( id );
		num = oNum.value;
		pI = parseInt( num );
		if( isNaN( pI ) || ( pI < 0 ) )
		{
			oNum.value = "0";
		}
		else if( pI > 9999 )
		{
			oNum.value = "9999";
		}
	}

/**-------------------------------------------------------------------*/


/**--------------------------------------------------------------------
*	newsletter
*---------------------------------------------------------------------*/

	/**
	*	Opis: przypisuje akcje do wykonania i robi submita
	*/
	function sendReferenceMail( a_text )
	{
		l_adresat = document.getElementById( "adresat" );
		l_nadawca = document.getElementById( "nadawca" );
		if( ( l_adresat.value == "" ) || ( l_nadawca.value == "" ) )
		{
			alert( a_text );
		}
		else
		{
			getWysiwyg( 0 );
			document.forms.polec_nas.submit();
		}
	}

	/**
	*	Opis: przypisuje akcje do wykonania i robi submita
	*/
	function subscriptAction( a_akcja )
	{
		l_hidden_action = document.getElementById( "akcja" );
		l_hidden_action.value = a_akcja;
		document.forms.subskrypt_form.submit();
	}

/**-------------------------------------------------------------------*/


/**--------------------------------------------------------------------
*	wyszukiwarka
*---------------------------------------------------------------------*/

	/**
	*	Opis: sprawdza dlugosc wszystkich podanych slow
	*/
	function checkWordsLength( a_str )
	{
		l_ok = 1;
		l_str = "";
		l_index = 0;
		l_len = a_str.length;
		if( l_len > 1 )
		{
			l_index = a_str.indexOf( "+" );
			if( l_index > 0 )
			{
				l_str = a_str.substr( 0, l_index );
				if( l_str.length > 1 )
				{
					r_str = a_str.substr( l_index+1, l_len );
					l_ok = checkWordsLength( r_str );
				}
				else
				{
					if( l_str.length > 0 )
					{
						l_ok = 0;
					}
				}
			}
		}
		else
		{
			l_ok = 0;
		}
		return l_ok;
	}

	/**
	*	Opis: odsyla do wyszukiwania, jesli wpisano slowa
	*/
	function SendWords( a_host, a_id, text_to_alert1, text_to_alert2, a_type, plainTxt )
	{
		//check_forbidden_chars( a_id, text_to_alert );
		word_container = document.getElementById( a_id );
		words = word_container.value;
		if( ( words != "" ) && ( words != plainTxt ) )
		{
			words = words.toLocaleLowerCase();
			re = /(\+)/g;
			words = words.replace( re, "d7d18cfb3a0d8293e2f5d94ea30e04d2" );
			words = erase_space( words );
			is_ok = checkWordsLength( words );
			if( is_ok == 1 )
			{
				words = encodeURI(words);
				re = /(\%25+)/g;
				words2 = words.replace( re, "e1e4faf650b9178c832fd6ce887e11d4" );
				re = /(\/)/g;
				words2 = words2.replace( re, "9fbbaa4cc515bc46e0c12e82a31df736" );
				adres = a_host + "/wyszukiwanie/slowa/" + words2;
				if( a_type == 1 )
				{
					document.forms.searchmod.action = adres;
					document.forms.searchmod.submit();
				}
				else if( a_type == 2 )
				{
					document.forms.searchtop.action = adres;
					document.forms.searchtop.submit();
				}
				else
				{
					window.location = adres;
				}
			}
			else
			{
				alert( text_to_alert1 );
			}
		}
		else
		{
			alert( text_to_alert2 );
		}
	}

	/**
	*	Opis: sprawdza, czy w stringu nie ma zabronionych znakow
	*/
	function check_forbidden_chars( element_id, send, text_to_alert )
	{
		send_text_el = document.getElementById( element_id );
		send_text = send_text_el.value;
		pos = send_text.indexOf( "%" );
		pos2 = send_text.indexOf( "_" );
		if( ( pos >= 0 ) || ( pos2 >= 0 ) )
		{
			send_text_el.value = "";
			alert( text_to_alert );
		}
		if( send == 1 )
		{
			if( send_text_el.value != "" )
			{
				document.forms.product_search.submit();
			}
		}
	}

/**-------------------------------------------------------------------*/

/**--------------------------------------------------------------------
*	Logowanie
*---------------------------------------------------------------------*/

	/**
	*	Opis: sprawdza, czy e-mail i haslo do rejestracji nie sa puste
	*/
	function checkLogin( text, val1, val2 )
	{
		exlog = document.getElementById( "exlogin" ).value;
		expas = document.getElementById( "exhaslo" ).value;
		if( ( exlog != "" ) && ( exlog != val1 ) && ( expas != "" ) && ( expas != val2 ) )
		{
			oForm = document.getElementById( "exloginform" );
			//vLoc = new String( window.location );
			vLoc = new String( oForm.action );
			re = /^http:\/\/(.*?)$/;
			oForm.action = vLoc.replace( re, "https://$1" );
			oForm.submit();
		}
		else
		{
			alert( text );
		}
	}

	/**
	*	Opis: sprawdza, czy e-mail i haslo do rejestracji nie sa puste
	*/
	function sendPassword( txt, val, vAction )
	{
		exlog = document.getElementById( "exlogin" ).value;
		if( ( exlog != "" ) && ( exlog != val ) )
		{
			document.getElementById( "exsendpass" ).value = 1;
			document.forms.exloginform.action = vAction;
			document.forms.exloginform.submit();
		}
		else
		{
			alert( txt );
		}
	}

/**-------------------------------------------------------------------*/

	/**
	*	Opis: ustawia w cookie, czy box ma byc rozwiniety, czy nie
	*/
	function setBoxInCookie( name, val, days )
	{
		if( days )
		{
			var date = new Date();
			date.setTime( date.getTime() + ( days * 24 * 60 * 60 * 1000 ) );
			var expires = "; expires=" + date.toGMTString();
		}
		else
		{
			var expires = "";
		}
		document.cookie = name + "=" + val + expires + "; path=/";
	}

	/**
	*	Opis: funkcja zmienia styl w podpieciach FAQ
	*/
	function changeStyle( a_docid )
	{
		if( document.getElementById( 'faqpod'+a_docid ).style.display == 'none' )
		{
			document.getElementById( 'faqDiv'+a_docid ).className = 'faqDiv1';
			document.getElementById( 'faqLink'+a_docid ).className = 'l4';
		}
		else
		{
			obj1 = document.getElementById( 'faqDiv'+a_docid );
			obj1.className = 'faqDiv2';
			obj2 = document.getElementById( 'faqLink'+a_docid );
			obj2.className = 'l10';
		}
	}

	function newsletterWindow()
	{
		if( document.getElementById( 'newsTab' ).style.display == 'none' )
		{
			document.getElementById( 'newsTab' ).style.display = 'block';
		}
		else
		{
			document.getElementById( 'newsTab' ).style.display = 'none';
		}
	}
	
	
	/**
	*	Opis: sprawdza, czy w wyszukiwarce dla katalogu 
	*/
	function checkCatalogWords2( formName, a_txt, a_txt2, a_loc )
	{
		/*if( ( document.getElementById( "katname" ).checked != true ) && ( document.getElementById( "katdesc" ).checked != true ) && ( document.getElementById( "katcode" ).checked != true ) )
		{
			alert( a_txt2 );
		}
		else
		{*/
			words_container = document.getElementById( "catalog_words2" );
			send_text = words_container.value;
			newstr = "";
			len = send_text.length;
			i = 0;
			while( ( send_text.charAt(i) != "" ) && ( i < len ) )
			{
				if( send_text.charAt(i) == " " )
				{
					i++;
				}
				else
				{
					while( ( send_text.charAt(i) != "" ) && ( send_text.charAt(i) != " " ) && ( i < len ) )
					{
						newstr = newstr + send_text.charAt(i);
						i++;
					}
					newstr = newstr + " ";
					i++;
				}
			}
			len = newstr.length;
			if( newstr.charAt(len-1) == " " )
			{
				newstr = newstr.substr( 0, len-1 );
			}
			if( newstr != "" )
			{
				$( "catalog_words" ).value = newstr;
				formObj = $( formName );
				formObj.action = a_loc;
				formObj.submit();
			}
			else
			{
				words_container.value = "";
				document.getElementById( "catalog_words" ).value = "";
				alert( a_txt );
			}
		//}
	}

	/**
	*	Opis: resetuje formularz zamowienia
	*/
	function clearPromotionForm()
	{
		document.forms.promotionForm.reset();
	}


	function showPromotionForm()
	{
		document.getElementById( 'promotionButton' ).style.display = 'none';
		document.getElementById( 'promoForm' ).style.display = 'block';
	}

	/**
	*	Opis: funkcja wysyla zamowienie z materialow drukowanych
	*/
	function checkPromotionForm( txt )
	{
		if( ( document.getElementById( "pmimie" ).value != "" ) && ( document.getElementById( "pmnazwisko" ).value != "" )  && ( document.getElementById( "pmphone" ).value != "" ) && ( document.getElementById( "pmemail" ).value != "" ) )
		{
			document.forms.promotionForm.submit();
		}
		else
		{
			alert( txt );
		}
	}

/**---------------------------------------------------------------------------------------------------------------------------------------------------*/

	/**
	* Function is used to show image popup window.
	* Window is created after complete image loading
	* @param popupImageObj global variable - image to show object
	*/
	function showOrderPopupInfo( popUrl )
	{
		windowWidth = 639;
		windowHeight = 479;
		verticalPosition = (document.body.clientWidth - windowWidth) / 2;
		if(verticalPosition < 0) verticalPosition = 0;
		horizontalPosition = (document.body.clientHeight - windowHeight) / 2;
		if(horizontalPosition < 0) horizontalPosition = 0;
		popupInfoWindowObj = window.open(   popUrl, 
						"image_window", 
						"channelmode=no, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, titlebar=no, \
						width="+ windowWidth +", height="+ windowHeight +", \
						left="+ verticalPosition +", top="+ horizontalPosition +"" );
		popupInfoWindowObj.focus();
	}

