var comments_form, help_form

function helpInfoHelpful() {
	ocultar($('feedback'))
	mostrar($('thankyou'), 'block')
}

function helpInfoNotHelpful() {
	ocultar($('feedback'))
	mostrar($('comments'), 'block')
}

function helpInfoSend(e) {
    var url = '/index/helpFeedback'
    var params = "name=" + escape(comments_form.name.value) + "&message=" + escape(comments_form.message.value)

    http.open("POST", url, true)
    http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
    http.send(params)

	ocultar($('comments'))
	mostrar($('thankyou'), 'block')

    Event.stop(e)
	return false
}

function submitHelpForm(e) {
    Event.stop(e)
    return false;
}

function helpLoad() {
    help_form     = $('help-form')
    addEvent(help_form, 'submit', submitHelpForm)
    addEvent($('helpful'), 'click', helpInfoHelpful)
    addEvent($('not-helpful'), 'click', helpInfoNotHelpful)
	comments_form = $('comments-form')
    addEvent(comments_form, 'submit', helpInfoSend)
}

onLoad('helpLoad()')
