/**
 * javascript common
 */
 
/**
 * question format validator
 */
function validateQuestion(question_src) {
      	var question_start = ['am','are','can','could','did','do','does','how','if','is','should','what','when','where','which','will','who','why'];
      	var question_txt = question_src.toLowerCase();
      	var result = false;
		for (var i in question_start) {
      		if (result==false)
      			result = ( question_txt.indexOf( question_start[i]+' ' ) == 0 ) ?  true : false ;
		}
		if (result==false)
			alert('Question should begin with Am, Are, Can, Could, Did, Do, Does, How, If, Is, Should, What, When, Where, Which, Will, Who, or Why.');
		return result;
}		


$(document).ready(function(){
	$('[id^="_report_"]').click(function(){
		arr = this.id.split('_')
		window.location = '/'+arr[2]+'/report/id/'+arr[3];
	});

	$('[id^="_report_"]').confirm({
		timeout:3000,
		msg: 'Report This? '
	});
});


