function vote(VID,obj){
	if(obj)	
		x=obj.vote_item;	
	else
		x=document.frmVote.vote_item;	
	var id = 0;
	if( !isNaN(x.length) ){
		for(var i=0; i< x.length; i++){
			if( x[i].checked ){
				id = x[i].value;
				break;
			}
		}
	}else{
		if(x.checked)
			id = x.value;
	}
	if( id=='' ){
		alert("請選擇投票項目!!");
		return false;
	}		
	xajax_vote(VID,id);
}
 

function resize() {
	if(document.all) {
		document.all['center_block'].style.height=document.body.scrollHeight-420;	
	}
	else {	
		var o=document.getElementById("center_block");
		var base=900;
		
		var height=o.offsetHeight;		
		if(height<900){		
			//resize height if true eq ie false ff
			//if(document.all){o.style.height=base;}	
			o.setAttribute('style','height:'+base+'px');
		}
	}	
}

function checklogin(x)
{
	x.op.value='login';
	if(x.txt_account.value=='') 
	{
		alert('必需輸入帳號');	
		x.txt_account.focus();
		return false;
	}
	else if(x.txt_pwd.value=='') 
	{
		alert('必需輸入密碼');
		x.txt_pwd.focus();
		return false;
	}
	return true;
}
function login_out()
{
	x=document.form_login;
	x.op.value='login_out';
	return true;
}
function checksubmit(x) 
{		
	if(x.email.value == "")
	{
		alert("請填入E-Mail！");
		x.email.focus();
		return false;
	}
	if(!is_email_format(x.email.value))
	{
		alert("E-Mail 格式錯誤!\n\n請輸入正確的E-Mail！");
		x.email.focus();
		return false;
	}	
}
