function CheckSite(){
document.site.fullname.value=document.site.fullname.value.trim();
if(document.site.fullname.value==""){
ShowMessageDialog("提示","网站名称不能为空");
return false;
}
document.article.url.value=document.article.url.value.trim();
document.article.wapurl.value=document.article.wapurl.value.trim();
if(document.article.type.value=="2"){
if(document.article.url.value==""){
ShowMessageDialog("提示","跳转网址不能为空");
return false;
}
if(document.article.wapurl.value==""){
ShowMessageDialog("提示","WAP跳转网址不能为空");
return false;
}
}
document.site.seotitle.value=document.site.seotitle.value.trim();
document.site.seokeywords.value=document.site.seokeywords.value.trim();
if(document.site.seokeywords.length>255){
ShowMessageDialog("提示","SEO关键字不能超过255个字符");
return false;
}
document.site.seodescription.value=document.site.seodescription.value.trim();
if(document.site.seodescription.length>255){
ShowMessageDialog("提示","SEO描述不能超过255个字符");
return false;
}
document.site.trackingcodes.value=document.site.trackingcodes.value.trim();
}

function CheckChannel(){
document.channel.fullname.value=document.channel.fullname.value.trim();
if(document.channel.fullname.value==""){
ShowMessageDialog("提示","频道名称不能为空");
return false;
}
if(document.channel.rootpath.disabled==false){
document.channel.rootpath.value=document.channel.rootpath.value.trim();
if(document.channel.rootpath.value==""){
ShowMessageDialog("提示","根路径不能为空");
return false;
}
if(document.channel.rootpath.value[0]=='/'){
ShowMessageDialog("提示","根路径格式不对,不能以 / 符号开头");
return false;
}
if(document.channel.rootpath.value[document.channel.rootpath.value.length-1]!='/'){
ShowMessageDialog("提示","根路径格式不对,必需以 / 符号结尾");
return false;
}
}
document.channel.url.value=document.channel.url.value.trim();
document.channel.wapurl.value=document.channel.wapurl.value.trim();
document.channel.seotitle.value=document.channel.seotitle.value.trim();
document.channel.seokeywords.value=document.channel.seokeywords.value.trim();
if(document.channel.seokeywords.length>255){
ShowMessageDialog("提示","SEO关键字不能超过255个字符");
return false;
}
document.channel.seodescription.value=document.channel.seodescription.value.trim();
if(document.channel.seodescription.length>255){
ShowMessageDialog("提示","SEO描述不能超过255个字符");
return false;
}
}

function CheckServer(){
document.server.fullname.value=document.server.fullname.value.trim();
document.server.ftphost.value=document.server.ftphost.value.trim();
document.server.ftpusername.value=document.server.ftpusername.value.trim();
document.server.ftppassword.value=document.server.ftppassword.value.trim();
document.server.rootpath.value=document.server.rootpath.value.trim();
document.server.url.value=document.server.url.value.trim();
if(document.server.fullname.value==""){
ShowMessageDialog("提示","文件服务器名称不能为空");
return false;
}
if(document.server.mode.value=="1"){
if(document.server.ftphost.value==""){
ShowMessageDialog("提示","FTP主机不能为空");
return false;
}
if(document.server.ftpusername.value==""){
ShowMessageDialog("提示","FTP账号不能为空");
return false;
}
if(document.server.ftppassword.value==""){
ShowMessageDialog("提示","FTP密码不能为空");
return false;
}
if(document.server.rootpath.value!=""){
if(document.server.rootpath.value[0]=='/'){
ShowMessageDialog("提示","根路径格式不对,不能以 / 符号开头");
return false;
}
if(document.server.rootpath.value[document.server.rootpath.value.length-1]!='/'){
ShowMessageDialog("提示","根路径格式不对,必需以 / 符号结尾");
return false;
}
}
if(document.server.url.value==""){
ShowMessageDialog("提示","根路径对应的网址不能为空");
return false;
}
}
else if(document.server.mode.value=="3"){
if(document.server.rootpath.value!=""){
if(document.server.rootpath.value[0]=='/'){
ShowMessageDialog("提示","根路径格式不对,不能以 / 符号开头");
return false;
}
if(document.server.rootpath.value[document.server.rootpath.value.length-1]!='/'){
ShowMessageDialog("提示","根路径格式不对,必需以 / 符号结尾");
return false;
}
}
if(document.server.url.value==""){
ShowMessageDialog("提示","根路径对应的网址不能为空");
return false;
}
}
}

function ChangeServerMode(obj){
if(obj.value==1){
$("ftphost").style.display="";
$("ftpusername").style.display="";
$("ftppassword").style.display="";
$("url").style.display="";
}
else if(obj.value==2){
$("ftphost").style.display="none";
$("ftpusername").style.display="none";
$("ftppassword").style.display="none";
$("url").style.display="none";
}
else if(obj.value==3){
$("ftphost").style.display="none";
$("ftpusername").style.display="none";
$("ftppassword").style.display="none";
$("url").style.display="";
}
}

function ChangeChannelType(obj){
if(obj.value==1){
$("firstchannelurl").style.display="none";
$("firstinfourl").style.display="none";
$("wapfirstchannelurl").style.display="none";
$("wapfirstinfourl").style.display="none";
}
else{
$("firstchannelurl").style.display="";
$("firstinfourl").style.display="";
$("wapfirstchannelurl").style.display="";
$("wapfirstinfourl").style.display="";
}
}