
	function validate_test_1(){
		
		var user_msg 	= "";
		var empty_check = new Array();
		var ans_check	= new Array();
		
		// get questions
		$("#test_questions input").each(function(input_index){
			
			// this name/num
			var input_name 		= $(this).attr('name');		
			var this_input_name = input_name;
				this_input_name = this_input_name.replace("pitanje_","");
			
			
			// check: answered? (has checked) 
			if( $(this).attr('type') == "checkbox"  ){
			
				if( $("INPUT[name="+input_name+"]:checked").size() == 0 ){
					
					// error msg already triggered?
					if( !empty_check[ this_input_name ] ){
						user_msg += "- Niste odgovorili na pitanje broj " + this_input_name + "<br>";
						empty_check[ this_input_name ] = 1;	
					}
	
					
				}
				
				// has answers - check correct
				else {
					
					// type = checkbox
					if( $(this).attr('type') == "checkbox" ){
						
						// num of correct answers
						num_user_checked_ans = $("INPUT[name="+input_name+"][correct=yes]:checked").size();
						num_user_checked_all = $("INPUT[name="+input_name+"]:checked").size();
						num_correct_ans		 = $("INPUT[name="+input_name+"][correct=yes]").size();
						
						// already gave msg =
						if( !ans_check[ this_input_name ] ){
							
							// checked all
							if( num_user_checked_all > num_correct_ans ){
								
								user_msg += "- Krivo ste odgovorili na pitanje broj " + this_input_name + "<br>";
								ans_check[ this_input_name ] = 1;	
								
							}
							// checked = wrong
							else if( num_user_checked_ans != num_correct_ans ){
								
								user_msg += "- Krivo ste odgovorili na pitanje broj " + this_input_name + "<br>";
								ans_check[ this_input_name ] = 1;	
								
							}	
							
							// correct
							else if( num_user_checked_ans == num_correct_ans ){
								
								user_msg += "- TOČNO ste odgovorili na pitanje broj " + this_input_name + "<br>";
								ans_check[ this_input_name ] = 1;	
								
							}					
							
						}
						
						
					}	
	
					
				}			
				
			}
			else if( $(this).attr('type') == "text" ){
				
				if( !ans_check[ this_input_name ] ){
					
					// has text
					if( $("INPUT[name="+input_name+"]").val() == "" ){
						
						// error msg already triggered?
						if( !empty_check[ this_input_name ] ){
							user_msg += "- Niste odgovorili na pitanje broj " + this_input_name + "<br>";
							ans_check[ this_input_name ] = 1;	
						}
		
						
					}
					
					// gave answer
					else {
						
						this_correct_ans = $(this).attr('correct');
						user_ans		 = $(this).val();
						
						if( this_correct_ans != user_ans ){
							
							user_msg += "- Krivo ste odgovorili na pitanje broj " + this_input_name + "<br>";
							ans_check[ this_input_name ] = 1;	
							
						}
						else {
							
							user_msg += "- TOČNO ste odgovorili na pitanje broj " + this_input_name + "<br>";
							ans_check[ this_input_name ] = 1;
							
						}
						
						
					}					
					
				}
				

				
			}



			
		});
		
		if( user_msg != "" ){
			
			// facebox
			
			// alert(user_msg);
					
			$.facebox(user_msg); 

		}

		
		return false;
		
	}
