/*Smart Page (S) Scripted by FairyFar*/

function show_image(skin) {
//注册表单显示头像
document.images.smartpage_faceimg.src="skin/"+skin+"/comment/face/"+document.smartpage_wform.smartpage_face.options[document.smartpage_wform.smartpage_face.selectedIndex].value+".gif";
}

function Trim() {
//过滤字符串两端空格
return this.replace(/\s+$|^\s+/g,"");
}
String.prototype.Trim=Trim;

function show_jllogo(uppath) {
//加入友情链接表单Logo
var logopath=document.smartp_wform.smartp_jllogo.value.Trim();
if (logopath=="" || logopath=="http://") {
document.images.smartp_jllogoimg.src=uppath+"/smartpage_setting/def_link.gif";
}
else {
document.images.smartp_jllogoimg.src=logopath;
}
}

function check_form_comment(){
//检测评论留言表单
if (document.smartpage_wform.smartpage_name.value.Trim()==""){
	alert("姓名不得为空！");
	return false;
}
if (document.smartpage_wform.smartpage_text.value.Trim()==""){
	alert("内容不得为空！");
	return false;
}
if (document.smartpage_wform.smartpage_checkcode.value.Trim()==""){
	alert("请填写验证码！");
	return false;
}
}

function check_form_join_link(){
//检测加入友情链接表单
if (document.smartp_wform.smartp_jlname.value.Trim()==""){
	alert("链接名称不得为空！");
	return false;
}
var jldomain=document.smartp_wform.smartp_jldomain.value.Trim();
if (jldomain=="" || jldomain=="http://"){
	alert("域名或IP地址无效！");
	return false;
}
if (document.smartp_wform.smartp_jltext.value.Trim()==""){
	alert("简要介绍不得为空！");
	return false;
}
if (document.smartp_wform.smartp_jlcheckcode.value.Trim()==""){
	alert("请填写验证码！");
	return false;
}
}
