get_ipss_score = function() {
	total = 0;
	
	for( i = 1; i < 8; i++ ) {
		for( j = 0; j < 6; j++ ) {
			el = document.getElementById( 'Q'+i+'_'+j );
			if( el.checked ) {
				total += parseInt( el.value );
			}
		}
	}
	
	el = document.getElementById( 'finalScore' );
	el.innerHTML = total;
	
	if( parseInt( total ) >= 1 && parseInt( total ) <= 7 ) {
		el = document.getElementById( 'score_card_1_1' );
		el.style.backgroundColor = '#99FF99';
		el = document.getElementById( 'score_card_1_2' );
		el.style.backgroundColor = '#99FF99';

		document.getElementById( 'score_card_2_1' ).style.backgroundColor = '';
		document.getElementById( 'score_card_2_2' ).style.backgroundColor = '';
		document.getElementById( 'score_card_3_1' ).style.backgroundColor = '';
		document.getElementById( 'score_card_3_2' ).style.backgroundColor = '';
		
	}
	else if( parseInt( total ) >= 8 && parseInt( total ) <= 19 ) {
		el = document.getElementById( 'score_card_2_1' );
		el.style.backgroundColor = '#FFCCFF';
		el = document.getElementById( 'score_card_2_2' );
		el.style.backgroundColor = '#FFCCFF';
		
		document.getElementById( 'score_card_1_1' ).style.backgroundColor = '';
		document.getElementById( 'score_card_1_2' ).style.backgroundColor = '';
		document.getElementById( 'score_card_3_1' ).style.backgroundColor = '';
		document.getElementById( 'score_card_3_2' ).style.backgroundColor = '';
	}
	else if( parseInt( total ) >= 20 ) {
		el = document.getElementById( 'score_card_3_1' );
		el.style.backgroundColor = '#FFCC66';
		el = document.getElementById( 'score_card_3_2' );
		el.style.backgroundColor = '#FFCC66';

		document.getElementById( 'score_card_1_1' ).style.backgroundColor = '';
		document.getElementById( 'score_card_1_2' ).style.backgroundColor = '';
		document.getElementById( 'score_card_2_1' ).style.backgroundColor = '';
		document.getElementById( 'score_card_2_2' ).style.backgroundColor = '';
	}
	else {
		document.getElementById( 'score_card_1_1' ).style.backgroundColor = '';
		document.getElementById( 'score_card_1_2' ).style.backgroundColor = '';
		document.getElementById( 'score_card_2_1' ).style.backgroundColor = '';
		document.getElementById( 'score_card_2_2' ).style.backgroundColor = '';
		document.getElementById( 'score_card_3_1' ).style.backgroundColor = '';
		document.getElementById( 'score_card_3_2' ).style.backgroundColor = '';
	}
}
