function ap_getObj(name) {
	if (document.getElementById(name)) {
		return document.getElementById(name).style;
/*
	} else if (document.all) {
		return document.all[name].style; */
	} else if (document.layers) {
		return document.layers[name];
	} 
	else return false;
}

function fc_myhead() {
document.write("<span id=\"bg_myhead\" onmouseover=\"ap_showWaitMessage('bg_myhead_text', 1);\" onmouseout=\"ap_showWaitMessage('bg_myhead_text', 0);\" title=\"表姐贈製形象人頭一枚\"><span class=\"hide\">MyHead</span></span>");
}

function ap_showWaitMessage(div,flag)  {
	var isDHTML = (document.getElementById || document.all || document.layers);
	if (!isDHTML) return;
	var x = ap_getObj(div);
	x.visibility = (flag) ? 'visible':'hidden'
	if (!document.getElementById)
		if (document.layers) x.right=280/2;
			return true;
}
	OnTimer = setTimeout("ap_showWaitMessage('bg_myhead_text', 1)",1*500);
	OffTimer = setTimeout("ap_showWaitMessage('bg_myhead_text', 0)",15*1000);


/*
function index_link() {
document.write("<a id=\"index_link\" href=\"/\" title=\"返回首頁\"><h1 class=\"hide\">Kai@Orz.tw</h1></a>");
}
*/
function check_comment() {
if (document.forms[0].author.value == "") {
alert("敬請輸入「姓名」！");
document.forms[0].author.focus();
return false;
} else if (document.forms[0].email.value == "") {
alert("敬請輸入「電子郵件」！");
document.forms[0].email.focus();
return false;
} else if (document.forms[0].comment.value == "請在此輸入") {
alert("敬請輸入「回應內容」！");
document.forms[0].comment.focus();
return false;
}
}

function externalLinks() {
	if (!document.getElementsByTagName) {
		return;
	}
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
			anchor.target = "_blank";
		}
	}
}
//window.onload = externalLinks;

window.onload = function() {
  if(!NiftyCheck()) {
    return;
  }
  externalLinks();
  Rounded("span.corners","tr bl","#e5e5e5","#dee6be","border");
}

function nosidebar() {
  document.getElementById('content').style.width = '95%';
  document.getElementById('sidebar').style.display = 'none';
  document.getElementById('kblog').style.background = '#e5e5e5';
  document.getElementById('nosidebar').style.display = 'none';
}