// start of sm_js.cgi file
	
	var spellCheckEnabled=false
	<!--IMAIL.BeginIfUserSpellCheckEnable-->
	
	spellCheckEnabled=true
	
	function vaxSpell()
    { 
	  var dictCheck = "<!--IMAIL.GetDictionaries-->";
	  if(dictCheck=="")
	  {
	    alert(X.NoSplChkForDomain);
		return;
	  }
	  if((document.SendMail.textBody.value == "0") || (document.SendMail.textBody.value.length <= 0))
      {    
        alert(X.NoMsgBodySplChk);       
        return;    
      }
	  
	  document.SendMail.button.value="<!--IMAIL.SpellCheckButton-->";


	  var lex, count = 0;
	  i = document.SendMail.lexicons.selectedIndex;

	  if(i==-1)
      {
	    alert(X.SelDictList);
	    return;
	  }

	  lex = document.SendMail.lexicons.options[i].text;
	  for( i = 0; i < document.SendMail.lexicons.length; i ++ )
      {
        if(document.SendMail.lexicons.options[i].selected == true)
            count++;
      }

      if(count>32)
      {
        alert(X.Only32Dict);
        return;
      }

      document.SendMail.submit();
      return;
    }


   //  This function checks whether the spell checker is in use or not

	var flg_splchk = <!--IMAIL.SpellCheckerOn-->;
	
	function getStatusForSplChkr()
	{
		if(!flg_splchk)
		{
		  document.SendMail.SpellCheckOn.value = 1;
		  <!--IMAIL.BeginSSL-->
            <!--IMAIL.BeginIfSSLEnable-->
			if(confirm(X.SplChkNA))
			{
			  vaxSpell();
			}
			<!--IMAIL.ElseBeginIfSSLEnable-->
			  vaxSpell();
		    <!--IMAIL.EndBeginIfSSLEnable-->
	      <!--IMAIL.ElseBeginSSL-->
		    vaxSpell();
		  <!--IMAIL.EndBeginSSL-->
		}
		else
		{
			alert(X.SplChkInUse);
			flg_splchk = 0;
		}
	}

	function renameDict()
	{
	  if(is_nav3)
	   return;  // Netscape 3.0 does not handle this operate very well

	  // LABEL SP1: ADDING DICTIONARY FILENAMES TO THE LIST
	  // --------------------------------------------------
	  // To add a new dictionary to the list, simply add the filename of the dictionary as an element of
	  // the dictList array.  This can be done by adding another parmeter to the Array function.
	  // Only the filenames listed in the dictList array will be replaced with a descriptive name.
	  
	  var dictList = new Array("UserDict.tlx", "ssceam2.clx", "sscebr2.clx", "accent.tlx", "correct.tlx",
	                           "html.tlx", "ssceam.tlx", "sscebr.tlx", "sscela2.clx", "sscema2.clx",
                             "sscepb2.clx", "sscelb2.clx", "sscemb2.clx", "ssceda2.clx", "sscedu2.clx",
                             "sscefi2.clx", "sscefr2.clx", "sscege2.clx", "ssceit2.clx", "sscenb2.clx",
                             "sscepo2.clx", "sscesp2.clx", "sscesw2.clx");
	  var dictDescript = new Array (dictList.length);
	 
	  var tempStr2;
	  for (var num2=0; num2 < dictList.length; num2++)
	  {
	    tempStr2=dictList[num2];
	    dictList[tempStr2]=num2;
	    dictDescript[num2] = new Array();
	  }

	  // LABEL SP2: RENAMING THE DICTIONARY FILENAMES
	  // --------------------------------------------
	  // At this point, the elements of the dictList are being assigned to a more descriptive name.
	  // Note that only elements defined in the dictList array can be assigned a descriptive name.  To
	  // add a filename as an element of the dictList array, see LABEL SP1: ADDING DICTIONARY FILENAMES TO THE LIST.
	  // To assign a more descriptive name to a new element of the dictList arrary, simply follow the
	  // examples below by placing the filename as an argument for the dictList array with the
	  // dictList array as an argument for the dictDescript array.  Use the Array function to create
	  // a multi-dim array with one element being the descriptive name.
	  
	  dictDescript[dictList["UserDict.tlx"]] = new Array("User Defined Dictionary");
	  dictDescript[dictList["ssceam2.clx"]] = new Array("American English Dictionary (compressed)");
	  dictDescript[dictList["sscebr2.clx"]] = new Array("British English Dictionary (compressed)");
	  dictDescript[dictList["accent.tlx"]] = new Array("Phonetic Dictionary");
	  dictDescript[dictList["correct.tlx"]] = new Array("Commonly Misspelled Words");
	  dictDescript[dictList["html.tlx"]] = new Array("Html Dictionary");
	  dictDescript[dictList["ssceam.tlx"]] = new Array("American English Dictionary");
	  dictDescript[dictList["sscebr.tlx"]] = new Array("British English Dictionary");
    dictDescript[dictList["sscela2.clx"]] = new Array("American Legal Dictionary");
    dictDescript[dictList["sscema2.clx"]] = new Array("American Medical Dictionary");
    dictDescript[dictList["sscepb2.clx"]] = new Array("Brazilian Portuguese Dictionary");
    dictDescript[dictList["sscelb2.clx"]] = new Array("British Legal Dictionary");
    dictDescript[dictList["sscemb2.clx"]] = new Array("British Medical Dictionary");
    dictDescript[dictList["ssceda2.clx"]] = new Array("Danish Dictionary");
    dictDescript[dictList["sscedu2.clx"]] = new Array("Dutch Dictionary");
    dictDescript[dictList["sscefi2.clx"]] = new Array("Finnish Dictionary");
    dictDescript[dictList["sscefr2.clx"]] = new Array("French Dictionary");
    dictDescript[dictList["sscege2.clx"]] = new Array("German Dictionary");
    dictDescript[dictList["ssceit2.clx"]] = new Array("Italian Dictionary");
    dictDescript[dictList["sscenb2.clx"]] = new Array("Norwegian Bokmål Dictionary");
    dictDescript[dictList["sscepo2.clx"]] = new Array("Portuguese Dictionary");
    dictDescript[dictList["sscesp2.clx"]] = new Array("Spanish Dictionary");
    dictDescript[dictList["sscesw2.clx"]] = new Array("Swedish Dictionary");


	  
	  var maxlength;
	  maxlength = document.SendMail.lexicons.options.length;
	  
	  for(var numCount=0; numCount < maxlength; numCount++)
	  {
	    optName = document.SendMail.lexicons.options[numCount].text
		for(var i=0; i < dictList.length; i++)
		{
		  if((optName.search(dictList[i]) != -1))
		  {
			document.SendMail.lexicons.options[numCount].text = dictDescript[i];
			
			// LABEL SP3: AUTOMATICALLY SELECTING A DICTIONARY FILE
			// ----------------------------------------------------
			// To automatically select a dictionary file, include the file's
			// array index in the following IF condition's expression.  This will
			// cause the dictionary to automatically be selected in the list box.
			
			if(i==0||i==1)
			{
			  document.SendMail.lexicons.options[numCount].selected=1;
			}
			break;
		  }
		}
	  }	  
	  return;
	}
	
	
	<!--IMAIL.EndBeginIfUserSpellCheckEnable-->
	

    function showStatus(form)
    {
      if (form.status && form.status.value == 1)
      {
        alert(X.AttFileTooBig);
        return;
      }
      else if ( form.status && form.status.value == 2 )
      {
        alert(X.AttFileNotExist);
        return;
      }
    }

   

    function valsb()
    { 
      var address = "";  
      var sendto = ""
      var sendcc = ""
      var sendbcc = ""
      var j=0, k, n;    
     
      if ((document.SendMail.to.value == "") || (document.SendMail.to.value.length < 3))
      {
        alert(X.ToMinLength);       
        return;    
      } else if (((document.SendMail.sbj.value  == "0") || (document.SendMail.sbj.value.length  <= 0)) &&
                 ((document.SendMail.textBody.value == "0") || (document.SendMail.textBody.value.length <= 0)))  
      {    
        alert(X.NoBlanckSubjBody);       
        return;    
      }   
      <!--IMAIL.BeginAttachmentSupport-->
      	if (document.SendMail.userfile1.value != "")
      	{
      		alert(X.AttAndSend);
      		return;
        }
      <!--IMAIL.EndBeginAttachmentSupport-->
      document.SendMail.button.value="<!--IMAIL.SendButton-->";
			document.SendMail.textBody.value = document.SendMail.textBody.value + document.SendMail.messagetrailer.value
			document.SendMail.textBody.focus();
  		document.SendMail.submit();
      return;
    } //  valsb

    function valsbsave()
    { 
      <!--IMAIL.BeginAttachmentSupport-->
        if ( document.SendMail.userfile1.value != "" )
        {
          alert(x.AttAndSend);
          return;
        }
      <!--IMAIL.EndBeginAttachmentSupport-->
      
      document.SendMail.button.value="<!--IMAIL.SaveButton-->";
      
      document.SendMail.submit();
      return;
    }

    function addattach()
    {
      var ch1;
      
      if (document.SendMail.userfile1.value == "")
      {
        alert(X.EntFileAttName);
        return;
      }
      
      document.SendMail.button.value="<!--IMAIL.AttachButton-->";
      
      document.SendMail.submit();
      return;
    }

    function removeattach()
    {
      var i, myLength, count;
      
      i = document.SendMail.attachlist.selectedIndex;
      
      if (i == -1)
      {  
        alert(X.SelFileName);
        return;
      }
      if (document.SendMail.attachlist.options[0].text == "--No Files Attached--")
      {
        alert(X.NoFilesAtt);
        return;
      }
      
      myLength = document.SendMail.attachlist.length;
      
      for(count = 0;count < myLength;count++)
      {
        if (document.SendMail.attachlist.options[count].selected == true)
          document.SendMail.index.value += count + ',';
      }
      
      document.SendMail.button.value="<!--IMAIL.RemoveButton-->";
      
      document.SendMail.submit();
      return;
    }

 function selectAddresses(myField){
	var myForm = document.SendMail
  var selectObj = myForm.lstAddr;
	var textObj;
	if (myField == "CC"){
		textObj = myForm.cc
		}else{
		if (myField == "BCC"){
			textObj = myForm.bcc
			}else{
			textObj = myForm.to
		}
	}
  selectArray = new Array();
  selectIndex = 0;
  selectString = '';
  selectLength = selectObj.options.length;
  for(i = 0; i < selectLength; i++){
    if(selectObj.options[i].selected && selectObj.options[i].value != ""){
			if(selectObj.options[i].text.charAt(0)=="[")
      {
        var mySelection = new String(selectObj.options[i].value);
		
		// Remove the number from string
	    var index1 = mySelection.search(/\|/);
	    mySelection = mySelection.substring(index1 + 1,mySelection.length);

        mySelection = mySelection.replace(/\</g,"");
        mySelection = mySelection.replace(/\>/g,"");
        selectArray[selectIndex] = mySelection;
      }
      else
      {
        var mySelection = selectObj.options[i].text;
			  var myLastSpace = mySelection.lastIndexOf(" ");
			  mySelection = mySelection.substring(myLastSpace+1,mySelection.length);
        selectArray[selectIndex] = mySelection;
      }
      selectIndex++;
    }
  }
  stringLength = selectArray.length;
  if(stringLength > 0){
    for(j = 0; j < stringLength; j++){
      selectString += (j > 0) ? ',' + selectArray[j] : selectArray[j];
    }
  }
  if (selectString.length + textObj.value.length >= myRecipientFieldLengthLimit){
    		var x = ""
		x+=X.FieldLengthLimit
		var re = /%LengthLimit%/i
		x = x.replace(re,myRecipientFieldLengthLimit)		
		alert(x);
   	}else{
     textObj.value += (textObj.value != '' && selectString != '') ? ',' + selectString : selectString;
     selectObj.selectedIndex=-1;
		 textObj.focus();
   }
}


// end of sm_js.cgi file


