function openXCodes(url, width, height) {
        var Win = window.open(url,"openWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=no,status=no' );
}

function openSmilies(url, width, height) {
        var Win = window.open(url,"openWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=no,status=no' );
}

function AddText(NewCode) {
document.GuestbookPost.comment.value+=NewCode
}

function mail() {
	txt2=prompt("Email显示的名称：\n（直接显示Email地址请留空）","");
	if (txt2!=null) {
		txt=prompt("Enter the e-mail address you wish to use:","name@domain.com");
		if (txt!=null) {
			if (txt2=="") {
				AddTxt="[email]"+txt+"[/email]";
			} else {
				AddTxt="[email="+txt+"]"+txt2+"[/email]";
			}
			AddText(AddTxt);
		}
	}
}

function bold() {
	txt=prompt("输入您要加粗的文本：","请您输入文本");
	if (txt!=null) {
		AddTxt="[b]"+txt+"[/b]";
		AddText(AddTxt);
	}
}

function italicize() {
	txt=prompt("输入您要倾斜的文本：","请您输入文本");
	if (txt!=null) {
		AddTxt="[i]"+txt+"[/i]";
		AddText(AddTxt);
	}
}

function quote() {
	txt=prompt("输入您要引用的文本：","请您输入文本");
	if(txt!=null) {
		AddTxt="[quote]"+txt+"[/quote]";
		AddText(AddTxt);
	}
}

function center() {
	txt=prompt("输入您要居中的文本","请您输入文本");
	if (txt!=null) {
		AddTxt="[center]"+txt+"[/center]";
		AddText(AddTxt);
	}
}

function hyperlink() {
	txt2=prompt("链接显示的名称：\n（直接显示链接地址请留空）","");
	if (txt2!=null) {
		txt=prompt("输入链接地址","http://");
		if (txt!=null) {
			if (txt2=="") {
				AddTxt="[url]"+txt+"[/url]";
				AddText(AddTxt);
			} else {
				AddTxt="[url="+txt+"]"+txt2+"[/url]";
				AddText(AddTxt);
			}
		}
	}
}

function underline() {
	txt=prompt("输入您要加下划线的文本","请您输入文本");
	if (txt!=null) {
		AddTxt="[u]"+txt+"[/u]";
		AddText(AddTxt);
	}
}