var interval_rotate_question = 5; //seconds

var rotateQuestions = new Array();
var NumberOfRotateQuestions = 0;
var timer_rotate_question = null;

function addRotateQuestion(id, cat_id, question)
{
	rotateQuestions[NumberOfRotateQuestions]=new Array();
	rotateQuestions[NumberOfRotateQuestions][0]=question;
	rotateQuestions[NumberOfRotateQuestions][1]=id;
	rotateQuestions[NumberOfRotateQuestions][2]=cat_id;
	
	NumberOfRotateQuestions++;
}

function changeRotateQuestion()
{
	var ran = Math.floor(Math.random()*rotateQuestions.length);
	
	document.getElementById('the_question').innerHTML = rotateQuestions[ran][0];
	document.getElementById('the_question_id').innerHTML = "<a class='' target='_parent' href='index.php?n=4&e=48&s=" + rotateQuestions[ran][2] + "&exp=" + rotateQuestions[ran][1] + "'>Klik hier</a>";
	
	//initRotateQuestionTimer();
}

function initRotateQuestionTimer()
{
	timer_rotate_question = setInterval("changeRotateQuestion()", 1000*interval_rotate_question);
}

function clearRotateQuestionTimer()
{
	if(timer_rotate_question) clearInterval(timer_rotate_question);
}