/* function FNC_getTrim(str){ var start = -1, end = str.length; while (str.charCodeAt(--end) < 33); while (++start < end && str.charCodeAt(start) < 33); return str.slice(start, end + 1); }*/ function FNC_getTrim(stringToTrim) { return stringToTrim.replace(/^\s+|\s+$/g,""); } function FNC_getLTrim(stringToTrim) { return stringToTrim.replace(/^\s+/,""); } function FNC_getRTrim(stringToTrim) { return stringToTrim.replace(/\s+$/,""); } function FNC_getMid(str, start, len) { if (start < 0 || len < 0) return ''; var iEnd, iLen = String(str).length; if (start + len > iLen) iEnd = iLen; else iEnd = start + len; return String(str).substring(start, iEnd); } function FNC_textCounter(field, length) { var text = field.value; text = replace(text,'<','----'); text = replace(text,'>','----'); if (text.length > length) { field.value = field.value.substring(0, length-(text.length-field.value.length)); window.alert('Ud. Ha llegado al máximo Largo de este campo.'); } } function FNC_getIsEnter(event) { var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; if (keyCode == 13) { return true; } else { return false; } } function FNC_getCheckedValue(p_obj) { if(!p_obj) { return ''; } var intLength = p_obj.length; if(intLength == undefined) { if(p_obj.checked) { return p_obj.value; } else { return ''; } } for(var i = 0; i < intLength; i++) { if(p_obj[i].checked) { return p_obj[i].value; } } return ''; } function FNC_getSelectedValue(p_obj) { if(!p_obj) { return ''; } return p_obj[p_obj.selectedIndex].value } function FNC_setSelectedValue(p_obj, p_value) { if(p_obj) { for (var i=0; i < p_obj.length; i++) { if (p_obj[i].value == p_value) { p_obj[i].selected = true; } } } } function FNC_getMultiDimensionalArray(p_intIndexRows,p_intIndexCols) { var i var j var arrNew = new Array(p_intIndexRows) for (i=0; i <= p_intIndexRows; i++) { arrNew[i] = new Array(p_intIndexCols); for (j=0; j <= p_intIndexCols; j++) { arrNew[i][j] = ''; } } return(arrNew); } function replace(string,text,by) { var strLength = string.length, txtLength = text.length; if ((strLength == 0) || (txtLength == 0)) return string; var i = string.indexOf(text); if ((!i) && (text != string.substring(0,txtLength))) return string; if (i == -1) return string; var newstr = string.substring(0,i) + by; if (i+txtLength < strLength) newstr += replace(string.substring(i+txtLength,strLength),text,by); return newstr; } function FNC_getReplaceInvalidChars(p_objField) { var objRegExp = new RegExp('[^\x00-\xFF]', 'g'); p_objField.value = p_objField.value.replace(objRegExp, '?'); } function FNC_getMisspelledEmail(p_strInputValue) { var intResult = 0; if (intResult == 0) { intResult += FNC_getMisspelledEmailDomain(p_strInputValue, 'hotmail.com', '@hotmail.com', '(@otmail.com|@ohtmail.com|@hhotmail.com|@gotmail.com|@jotmail.com|@yotmail.com|@uotmail.com|@botmail.com|@notmail.com|@htmail.com|@htomail.com|@hootmail.com|@hitmail.com|@hptmail.com|@h9tmail.com|@h0tmail.com|@hktmail.com|@hltmail.com|@homail.com|@homtail.com|@hottmail.com|@hormail.com|@hoymail.com|@ho5mail.com|@ho6mail.com|@hofmail.com|@hogmail.com|@hotail.com|@hotamil.com|@hotmmail.com|@hotnail.com|@hotjail.com|@hotkail.com|@hotmil.com|@hotmial.com|@hotmaail.com|@hotmsil.com|@hotmzil.com|@hotmqil.com|@hotmwil.com|@hotmal.com|@hotmali.com|@hotmaiil.com|@hotmaul.com|@hotmaol.com|@hotmajl.com|@hotmakl.com|@hotma8l.com|@hotma9l.com|@hotmai.com|@hotmai.lcom|@hotmaill.com|@hotmaik.com|@hotmaio.com|@hotmaip.com|@hotmailcom|@hotmailc.om|@hotmail..com|@hotmail.om|@hotmail.ocm|@hotmail.ccom|@hotmail.xom|@hotmail.vom|@hotmail.dom|@hotmail.fom|@hotmail.cm|@hotmail.cmo|@hotmail.coom|@hotmail.cim|@hotmail.cpm|@hotmail.c9m|@hotmail.c0m|@hotmail.ckm|@hotmail.clm|@hotmail.co|@hotmail.comm|@hotmail.con|@hotmail.coj|@hotmail.cok)') } if (intResult == 0) { intResult += FNC_getMisspelledEmailDomain(p_strInputValue, 'hotmail', '@hotmail.', '(@otmail.|@ohtmail.|@hhotmail.|@gotmail.|@jotmail.|@yotmail.|@uotmail.|@botmail.|@notmail.|@htmail.|@htomail.|@hootmail.|@hitmail.|@hptmail.|@h9tmail.|@h0tmail.|@hktmail.|@hltmail.|@homail.|@homtail.|@hottmail.|@hormail.|@hoymail.|@ho5mail.|@ho6mail.|@hofmail.|@hogmail.|@hotail.|@hotamil.|@hotmmail.|@hotnail.|@hotjail.|@hotkail.|@hotmil.|@hotmial.|@hotmaail.|@hotmsil.|@hotmzil.|@hotmqil.|@hotmwil.|@hotmal.|@hotmali.|@hotmaiil.|@hotmaul.|@hotmaol.|@hotmajl.|@hotmakl.|@hotma8l.|@hotma9l.|@hotmai.|@hotmaill.|@hotmaik.|@hotmaio.|@hotmaip.)') } if (intResult == 0) { intResult += FNC_getMisspelledEmailDomain(p_strInputValue, 'yahoo.com', '@yahoo.com', '(@ahoo.com|@ayhoo.com|@yyahoo.com|@tahoo.com|@uahoo.com|@6ahoo.com|@7ahoo.com|@gahoo.com|@hahoo.com|@yhoo.com|@yhaoo.com|@yaahoo.com|@yshoo.com|@yzhoo.com|@yqhoo.com|@ywhoo.com|@yaoo.com|@yaoho.com|@yahhoo.com|@yagoo.com|@yajoo.com|@yayoo.com|@yauoo.com|@yaboo.com|@yanoo.com|@yaho.com|@yahoo.com|@yahooo.com|@yahio.com|@yahpo.com|@yah9o.com|@yah0o.com|@yahko.com|@yahlo.com|@yaho.com|@yaho.ocom|@yahooo.com|@yahoi.com|@yahop.com|@yaho9.com|@yaho0.com|@yahok.com|@yahol.com|@yahoocom|@yahooc.om|@yahoo..com|@yahoo.om|@yahoo.ocm|@yahoo.ccom|@yahoo.xom|@yahoo.vom|@yahoo.dom|@yahoo.fom|@yahoo.cm|@yahoo.cmo|@yahoo.coom|@yahoo.cim|@yahoo.cpm|@yahoo.c9m|@yahoo.c0m|@yahoo.ckm|@yahoo.clm|@yahoo.co|@yahoo.comm|@yahoo.con|@yahoo.coj|@yahoo.cok)') } if (intResult == 0) { intResult += FNC_getMisspelledEmailDomain(p_strInputValue, 'yahoo', '@yahoo.', '(@ahoo.|@ayhoo.|@yyahoo.|@tahoo.|@uahoo.|@6ahoo.|@7ahoo.|@gahoo.|@hahoo.|@yhoo.|@yhaoo.|@yaahoo.|@yshoo.|@yzhoo.|@yqhoo.|@ywhoo.|@yaoo.|@yaoho.|@yahhoo.|@yagoo.|@yajoo.|@yayoo.|@yauoo.|@yaboo.|@yanoo.|@yaho.|@yahoo.|@yahooo.|@yahio.|@yahpo.|@yah9o.|@yah0o.|@yahko.|@yahlo.|@yaho.|@yahooo.|@yahoi.|@yahop.|@yaho9.|@yaho0.|@yahok.|@yahol.)') } if (intResult == 0) { intResult += FNC_getMisspelledEmailDomain(p_strInputValue, 'gmail.com', '@gmail.com', '(@mail.com|@mgail.com|@ggmail.com|@fmail.com|@hmail.com|@tmail.com|@ymail.com|@vmail.com|@bmail.com|@gail.com|@gamil.com|@gmmail.com|@gnail.com|@gjail.com|@gkail.com|@gmil.com|@gmial.com|@gmaail.com|@gmsil.com|@gmzil.com|@gmqil.com|@gmwil.com|@gmal.com|@gmali.com|@gmaiil.com|@gmaul.com|@gmaol.com|@gmajl.com|@gmakl.com|@gma8l.com|@gma9l.com|@gmai.com|@gmai.lcom|@gmaill.com|@gmaik.com|@gmaio.com|@gmaip.com|@gmailcom|@gmailc.om|@gmail..com|@gmail.om|@gmail.ocm|@gmail.ccom|@gmail.xom|@gmail.vom|@gmail.dom|@gmail.fom|@gmail.cm|@gmail.cmo|@gmail.coom|@gmail.cim|@gmail.cpm|@gmail.c9m|@gmail.c0m|@gmail.ckm|@gmail.clm|@gmail.co|@gmail.comm|@gmail.con|@gmail.coj|@gmail.cok)') } if (intResult == 0) { intResult += FNC_getMisspelledEmailDomain(p_strInputValue, 'gmail', '@gmail.', '(@mgail.|@ggmail.|@fmail.|@hmail.|@tmail.|@ymail.|@vmail.|@bmail.|@gail.|@gamil.|@gmmail.|@gnail.|@gjail.|@gkail.|@gmil.|@gmial.|@gmaail.|@gmsil.|@gmzil.|@gmqil.|@gmwil.|@gmal.|@gmali.|@gmaiil.|@gmaul.|@gmaol.|@gmajl.|@gmakl.|@gma8l.|@gma9l.|@gmai.|@gmaill.|@gmaik.|@gmaio.|@gmaip.)') } if (intResult == 0) { intResult += FNC_getMisspelledEmailDomain(p_strInputValue, 'live.nl', '@live.nl', '(@ive.nl|@ilve.nl|@llive.nl|@kive.nl|@oive.nl|@pive.nl|@lve.nl|@lvie.nl|@liive.nl|@luve.nl|@love.nl|@ljve.nl|@lkve.nl|@l8ve.nl|@l9ve.nl|@lie.nl|@liev.nl|@livve.nl|@lice.nl|@libe.nl|@life.nl|@lige.nl|@liv.nl|@liv.enl|@livee.nl|@livw.nl|@livr.nl|@livs.nl|@livd.nl|@liv3.nl|@liv4.nl|@livenl|@liven.l|@live..nl|@live.l|@live.ln|@live.nnl|@live.bl|@live.ml|@live.hl|@live.jl|@live.n|@live.nll|@live.nk|@live.no|@live.np)') } if (intResult == 0) { intResult += FNC_getMisspelledEmailDomain(p_strInputValue, 'live', '@live.', '(@ive.|@ilve.|@llive.|@kive.|@oive.|@pive.|@lve.|@lvie.|@liive.|@luve.|@love.|@ljve.|@lkve.|@l8ve.|@l9ve.|@lie.|@liev.|@livve.|@lice.|@libe.|@life.|@lige.|@liv.|@livee.|@livw.|@livr.|@livs.|@livd.|@liv3.|@liv4.)') } if (intResult <= 1) { return true; } else { return false; } } function FNC_getMisspelledEmailDomain(p_strInputValue, p_strDomainCorrect, p_strDomainCorrectCheck, p_strDomainsIncorrectCheck) { var intResult = 0; var strInputValue = FNC_getTrim(p_strInputValue); if (strInputValue.indexOf(p_strDomainCorrectCheck) == -1) { var re = new RegExp('(' + p_strDomainsIncorrectCheck + ')'); if (strInputValue.match(re)) { if (confirm('La dirección de correo electrónico que ud. Ingreso termina en \'' + FNC_getMid(strInputValue, strInputValue.indexOf('@') + 1, 100) + '\'. Este se ve como \'' + p_strDomainCorrect + '\'.\n\nEstá Ud. Seguro que \'' + p_strInputValue + '\' está correcta?')) { intResult = 1; } else { intResult = 2; } } } return intResult; } function createRequestObject() { var req; if (window.XMLHttpRequest) { req = new XMLHttpRequest(); } else if (window.ActiveXObject) { req = new ActiveXObject('Microsoft.XMLHTTP'); } else { alert('Problem creating the XMLHttpRequest object'); } return req; } function FNC_copyToList(from, to) { fromList = eval('document.forms[0].' + from); toList = eval('document.forms[0].' + to); if (toList.options.length > 0 && toList.options[0].value == 'temp') { toList.options.length = 0; } var sel = false; for (i=0;i