<!--
function check()
{
	
	j_note = 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 > 50)
	{
		alert('發表的夏日宣言過長');
		window.document.form_q.note.focus();
		return false;		
	}
	
	j_photo = window.document.form_q.photo.value
	if(j_photo == "")
	{
		alert('請上傳夏日妝容');			
		window.document.form_q.photo.focus();
		return false; 	
	}
	
	j_name = window.document.form_q.name.value
	if(j_name == "")
	{
		alert('請輸入姓名');			
		window.document.form_q.name.focus();
		return false; 	
	}

	j_nickname = window.document.form_q.nickname.value
	if(j_nickname == "")
	{
		alert('請輸入暱稱');			
		window.document.form_q.nickname.focus();
		return false; 	
	}
	
	if(chk_check("form_q","gender","性別","2")== 0)
	{
		form_q.gender[0].focus();
		return false;
	}
	
	j_birthYear = window.document.form_q.birthYear.value
	if (j_birthYear=="") 
	{
		alert('請輸入出生年');
		window.document.form_q.birthYear.focus();
		return false;			
	}
	if (j_birthYear !="")  
	{
		if (isNaN(j_birthYear) == true)  
		{
			alert("出生年請輸入數字")
			window.document.form_q.birthYear.focus();
			return false;
		}	     	
	}
	
	j_birthMonth = window.document.form_q.birthMonth.value
	if (j_birthMonth=="") 
	{
		alert('請輸入出生月');
		window.document.form_q.birthMonth.focus();
		return false;	
	}	
	if (j_birthMonth !="")  
		{
		if (isNaN(j_birthMonth) == true)  
		{
			alert("出生月請輸入數字")
			window.document.form_q.birthMonth.focus();
			return false;
		}	     	
	}
	j_birthDay = window.document.form_q.birthDay.value
	if (j_birthDay=="") 
	{
		alert('請輸入出生日');
		window.document.form_q.birthDay.focus();
		return false;		
	}
	if (j_birthDay !="")  
	{
	if (isNaN(j_birthDay) == true)  
		{
			alert("出生日請輸入數字")
			window.document.form_q.birthDay.focus();
			return false;
		}	     	
	}
	if (check_valid_date(j_birthYear,j_birthMonth, j_birthDay) == 1)
	{	
		alert("不正確生日格式")
		window.document.form_q.birthYear.focus();
		return false;
	}
	
	j_phone = window.document.form_q.phone.value
	if(j_phone == "")
	{
		alert('請輸入手機');			
		window.document.form_q.phone.focus();
		return false;  	
	}
	else
	 {
	   if (isNaN(j_phone) == true)  
	    {
	      alert("手機請輸入數字")
	      window.document.form_q.phone.focus();
	      return false;
	    }	
	   }
	
	j_city = document.form_q.city.selectedIndex;
	if (j_city==0)
	{
		alert('請選擇縣市');
		window.document.form_q.city.focus();
		return false;
	}
	
	j_address = window.document.form_q.address.value
	if(j_address == "")
	{
		alert('請輸入地址');			
		window.document.form_q.address.focus();
		return false;  	
	}

	j_email = window.document.form_q.email.value
	if (j_email=="") 
	{
		alert('請輸入電子信箱');
		window.document.form_q.email.focus();
		return false;		
	}
	else 
	{
	//alert("dd");
	
	i = j_email.indexOf("@");
	j = j_email.indexOf(".",i);
	k = j_email.indexOf(",");
	kk = j_email.indexOf(" ");
	jj = j_email.lastIndexOf(".") + 1;
	len = j_email.length;
	if ((i <= 0) || (j <= (i+1)) || (k != -1) || (kk != -1) || (len-jj < 2) || (len-jj > 3))
		{
		alert("您輸入的電子信箱不正確 !");
		window.document.form_q.email.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;	
  
} 

//----------以上為查詢空白字元------------------------------       

//10------------------------------------------------------------------------------------------    
function check_valid_date(yy,mm,dd)
{
  //alert("19"+yy)
  jump_year = ("19"+yy)%4;
 
  //alert(jump_year)    
  if ((dd>31) || (dd<1)) return 1;
  if ((mm>12) || (mm<1)) return 1;
  
  if (dd == 31 && (mm == 2 || mm == 4 || mm == 6 || mm == 9 || mm == 11))
  {
  		return 1;			
  }	
  
  else if (dd == 30 && mm == 2)
  {			
  		return 1;			
  }
  
  else if (dd == 29 && mm == 2 && jump_year != 0)
  {			
  		return 1;
  }
  
  else 
  {
  	return 0;
  }
  
}

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+'！'); return 0;}
	 else return 1;
	 }

-->