// - - - - M A I N - - - - //
	function increase(){
		var obj = eval(document.getElementById("frame"));
		obj.height = Math.floor(obj.height) + 10;
	}
	function decrease(){
		var obj = eval(document.getElementById("frame"));
		obj.height = Math.floor(obj.height) - 10;
	}

// - - - - B L O G - - - - //
	function show_reply( no ){
		var obj = eval(document.getElementById("reply_" + no));
		if( obj.style.display == 'block' ){
			obj.style.display = 'none';
		}
		else{
			obj.style.display = 'block';
			var XMLHttp = StartRequest();
			XMLHttp.onreadystatechange = function(){ Text_callback( XMLHttp, obj ); };
			XMLHttp.open( 'GET', "?com=blog&act=show_reply&no=" + no, true );
			XMLHttp.setRequestHeader( "If-Modified-Since", "0" );
			XMLHttp.send( null );
		}
	}
	function send_reply( no ){
		if( getLength( document.getElementById("reply_name_" + no).value ) < 1 ){
			alert( "請填寫您的名字" ); return false;
		}
		if( getLength( document.getElementById("reply_name_" + no).value ) > 30 ){
			alert( "您的名字太長" ); return false;
		}
		if( getLength( document.getElementById("reply_pswd_" + no).value ) > 20 ){
			alert( "您的密碼太長" ); return false;
		}
		if( getLength( document.getElementById("verify_code_" + no).value ) == 0 ){
			alert( "請輸入驗證碼" ); return false;
		}
		if( getLength( document.getElementById("reply_content_" + no).value ) < 10 ){
			alert( "請充實您的文章" ); return false;
		}
		document.getElementById("error_msg_" + no).innerHTML = 'Please wait...';
		document.getElementById("send_button_" + no).disabled = true;
		var packet  = "reply_name=" + encodeURIComponent( document.getElementById( "reply_name_" + no ).value ) +
					  "&reply_pswd=" + encodeURIComponent( document.getElementById( "reply_pswd_" + no ).value ) +
					  "&verify_code=" + encodeURIComponent( document.getElementById( "verify_code_" + no ).value ) +
					  "&reply_secret=" + document.getElementById( "reply_secret_" + no ).checked +
					  "&reply_content=" + encodeURIComponent( document.getElementById( "reply_content_" + no ).value );
		var XMLHttp = StartRequest();
		XMLHttp.onreadystatechange = function(){ Text_callback( XMLHttp, document.getElementById("reply_" + no) ) };
		XMLHttp.open( 'POST', "?com=blog&act=post_reply&no=" + no, true );
		XMLHttp.setRequestHeader( "Content-type", "application/x-www-form-urlencode;" );
		XMLHttp.send( packet );
	}
	function view_secret( no ){
		var packet  = "pswd=" + encodeURIComponent( document.getElementById( "pswd_" + no ).value );
		document.getElementById( "blog_content_" + no ).innerHTML += '<br />Check Password...';
		var XMLHttp = StartRequest();
		XMLHttp.onreadystatechange = function(){ Text_callback( XMLHttp, document.getElementById("blog_content_" + no) ) };
		XMLHttp.open( 'POST', "?com=blog&act=view_secret&no=" + no, true );
		XMLHttp.setRequestHeader( "Content-type", "application/x-www-form-urlencode;" );
		XMLHttp.send( packet );
	}

// - - - - A J A X - - - - //
	function StartRequest () {
		var XMLHttp = false;
		if ( window.XMLHttpRequest ) { // Mozilla, Safari,...
			XMLHttp = new XMLHttpRequest();
		}
		else if ( window.ActiveXObject ) { // IE
			try { //IE7
				XMLHttp = new ActiveXObject( "Msxml2.XMLHTTP" );
			}
			catch (e) {
				try {
					XMLHttp = new ActiveXObject( "Microsoft.XMLHTTP" );
				} catch (e) {}
			}
		}
		if ( !XMLHttp ) {
			alert( "- - - E r r o r - - -\nCannot create an XMLHTTP object" );
			return false;
		}
		return XMLHttp;
	}
	function Text_callback( XMLHttp, obj ){
		if (XMLHttp.readyState == 4) {
			if (XMLHttp.status == 200) {
				var response = XMLHttp.responseText;
				obj.innerHTML = response;
			}
		}
	}


// - - - L I B - - - //
	function getLength(str_to_count) { // Source from google
		var countMe = str_to_count;
		var escapedStr = encodeURI(countMe);
		if (escapedStr.indexOf("%") != -1) {
			var count = escapedStr.split("%").length - 1;
			if (count == 0) count++;
			var tmp = escapedStr.length - (count * 3);
			count = count + tmp;
		}
		else {
			count = escapedStr.length;
		}
		return count;
	}
