﻿//function showHideAdditionalComments(sourceOfApplicantID, additionalCommentsRowID, additionalCommentsID, txtCommentsID, requiredAddCommID) {
//  var sourceOfApplicant;
//  var additionalComments;
//  var sourceOfApplicantValues;
//  var additionalCommentsRow;
//  var txtComments;
//  var chosen;
//  var i;

//  sourceOfApplicant = document.getElementById(sourceOfApplicantID);
//  additionalComments = document.getElementById(additionalCommentsID);
//  additionalCommentsRow = document.getElementById(additionalCommentsRowID);
//  txtComments = document.getElementById(txtCommentsID);
//  requiredAddComm = document.getElementById(requiredAddCommID);
//  len = sourceOfApplicant.length;
//  i = 0;
//  chosen = "none";

//  //get the value of the selected item
//  for (i = 0; i < len; i++) {
//      if (sourceOfApplicant[i].selected) {
//          chosen = sourceOfApplicant[i].value;
//      }
//  }

//  sourceOfApplicantValues = chosen.split("|");
//  if (sourceOfApplicantValues[1] == '1') {
//      additionalCommentsRow.style.visibility = 'visible';
//      additionalComments.innerHTML =  sourceOfApplicantValues[2];
//     // ValidatorEnable(requiredAddComm, true);
//  }
//  else {
//      txtComments.value = '';

//      additionalCommentsRow.style.visibility = 'hidden';
//     
//      //ValidatorEnable(requiredAddComm, false);
//     
//  }
//}
function displayStatusMsg(msgStr) {
    status = msgStr;
    document.returnValue = true;
}
function clearstatus() {
    window.status = "";
}
//this function will remove html tags - mail used for
function removeHTMLTags(txtAreaID) {
    
    if (document.getElementById && document.getElementById(txtAreaID)) {
        var textArea = document.getElementById(txtAreaID)
        var strInputCode = textArea.value;
//        /* 
//        This line is optional, it replaces escaped brackets with real ones, 
//        i.e. < is replaced with < and > is replaced with >
//        */
//        strInputCode = strInputCode.replace(/&(lt|gt);/g, function(strMatch, p1) {
//            return (p1 == "lt") ? "<" : ">";
//        });
//        var strTagStrippedText = strInputCode.replace(/<\/?[^>]+(>|$)/g, "");

var strTagStrippedText = strInputCode.replace(/<.*?>/g,'');

        textArea.value = strTagStrippedText;	
//        // Use the alert below if you want to show the input and the output text
       // alert("Input code:\n" + strInputCode + "\n\nOutput text:\n" + strTagStrippedText);	
    }
}
	
//function ismaxlength(obj){
//        var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
//        if (obj.getAttribute && obj.value.length>mlength)
//        {
//            obj.value=obj.value.substring(0,mlength)
//            alert('Your Resume character string is too long)');
//        }
//}
function maxLength(field)
 {
  
    // var  h=field.value.length;
       if(field.value.replace(/[\n\r\n]+/g, '').length > 50000) {
         //event.returnValue=false;
          // alert(field.value.replace(/[\n\r\n]+/g, '').length);
          alert( "Your résumé entry has exceeded the space allowance.\n\r Please limit your résumé to 50,000 characters or less (including spaces) and paste it again.");
          field.value = "";
          return false;
       }
//       else 
//       {
//       alert(h +"  " +maxChars);
//       }

 }  
function maxLength2(field)
 {
  
    // var  h=field.value.length;
       if(field.value.replace(/[\n\r\n]+/g, '').length > 50000) {
         //event.returnValue=false;
          // alert(field.value.replace(/[\n\r\n]+/g, '').length);
          alert( "222Your résumé entry has exceeded the space allowance.\n\r Please limit your résumé to 50,000 characters or less (including spaces) and paste it again.");
          field.value = "";
          return false;
       }
//       else 
//       {
//       alert(h +"  " +maxChars);
//       }

 }  
 function maxLengthPaste(field)
 {
      
   // event.returnValue=false;
     
       if((field.value.replace(/[\n\r\n]+/g, '').length +  window.clipboardData.getData("Text").replace(/[\n\r\n]+/g, '').length) > 50000) {
         // alert(field.value.replace(/[\n\r\n]+/g, '').length +"   "+window.clipboardData.getData("Text").replace(/[\n\r\n]+/g, '').length);
		  alert("Your résumé entry has exceeded the space allowance.\n\rPlease limit your résumé to 50,000 characters or less (including spaces) and paste it again.");
		  field.value = "";
         return false;
       }
		
      // event.returnValue=true;

 }
// function stopEvent(e) {
//	if(!e) var e = window.event;
//	
//	//e.cancelBubble is supported by IE - this will kill the bubbling process.
//	e.cancelBubble = true;
//	e.returnValue = false;

//	//e.stopPropagation works only in Firefox.
//	if (e.stopPropagation) {
//		e.stopPropagation();
//		e.preventDefault();
//	}
//	return false;
//}

String.prototype.charCount = function () {return this.replace(/[\n\r\n]+/g, '').length}
     


 

