var isInternetExplorer = (navigator.appName.indexOf("Microsoft") != -1); /* future references: var keycode = isInternetExplorer ? event.keyCode : event.which; */ function countSpaces(obj){ var iLength = obj.value.length; var strSpaces = obj.value.match(new RegExp("( )", "g")); var countSpaces = strSpaces ? strSpaces.length : 0; return countSpaces; } function countLineBreaks(obj){ var iLength = obj.value.length; var strLineBreaks = obj.value.match(new RegExp("(\\n)", "g")); var countLineBreaks = strLineBreaks ? strLineBreaks.length : 0; return countLineBreaks; } function textCounter(field, counter_field, maxlimit) { var lineBreaks = countLineBreaks(field); var adjust = isInternetExplorer ? 1 : 0; if (field.value.length - lineBreaks * adjust > maxlimit){ field.value = field.value.substring(0, maxlimit + lineBreaks * adjust); field.focus(); } else { counter_field.value = maxlimit - field.value.length + lineBreaks * adjust; } } function backToSection(backToURL, forceBackToURL){ if(forceBackToURL == null) forceBackToURL = false; if(history.length > 1 && !forceBackToURL) history.back(); else window.location.href = backToURL; } function hideStatus() { window.defaultStatus=''; window.status=''; return true; } function searchReset() { tot = document.search_form.elements.length; for(i=0;i1) { deleteIndex=document.search_form.state_id.options.length-1; document.search_form.state_id.options[deleteIndex]=null; } } if (document.search_form.region_id) { while (document.search_form.region_id.options.length>1) { deleteIndex=document.search_form.region_id.options.length-1; document.search_form.region_id.options[deleteIndex]=null; } } if (document.search_form.city_id) { while (document.search_form.city_id.options.length>1) { deleteIndex=document.search_form.city_id.options.length-1; document.search_form.city_id.options[deleteIndex]=null; } } if (document.search_form.area_id) { while (document.search_form.area_id.options.length>1) { deleteIndex=document.search_form.area_id.options.length-1; document.search_form.area_id.options[deleteIndex]=null; } } } else if (document.search_form.state_id) { if (document.search_form.region_id) { while (document.search_form.region_id.options.length>1) { deleteIndex=document.search_form.region_id.options.length-1; document.search_form.region_id.options[deleteIndex]=null; } } if (document.search_form.city_id) { while (document.search_form.city_id.options.length>1) { deleteIndex=document.search_form.city_id.options.length-1; document.search_form.city_id.options[deleteIndex]=null; } } if (document.search_form.area_id) { while (document.search_form.area_id.options.length>1) { deleteIndex=document.search_form.area_id.options.length-1; document.search_form.area_id.options[deleteIndex]=null; } } } else if (document.search_form.region_id) { if (document.search_form.city_id) { while (document.search_form.city_id.options.length>1) { deleteIndex=document.search_form.city_id.options.length-1; document.search_form.city_id.options[deleteIndex]=null; } } if (document.search_form.area_id) { while (document.search_form.area_id.options.length>1) { deleteIndex=document.search_form.area_id.options.length-1; document.search_form.area_id.options[deleteIndex]=null; } } } else if (document.search_form.city_id) { if (document.search_form.area_id) { while (document.search_form.area_id.options.length>1) { deleteIndex=document.search_form.area_id.options.length-1; document.search_form.area_id.options[deleteIndex]=null; } } } } function $(id) { return document.getElementById(id); } function showText(text) { return unescape(text); }