function try_contact() {
	var h		= get( 'hashcode' );	
	var e 	= getValue( 'email' );
	var b 	= getValue( 'body' );
	if( ( e == '' ) || ( b == '' ) ) {
		alert( 'Wprowadź swój adres e-mail i wpisz wiadomość' );
	} else {
		h.value = 'foto';
		var ajax	= new myAjax();
		hide( 'div_contact' );
		ajax.action = 'try_contact';
		ajax.post( 'email=' + e + '&body=' + b + '&hashcode='+h.value, 'contact_message' );
		ajax.onLoad = function() {
			if( this.response == 'ok' ) {
				show( 'contact_message_send' );
			} else {
				show( 'div_contact' );
			}
		}
	}
}

function pollSave( id ) {
	id = id.toString();
	var poll = document.forms[ 'poll_' + id ];
	var bradio = poll.elements[ 'question_' + id ];
	var ret = 'poll_questions_' + id;
	var q = getRadioValue( bradio );
	var reg = new RegExp( '[0-9]+' );
	if( !q.match( reg ) ) {
		alert( 'Proszę wybrać którąś z odpowiedzi' );
	} else {
		hide( ret );
		var ajax = new myAjax();
		ajax.action = 'pollSave';
		ajax.post( 'poll='+id+'&answer=' + q, ret );
		ajax.onLoad = function() {
			show( ret );
		}
	}
}



function trySendNote( obj, id) {
	var ajax = new myAjax();
	ajax.action = 'trySendNote';
	var note = get ('opinion-value').value;
    var user = get ('imie').value;
    var comment = get ('comment-text').value;
	ajax.post( 'obj='+obj+'&id='+id+'&note='+note+'&comment='+comment );
	ajax.onLoad = function() {
		if( this.response == 'ok' ) {
			//window.location.reload();
			$ ('.center .inner').html('<span class="thanks">Dziękujemy za oddanie głosu w naszym konkursie!</span>');
            $ ('.center form').html('');
		} else {
			alert( this.response );
		}
	}
}

function tryAddNote( note ) {
	var ajax = new myAjax();
	ajax.action = 'tryAddNote';
	var pc = getValue( 'note_class' );
	var pid = getValue( 'note_id' );
	ajax.post( 'pc='+pc+'&pid='+pid+'&note='+note );
	ajax.onLoad = function() {
		alert( this.response );
	}
}