/**
*   @version $Id$
*	@package frontend
*	@author piotrj
*/

/**--------------------------------------------------------------------
*	modul kontakt
*---------------------------------------------------------------------*/

	/**
	*	Opis: wysyla dane z formularza kontaktowego
	*/
	function submitContactForm( a_txt )
	{
		//getWysiwyg( 0 );
		
		var ok = 1;
		var fieldsToCheck = Array( 'name', 'surname', 'conemail', 'subject', 'captchaCode', 'wText0', 'institution' );
		var fieldsMinLenght = Array( 0, 0, 0, 0, 0, 0, 0 );
		for( var i = 0; i <= 6; i++ )
		{
			oObj = $( fieldsToCheck[i] );
			oVal = oObj.value;
			re = /[\s\t\r\n]+/g;
			oVal = oVal.replace( re, '' )
			if( oVal == '' )
			{
				oObj.className = 'textLF1';
				ok = 0;
			}
			else if( ( fieldsMinLenght[i] > 0 ) && ( oVal.length < fieldsMinLenght[i] ) )
			{
				oObj.className = 'textLF1';
				if( ok == 1 )
				{
					ok = 2;
				}
			}
			else
			{
				oObj.className = 'textLF0';	
			}
		}
		if( isEMail( $( 'conemail' ).value ) == 0 )
		{
			ok = 0;
			$( 'conemail' ).className = 'textLF1';
		}
		if( ok == 1 )
		{
			$( "contactForm" ).submit();
		}
		else
		{
			alert( a_txt );
		}
	}

	/**
	*	Opis: sprawdza, czy formularz kontaktowy zostal poprawnie wypelniony
	*/
	function checkContactForm( a_text )
	{
		if( ( $( "imnaz" ).value != "" ) && ( $( "email" ).value != "" ) )
		{
			$( "kontaktform" ).submit();
		}
		else
		{
			alert( a_text );
		}
	}

/**-------------------------------------------------------------------*/

