<!--
	
function evaluate_check()
{
	j_skin_check = checkSpace(window.document.form_q.skin_check.value)
	if (j_skin_check < 0)
	{			
		j_skin_no = checkSpace(window.document.form_q.skin_count.value)
		if(!chk_check("form_q","skin","膚質填寫",j_skin_no)) return false;
	}
		
	j_estimate_no = checkSpace(window.document.form_q.estimate.value)
	var i = 1;
	for (i = 1; i <= j_estimate_no; i++)
	{
		if ( check_radio("form_q", "q", i, "10") == 0 )
		{	
			alert("請評鑑問題"+i);
			eval('window.document.form_q.q_'+ i +'[0].focus();');			
			return false;	
		}
	}
	
	if(chk_check("form_q","total","整體評鑑","10") == 0)
	{
		form_q.total[0].focus();
		return false;
	}	
	
	j_note = checkSpace(window.document.form_q.note.value)
	if ( j_note == "" )
	{
		alert("請輸入評鑑心得");
		window.document.form_q.note.focus();
		return false;				
	}
	
	l_note = window.document.form_q.note.value.length
	if (l_note > 500)
	{
		alert('評鑑心得過長(500字)');
		window.document.form_q.note.focus();
		return false;		
	}			
}

function checkSpace(UI) 
{
	//alert(UI);
	var str = UI;	
	str = str.replace(/^[\s　]+/g, "");	// 刪除頭部的空白字串
	str = str.replace(/[\s　]+$/g, "");	// 刪除尾部的空白字串
	str = str.replace(/[\s　]+/g, " ");	// 將其他空白字串帶換成單一半形空格
	//UI.value = str;
	return str;	
}

function check_radio(form, name, no, c)
{				
	var chk_no = 0;	
	for ( i = 0; i < c ; i ++)
	{			
		if ( eval('window.document.' + form + '.elements.' + name + '_'+ no +'['+ i +'].checked') == true )
		{
			chk_no += 1;
		}				
	}
	//alert(chk_no);
	return chk_no;
	
}

function chk_check(x, y, z, c) { //核取類選項的確認, c為CheckBox的個數
	var i, chk_no = 0;	
	for (i = 0; i < c; i++) {if (document[x].elements[y][i].checked == true) chk_no += 1;}
	if (chk_no == 0) 
	{ 
		alert('請選取「'+z+'」！'); 
		document[x].elements[y][0].focus();
		return 0;
	}
	else return 1;
}

-->
