function stest() {
	this.sno=0;
	this.puan=0;
	this.sorular=new Array(
		['Sık sık hastalanıyorum',0],
		['Baş ağrısı ya da mide problemleri yaşıyorum',0],
		['Gerginliğimi azaltmak için sigara, içki ya da sakinleştiricilere başvurduğum oluyor',0],
		['Çok önemsiz meselelerden bile rahatsızlık duyduğum oluyor',0],
		['Çoğu zaman kendimi yorgun ve halsiz hissedebiliyorum',0],
		['Sevilen ve başarılı biri olmak benim için önemli',0],
		['İşyerimde sürekli problem ve gerginlik yaşıyorum',0],
		['Başarılı olmak için yapmam gereken şeyleri yapmak için üzerimde baskı hissediyorum',0],
		['Hayatta kendimi tatminkar hissedecek kadar başarılıyım',0],
		['Hayattaki küçük şeylerden mutluluk duyabiliyorum',1],
		['Gerçekten gevşeyip rahatlayabiliyor ve yaşamdan keyif alabiliyorum',1]
	);
	
	this.sImages=new Array();
	for(i=1;i<=11;i++) {
		iname=(i<10)?'0'+i:i;
		this.sImages[i-1]=new Image();
		this.sImages[i-1].src='_img/sno_'+iname+'.gif';
	}
}

stest.prototype.nextQuestion=function() {
	var frm=document.forms['stest_choice'];
	
	for(i=0;i<frm.elements.length;i++) {
		if(frm.elements[i].checked==true) {
			frm.elements[i].checked=false;
			if(this.sorular[this.sno-1][1]==i) {
				this.puan++;
			}
			break;
		}
	}
	
	if(i==2) {
		alert("Lütfen seçiminizi yapınız.");
	} else {
		if(this.sno==this.sorular.length) {
			this.finish();
		} else {
			this.newQuestion();
		}
	}
}


stest.prototype.newQuestion=function() {
	document.getElementById('img_sno').src=this.sImages[this.sno].src;
	document.getElementById('stest_soru_cont').innerHTML=this.sorular[this.sno][0];
	this.sno++;
}

stest.prototype.finish=function() {
	document.getElementById('stest_soru').style.display="none";
	document.getElementById('stest_metin').style.display="none";
	if(this.puan<=3) {
		document.getElementById('stest_sonuc_1').style.display="block";
	} else {
		document.getElementById('stest_sonuc_2').style.display="block";
	}
}

stest.prototype.restart=function() {
	this.sno=0;
	this.puan=0;
	this.newQuestion();
	document.getElementById('stest_sonuc_1').style.display="none";
	document.getElementById('stest_sonuc_2').style.display="none";
	document.getElementById('stest_soru').style.display="block";
	document.getElementById('stest_metin').style.display="block";
}

