function initForms(isMainPage) {
	$('#report_problem .wide-input').placeholder({blankSubmit: true});
	var rpOptions = {
	    overlay: 30, /* 0-100 (int) : 0 is off/transparent, 100 is opaque */
	    overlayClass: 'blackOverlay',
		onShow: function (hash) {
			hash.w.show();
			
			$('#report_problem form :input:not(:hidden)').val("");
			$('#report_problem form textarea').val("");
			$('#report_problem form :input').blur();
		},
		toTop: true
	};
	if (!isMainPage) rpOptions.trigger = '#report a';
	
	$('#report_problem').jqm(rpOptions);
	
	// Close Button Highlighting. IE doesn't support :hover. Surprise?
	$('input.jqmdX')
	.hover(
	 function(){ $(this).addClass('jqmdXFocus'); }, 
	 function(){ $(this).removeClass('jqmdXFocus'); })
	.focus( 
	 function(){ this.hideFocus=true; $(this).addClass('jqmdXFocus'); })
	.blur( 
	 function(){ $(this).removeClass('jqmdXFocus'); });
	
	$('#report_problem form').ajaxForm({
		dataType: 'json',
		success: function(data) {
			if (data == 1) {
				$('#report_problem').jqmHide();
			} else {
				$('#report_problem .blackbox').append(formatErrors(data));
			}
		}
	});
}

function formatErrors(data) {
	var errors = '<ul class="form-errors">';
	for (var i in data) {
		for (var j in data[i]) {
			errors += '<li>' + i + ': ' + data[i][j] + '</li>';
		}
	}
	errors += '</ul>';
	
	return errors;
}
