﻿function PaperPostCn(){
    var title = $("txtPaperTitle");
    var author1 = $("txtAuthor1");
	var company1 = $("txtCompany1");
	var department1 = $("txtDepartment1");
	var contact1 = $("txtContact1");
	var email1 = $("txtEmail1");
	var subject = $("sSubject");
    var abstract = $("fileAbstract");
    var content = $("fileContent");
    
    if (CheckSpace(title.value)){
        alert("对不起，请填写论文题目！");
        title.focus();
        return false;
    }
    if (CheckSpace(author1.value)){
        alert("对不起，请填写第一作者！");
        author1.focus();
        return false;
    }
    if (CheckSpace(company1.value)){
        alert("对不起，请填写第一作者单位！");
        company1.focus();
        return false;
    }
    if (CheckSpace(department1.value)){
        alert("对不起，请填写第一作者部门！");
        department1.focus();
        return false;
    }
    if (CheckSpace(contact1.value)){
        alert("对不起，请填写第一作者联系方式！");
        contact1.focus();
        return false;
    }
    if (CheckSpace(email1.value)){
        alert("对不起，请填写第一作者E-mail！");
        email1.focus();
        return false;
    }
    if (CheckSpace(subject.value)){
        alert("对不起，请选择论文主题！");
        subject.focus();
        return false;
    }
//    if (CheckSpace(abstract.value)){
//        alert("对不起，请浏览选择摘要文件！");
//        abstract.focus();
//        return false;
//    }
//    if (CheckSpace(content.value)){
//        alert("对不起，请浏览选择论文！");
//        content.focus();
//        return false;
//    }
    if(abstract.value != ""){
        var fileext = abstract.value.substr(abstract.value.length-3,3);
        fileext = fileext.toUpperCase();
        if ((fileext != "DOC") && (fileext != "PDF") && (fileext != "RAR")){                  
            alert("摘要只支持doc,pdf,rar格式的文件！");
            abstract.focus();
            return false;
        }
    }
    if(content.value != ""){
        var fileext = content.value.substr(content.value.length-3,3);
        fileext = fileext.toUpperCase();
        if ((fileext != "DOC") && (fileext != "PDF") && (fileext != "RAR")){                  
            alert("论文只支持doc,pdf,rar格式的文件！");
            content.focus();
            return false;
        }
    }
}


function PaperPostEn(){
    var title = $("txtPaperTitle");
    var author1 = $("txtAuthor1");
	var company1 = $("txtCompany1");
	var department1 = $("txtDepartment1");
	var contact1 = $("txtContact1");
	var email1 = $("txtEmail1");
	var subject = $("sSubject");
    var abstract = $("fileAbstract");
    var content = $("fileContent");
    
    if (CheckSpace(title.value)){
        alert("Sorry,please fill in the paper topic!");
        title.focus();
        return false;
    }
    if (CheckSpace(author1.value)){
        alert("Sorry,please fill the first author!");
        author1.focus();
        return false;
    }
    if (CheckSpace(company1.value)){
        alert("Sorry,please fill the first author's company!");
        company1.focus();
        return false;
    }
    if (CheckSpace(department1.value)){
        alert("Sorry,please fill the first author's department!");
        department1.focus();
        return false;
    }
    if (CheckSpace(contact1.value)){
        alert("Sorry,please fill the first author's contact!");
        contact1.focus();
        return false;
    }
    if (CheckSpace(email1.value)){
        alert("Sorry,please fill the first author's email1!");
        email1.focus();
        return false;
    }
    if (CheckSpace(subject.value)){
        alert("Sorry,please select track!");
        subject.focus();
        return false;
    }
//    if (CheckSpace(abstract.value)){
//        alert("Sorry,please select a file!");
//        abstract.focus();
//        return false;
//    }
//    if (CheckSpace(content.value)){
//        alert("Sorry,select paper!");
//        content.focus();
//        return false;
//    }
    if(abstract.value != ""){
        var fileext = abstract.value.substr(abstract.value.length-3,3);
        fileext = fileext.toUpperCase();
        if ((fileext != "DOC") && (fileext != "PDF") && (fileext != "RAR")){                  
            alert("Only doc, pdf, rar file for abstract!");
            abstract.focus();
            return false;
        }
    }
    if(content.value != ""){
        var fileext = content.value.substr(content.value.length-3,3);
        fileext = fileext.toUpperCase();
        if ((fileext != "DOC") && (fileext != "PDF") && (fileext != "RAR")){                  
            alert("Only doc, pdf, rar file for paper!");
            content.focus();
            return false;
        }
    }
}

function FillMore(obj){
	if(obj.checked){
		$("moreauthor").style.display = "block";
	}
	else{
		$("moreauthor").style.display = "none";
	}
}
