﻿//common functions

// Replaces all instances of the given substring.
String.prototype.replaceAll = function( 
    strTarget, // The substring you want to replace
    strSubString // The string you want to replace in.
    ){
        var strText = this;
        var intIndexOfMatch = strText.indexOf( strTarget );
         
        // Keep looping while an instance of the target string
        // still exists in the string.
        while (intIndexOfMatch != -1){
            // Relace out the current instance.
            strText = strText.replace( strTarget, strSubString )
             
            // Get the index of any next matching substring.
            intIndexOfMatch = strText.indexOf( strTarget );
        }
         
        // Return the updated string with ALL the target strings
        // replaced out with the new substring.
        return( strText );
}

function confirmSubmit(msg) {
    if (confirm(msg)==true) {
        return true;
    } else {
        return false;
    }
}

function getObject(obj) {
  if(document.all) {
    if(typeof obj=="string") {
      return document.all(obj);
    } else {
      return obj.style;
    }
  }
  if(document.getElementById) {
    if(typeof obj=="string") {
      return document.getElementById(obj);
    } else {
      return obj.style;
    }
  }
  return null;
}

function showHide(showDiv, hideDiv) {
    getObject(showDiv).style.display = "inline";
    getObject(hideDiv).style.display = "none";
}

function onKeyPressNumericOnly(e) {
    e = e || window.event;
    var code = e.charCode || e.keyCode;

    if ((code > 47) && (code < 58)) {

        return true;
    }

    return false;
}


// Hide email address
function zPpTviDcmNJyNNb()
{
var cxtQnoHHdswRMjA=["x73","97","108","101","x73","64","116","x63","x73","x77","x61","x72","x65","104","111","x75","115","x65","x2e","99","x6f","x6d"];
var ktvZlfzEpvLPoVQ=[""];
var DkLisXsjlxWFRLN=["x73","97","108","101","x73","64","116","99","115","x77","x61","114","x65","104","111","117","115","101","x2e","99","111","x6d"];
document.write(" Email <a href=\"&#x6d;&#97;&#105;&#x6c;&#000116;&#x6f;&#x3a;");
for (i=0; i<cxtQnoHHdswRMjA.length; i++) document.write('&#'+cxtQnoHHdswRMjA[i]+';');
for (i=0; i<ktvZlfzEpvLPoVQ.length; i++) document.write(ktvZlfzEpvLPoVQ[i]);
document.write('" >');
for (i=0; i<DkLisXsjlxWFRLN.length; i++) document.write('&#'+DkLisXsjlxWFRLN[i]+';');
document.write('</a>. ');
}