checkSkinTest=function(frm)
{
	if(checkFrm(frm))
	{
		var no, imax, rslt, grade;
		maxno = 6;
		rslt  = 0;
		for(no = 1 ; no < maxno ; no++)
		{
			var ele = eval("frm.no0"+no);
			var i, imax;
			imax = ele.length;
			for(i = 0 ; i < imax;i++){
				if(ele[i].checked){
					rslt += parseInt(ele[i].value);
					break;
				}
			}
		}
		if(rslt < 5)
		{
			alert('¸ðµÎ ¼±ÅÃÇØ ÁÖ½Ê½Ã¿À.');
			return false;
		} else if(rslt>=5 && rslt<=7) {
			grade = "A";
		} else if(rslt>=8 && rslt<=12){
			grade = "B";
		} else if(rslt>=13 & rslt<=17){
			grade = "C";
		} else {
			grade = "D";
		}
		strUrl = "3_SkincareAdvice_Type"+grade+"_0.asp";
		location.href="setskintype.asp?grade="+grade+"&rurl="+strUrl;
	}
	return false;
}


function SubmitQuiz(frm){
	if(!checkFrm(frm)) return false;
	
	var arrAnswers			= new Array(7)			//The number of questions
	var intAnswerAmount		= 4						//The number of answers for each question
	var strOptionName		= "quiz"				//The name of all the option items in the quiz
													//(the name should be suffixed with an incrementing number 1 to X)
	var intFormPosition		= 1						//Numeric refernce to the form object

	var strAnswer			= ""
	var strCurrentField
	
	//Retrieve answers from option buttons
	for(var x=0; x < arrAnswers.length; x++)
	{		
		strCurrentField = eval("document.frmQuiz." + strOptionName + (x+1))
		
		for(var i=0; i < intAnswerAmount; i++)
		{
			if(strCurrentField[i].checked)
			{
				arrAnswers[x] = parseInt(strCurrentField[i].value);
			}
			else
			{
				if (!arrAnswers[x] > 0)
					arrAnswers[x] = 0;	
			}
		}
	}
	
	var sum  = 0;
	var answercount = 0;
	//Determine which answer was most common
	for(var i=0; i < arrAnswers.length; i++)
	{
		sum = sum + arrAnswers[i];
		
		if (!arrAnswers[i] == 0)
			answercount++;
	}
	
	strAnswer = Math.round(sum / answercount)
	
	var strUrl;
	//chose page based on answer
	/*
	½Å±Ô ÀÛ¾÷ ÆäÀÌÁö´Â ;;
	3_YouveGotStyleQuiz_01Fun.asp
	3_YouveGotStyleQuiz_02Boldly.asp
	3_YouveGotStyleQuiz_02Sensibility.asp
	3_YouveGotStyleQuiz_03chic.asp
	3_YouveGotStyleQuiz_03Pretty.asp
	3_YouveGotStyleQuiz_04Beautiful.asp
	*/
	switch (strAnswer)
	{
		case 1:
			strUrl = "perfectly.asp";
			strUrl = "3_YouveGotStyleQuiz_04Beautiful.asp";
			break;
			
		case 2:
			strUrl = "fabulously.asp";
			strUrl = "3_YouveGotStyleQuiz_02Sensibility.asp";
			break;
		
		case 3:
			strUrl = "boldly.asp";
			strUrl = "3_YouveGotStyleQuiz_02Boldly.asp";
			break;
		
		case 4:
			strUrl = "chic.asp";
			strUrl = "3_YouveGotStyleQuiz_03chic.asp";
			break;
	}
	
	if(answercount == 0)
		alert("º¸±â¸¦ ¼±ÅÃÇØÁÖ¼¼¿ä.");
	else
		document.location = strUrl;
	return false;
}

