// JavaScript Document
function wopen(url){
window.open("../"+url+".php","test","toolbar=no,width=700,height=450,status=no,scrollbars=yes");
}
function clearword(){
 document.getElementById("input").value='';	
}
function textCounter(field,countfield,maxlimit) {
      //定義函數，傳入３個參數，分別為TextArea元素名，文字欄元素名，字數限制
      if (field.value.length > maxlimit) {
        //如果元素區字數大於最大字數，按最大字數截斷
        field.value = field.value.substring(0,maxlimit);
      }
      else {
        //在計數區框內顯示剩餘的字數
		wordlength=maxlimit - field.value.length;
		document.getElementById("remLen1").innerHTML="限140個字，還剩"+wordlength+"個字";
  //      countfield.value = maxlimit - field.value.length;
      }
}

function createXMLHttpRequest(){

	var XMLhttpObject=null;

	try{

		XMLhttpObject=new XMLHttpRequest();

	}catch(e){

		try{

			XMLhttpObject=new ActiveXObject("Msxml12.XMLHTTP");

		}catch(e){

			try{

				XMLhttpObject=new ActiveXObject("Microsoft.XMLHTTP");

			}catch(e){

				return null;

				}
			}
		}
	return XMLhttpObject;
}

