﻿function changeTab(oA){
	var oAName = oA.getAttribute("name");
	var oAs = document.getElementsByName(oAName);
	for(var i=0; i < oAs.length; i++){
		if(oAs[i].className=="selected" && oAs[i] != oA){
			oAs[i].className="";
			var oDiv = document.getElementById(oAs[i].getAttribute("target"));
			oDiv.style.display="none";
		}	
	}
	oA.className="selected";
	document.getElementById(oA.getAttribute("target")).style.display="";
	return false;
}

//搜索
function hSearch(form){
	if(form.keyWord.value.length < 2 || form.keyWord.value == "搜索：请输入2个以上字符"){
		form.keyWord.value = "搜索：请输入2个以上字符";
		form.keyWord.focus();
		return false;
	}
	return true;
}

//自定义回复样式
function ExportUbbFrame() {
	if(!objActive){objActive="txaArticle"};
	document.write("<p id=\"UbbFrame\" style=\"display:none;height: 100%;\"></p>");
	document.write("<p>");
        document.write("<a title=\" 粗体\"  onmousedown=\"InsertText(objActive,ReplaceText(objActive,'[B]','[/B]'),true);\" style=\"padding:2px;cursor:pointer;\"><img src=\""+str00+"themes/DarkiT/style/img/icons/text_bold.png\" height=\"16\" width=\"16\" border=\"0\" alt=\"粗体\" /></a>  ")
        document.write("<a title=\"斜体\" onmousedown=\"InsertText(objActive,ReplaceText(objActive,'[I]','[/I]'),true);\" style=\"padding:2px;cursor:pointer;\"><img src=\""+str00+"themes/DarkiT/style/img/icons/text_italic.png\" height=\"16\" width=\"16\" border=\"0\" alt=\"斜体\" /></a>  ")
        document.write("<a title=\"下划线\" onmousedown=\"InsertText(objActive,ReplaceText(objActive,'[U]','[/U]'),true);\" style=\"padding:2px;cursor:pointer;\"><img src=\""+str00+"themes/DarkiT/style/img/icons/text_underline.png\" height=\"16\" width=\"16\" border=\"0\" alt=\"下划线\" /></a>  ")
        document.write("<a title=\"删除线\" onmousedown=\"InsertText(objActive,ReplaceText(objActive,'[S]','[/S]'),true);\" style=\"padding:2px;cursor:pointer;\"><img src=\""+str00+"themes/DarkiT/style/img/icons/text_strikethrough.png\" height=\"16\" width=\"16\" border=\"0\" alt=\"删除线\" /></a>  ")
        document.write("<a title=\"链接\"  onmousedown=\"InsertText(objActive,ReplaceText(objActive,'[URL]','[/URL]'),true);\" style=\"padding:2px;cursor:pointer;\"><img src=\""+str00+"themes/DarkiT/style/img/icons/link.png\" height=\"16\" width=\"16\" border=\"0\" alt=\"链接\" /></a>  ")
        document.write("<a title=\"链接2\"  onmousedown=\"InsertText(objActive,ReplaceText(objActive,'[URL=http://]','[/URL]'),true);\" style=\"padding:2px;cursor:pointer;\"><img src=\""+str00+"themes/DarkiT/style/img/icons/link_add.png\" height=\"16\" width=\"16\" border=\"0\" alt=\"链接2\" /></a>  ")
        document.write("<a title=\"Email\"  onmousedown=\"InsertText(objActive,ReplaceText(objActive,'[EMAIL]','[/EMAIL]'),true);\" style=\"padding:2px;cursor:pointer;\"><img src=\""+str00+"themes/DarkiT/style/img/icons/email_add.png\" height=\"16\" width=\"16\" border=\"0\" alt=\"Email\" /></a>  ")
        document.write("<a title=\"引用\"   onmousedown=\"InsertText(objActive,ReplaceText(objActive,'[QUOTE]','[/QUOTE]'),true);\" style=\"padding:2px;cursor:pointer;\"><img src=\""+str00+"themes/DarkiT/style/img/icons/comment.png\" height=\"16\" width=\"16\" border=\"0\" alt=\"引用\" /></a>  ")
        document.write("<a title=\"表情\" style=\"cursor:pointer;text-align:right;\" onclick=\"InsertUbbFace();if(document.getElementById('UbbFrame').style.display=='none'){document.getElementById('UbbFrame').style.display='block';}else{document.getElementById('UbbFrame').style.display='none'};this.style.display='none'\"><img src=\""+str00+"themes/DarkiT/style/img/icons/smile.gif\" border=\"0\" alt=\"表情\" /></a> ")
	document.write("</p>");
}

function mysougoubutton(){                           
if(window.event.ctrlKey && window.event.keyCode==81){            
var n=navigator.userAgent.toLowerCase();ie=n.indexOf('msie')!=-1?1:0;
if(document.documentMode)ie=0;charset='';
if(ie)charset=document.charset;src=ie&&charset=='utf-8'?
'http://web.pinyin.sogou.com/web_ime/init2_utf8.php':
'http://web.pinyin.sogou.com/web_ime/init2.php';
element=document.createElement('script');
element.setAttribute('src',src);
document.body.appendChild(element);     
}}
document.onkeydown=mysougoubutton;                 

function SlyarErrors() { 
	return true;
} 
window.onerror = SlyarErrors;
