function HighlightAll(theField) {
var tempval=eval("document."+theField)
tempval.focus()
tempval.select()
therange=tempval.createTextRange()
therange.execCommand("Copy")}
function DoTitle(addTitle) {
var currentTitle = document.form.titles.value;
revisedTitle = currentTitle+addTitle;
document.form.titles.value=revisedTitle;
return; }
var MessageMax="$c_article_max";
var Override="";
function CheckLength(){
MessageLength=document.form.article_content.value.length;
message="";
if(MessageMax !=0) {
message="最大字元為 "+MessageMax+ " 字元";
}else{
messag ="";
}
alert(message+"\\n您的內容已有 "+MessageLength+" 字元");
}
function ValidateForm(){

usernameLength=document.form.u_username.value.length;
if(usernameLength<1){alert("請輸入會員名稱!");return false;}
passwordLength=document.form.u_password.value.length;
if(passwordLength<1){alert("請輸入會員密碼!");return false;}
titlesLength=document.form.titles.value.length;

MessageLength =document.form.article_content.value.length;
errors="";
if(MessageLength<0){
errors="文章內容不能小於2個字元！";
}
if(MessageMax !=0){
if(MessageLength > MessageMax){
errors="本論壇限制文章長度不得超過 "+MessageMax+" 字元\\n目前您的文章字元數: "+MessageLength;
}
}
if(errors != "" && Override == ""){
alert(errors);
return false;
}else{
document.form.submit1.disabled = true;
return true;
}
}
function emoticon(theSmilie){
document.form.article_content.value += theSmilie + ' ';
document.form.article_content.focus();
}
var i=0;
function presskey(eventobject){if(event.ctrlKey && window.event.keyCode==13){i++;if (i>1) {alert('文章正在發出，請耐心等待！');return false;}this.document.form.submit();}}

function bb_img_onmousewheel(o){
	var zoom = parseInt(o.style.zoom, 10) || 100;

	zoom += event.wheelDelta / 12;
	if (zoom > 0) o.style.zoom = zoom + '%';

	return false;
}
