// for BatchEmail
		function SetReturn(Filename) {
		  document.forms[0].xEmailAttachment.value = Filename;
		}

  
// for DocStatus.asp 
	function DocStatusCheckForm()
	{
	  myform = document.forms[0];
	  if ( (myform.Reviewer1_EdBoardID.selectedIndex == myform.Reviewer2_EdBoardID.selectedIndex) && (myform.Reviewer1_EdBoardID.selectedIndex != 0) ) {
		alert("You must select 2 different reviewers.")
		  myform.Reviewer1_EdBoardID.focus()
		  return false
	  }
	
	  //Make sure the keywords are selected
	  opt = document.forms[0].SelectedKeywords;
	  count=opt.length;
	  for(i=0; i < count;i++) {
			opt.options[i].selected = true;
	  }
	
	  return true
	}
	
	function MoveMultiple(lstSourceList, lstTargetList) {
	  var optTemp,i;
	
	  for ( i=0; i < lstSourceList.options.length; i++) {
		if(lstSourceList.options[i].selected) {
		  optTemp = new Option;
		  optTemp.value = lstSourceList.options[i].value;
		  optTemp.text = lstSourceList.options[i].text;
		  lstTargetList.options[lstTargetList.options.length] = optTemp;
		}
	  }
	  i = 0;
	  while (lstSourceList.options.length > i) {
		if (lstSourceList.options[i].selected) {
		  lstSourceList.options[i] = null;
		  i=0;
		}
		else {
		  i = i + 1;
		}
	  }
	}
	
	function DocStatusCopyComments() {
	  myform = document.forms[0];
	  buffer = myform.Comments1.value + "\n\n" + myform.Comments2.value + "\n\n" + myform.Comments3.value + "\n\n";
	  myform.Comments.value += buffer;
	}
	
	function DeleteConfirm(Number) {
	  if (confirm("Are you sure you want to delete review number " + Number + "?")) {
		return true;
	  } else{
		return false;
	  }
	}

// used by BatchEmail.asp, EmailTemplates.asp 

		function checkForm() {
		  myform = document.forms[0];
			if (myform.xEmailSubject.value == "") {
				alert("Please enter a subject line for the email.");
				myform.xEmailSubject.focus();
				return false;
			}
			if (myform.xEmailBody.value == "") {
				alert("Please enter a text body for the email.");
				myform.xEmailBody.focus();
				return false;
			}
		  return true;
		}




// for upload.asp 

	  function checkUploadForm()
	  {
	    myform = document.forms[0];
	    if (myform.blob.value.length < 1) {
	      alert("You must include the path to your document file.")
	  	  myform.blob.focus()
	  	  return false
	    }
	    return true

	  }
	  function CancelUpload() {
	    if (window.opener && window.opener.document.title == "Batch Email") {
	      window.close();
	    } else {
	      document.location = 'Default.asp';
	    }
	  }

	function validateProfileForm() {
		myform = document.forms[0];
		if (myform.xFirstname.value == "") {
			alert("Please enter your first name.");
			myform.xFirstname.focus();
			return false;
		}
		if (myform.xLastname.value == "") {
		  alert("Please enter your last name.");
		  myform.xLastname.focus();
		  return false;
		}
		if (myform.xEmail.value == "") {
			alert("Please enter your email address.");
			myform.xEmail.focus();
			return false;
		}
		if (myform.xAddr1.value == "")	{
			alert("Please enter your mailing address.");
			myform.xAddr1.focus();
			return false;
		}
		if (myform.xCity.value == "") {
			alert("Please enter the city of your postal address.");
			myform.xCity.focus();
			return false;
		}
		/*
		if (myform.xState.value == "") {
			alert("Please enter the state or province of your postal address.");
			myform.xState.focus();
			return false;
		}
		*/
		if (myform.xZip.value == "") {
			alert("Please enter the zip code of your postal address.");
			myform.xZip.focus();
			return false;
		}
		if (myform.xPassword.value == "") {
			alert("Please enter the password you would like to use when signing on to the site.");
			myform.xPassword.focus();
			return false;
		}
		if (typeof(myform.xKeyword1) != 'undefined') {
		  if ( (myform.xKeyword1.selectedIndex == myform.xKeyword2.selectedIndex) && (myform.xKeyword1.selectedIndex != 0) ) {
			alert("You must select 2 different keywords.")
			myform.xKeyword1.focus()
			return false
		  }
		}
	
		//Make sure the keywords are selected
		opt = document.forms[0].SelectedKeywords;
		count=opt.length;
		for(i=0; i < count;i++) {
			opt.options[i].selected = true;
		}
		return true;
	
	  }
	  
	  function validateReviewForm() {
		  myform = document.forms[0];
			if ( (!myform.xQ1[0].checked) && (!myform.xQ1[1].checked) && (!myform.xQ1[2].checked) && (!myform.xQ1[3].checked) && (!myform.xQ1[4].checked) ) {
				alert("Please complete rating question 1.");
				return false;
			}
			if ( (!myform.xQ2[0].checked) && (!myform.xQ2[1].checked) && (!myform.xQ2[2].checked) && (!myform.xQ2[3].checked) && (!myform.xQ2[4].checked) ) {
				alert("Please complete rating question 2.");
				return false;
			}
			if ( (!myform.xQ3[0].checked) && (!myform.xQ3[1].checked) && (!myform.xQ3[2].checked) && (!myform.xQ3[3].checked) && (!myform.xQ3[4].checked) ) {
				alert("Please complete rating question 3.");
				return false;
			}
			if ( (!myform.xQ4[0].checked) && (!myform.xQ4[1].checked) && (!myform.xQ4[2].checked) && (!myform.xQ4[3].checked) && (!myform.xQ4[4].checked) ) {
				alert("Please complete rating question 4.");
				return false;
			}
			if ( (!myform.xQ5[0].checked) && (!myform.xQ5[1].checked) && (!myform.xQ5[2].checked) && (!myform.xQ5[3].checked) && (!myform.xQ5[4].checked) ) {
				alert("Please complete rating question 5.");
				return false;
			}
			if ( (!myform.xQ6[0].checked) && (!myform.xQ6[1].checked) && (!myform.xQ6[2].checked) && (!myform.xQ6[3].checked) && (!myform.xQ6[4].checked) ) {
				alert("Please complete rating question 6.");
				return false;
			}
			if ( (!myform.xQ7[0].checked) && (!myform.xQ7[1].checked) && (!myform.xQ7[2].checked) && (!myform.xQ7[3].checked) && (!myform.xQ7[4].checked) ) {
				alert("Please complete rating question 7.");
				return false;
			}
			if ( (!myform.xQ8[0].checked) && (!myform.xQ8[1].checked) && (!myform.xQ8[2].checked) && (!myform.xQ8[3].checked) && (!myform.xQ8[4].checked) ) {
				alert("Please complete rating question 8.");
				return false;
			}
			if ( (!myform.xQ9[0].checked) && (!myform.xQ9[1].checked) && (!myform.xQ9[2].checked) && (!myform.xQ9[3].checked) && (!myform.xQ9[4].checked) ) {
				alert("Please complete rating question 9.");
				return false;
			}

			if ( (!myform.xRecommendation[0].checked) && (!myform.xRecommendation[1].checked) && (!myform.xRecommendation[2].checked) && (!myform.xRecommendation[3].checked) ) {
				alert("Please add your recommendation.");
				return false;
			}
			return true;
		}
		
	// used by submission.asp
	function checkSubmissionForm()
	{
	  myform = document.forms[0];
	  if (myform.xTitle.value.length < 2 )	{
		  alert ("You must include the title of your paper.")
		  myform.xTitle.focus()
		  return false
	  }
	  if (myform.xAuthor1.value.length < 1) {
		  alert("You must include the name of the Lead Author.")
		  myform.xAuthor1.focus()
		  return false
	  }
	  if (myform.xEmail1.value.length <1) {
		  alert("You must include the email address of the lead author.")
		  myform.xEmail1.focus()
		  return false
	  }
	  if (myform.xFileOriginal.value.length<1) {
	    alert("You must include the path to your document file.")
		  myform.Document.focus()
		  return false
	  }
	  if (myform.xPublication.selectedIndex== 0)	{
		  alert("You must indicate the publication.")
		  myform.xPublication.focus()
		  return false
	  }

	  //Make sure the keywords are selected
	  opt = document.forms[0].SelectedKeywords;
	  count=opt.length;
	  for(i=0; i < count;i++) {
			opt.options[i].selected = true;
	  }

	  return true
	}
	
	
	//for default.asp
	function HideSubmission(SubmissionID) {
      if (confirm("Are you sure you want to hide this submission from the status page?")) {
        window.location = "Default.asp?Function=Hide&SubmissionID=" + SubmissionID;
      }
    }

    
	//for default.asp
    function DeclineReview(SubmissionID) {
      if (confirm("Are you sure you want to decline to review this submission?")) {
        window.location= "Review.asp?Function=Remove&SubmissionID=" + SubmissionID;
      }
    }