

function strltrim() { return this.replace(/^\s+/,''); }
function strrtrim() { return this.replace(/\s+$/,''); }
function strtrim() { return this.replace(/^\s+/,'').replace(/\s+$/,''); }
String.prototype.ltrim = strltrim;
String.prototype.rtrim = strrtrim;
String.prototype.trim = strtrim;

function onPostSubmit() {
	var f = document.postForm;
	
	var t = f['post_text'].value;
	var n = f['post_name'].value;
	var c = f['post_code'].value;
	t = t.trim();
	n = n.trim();
	c = c.trim();
	
	if(!t) { alert(f['error_3'].value); return false; }
	if(!n) { alert(f['error_2'].value); return false; }
	if(!c) { alert(f['error_1'].value); return false; }
	
}



function togglePollInput(obj, txtFldName, isVisible) {
	document.voteForm[txtFldName].style.display = isVisible ? 'block' : 'none';
	//document.voteForm[txtFldName].value = '';
}