/****
 * equalColumns - Sets two CSS columns to have an equal CSS style height
 * @param {String} lCol - Left column
 * @param {String} rCol - Right column
 */
function equalColumns(lCol, rCol){
    l = document.getElementById(lCol);
    r = document.getElementById(rCol);

    height_left = l.style.height;
    height_right = r.style.height;

    if (height_left == '') {
      height_left = l.offsetHeight;
    } else {
      height_left = height_left.replace("px", "");
    }
    if (height_right == '') {
      height_right = r.offsetHeight;
    } else {
      height_right = height_right.replace("px", "");
    }

//    window.alert(lCol + " : " + height_left);
//    window.alert(rCol + " : " + height_right);

    if (height_right > height_left) {
      l.style.height = height_right + "px";
    } else if (height_left > height_right) {
      r.style.height = height_left + "px";
    }

//    window.alert(lCol + " : " + l.offsetHeight);
//    window.alert(rCol + " : " + r.offsetHeight);
}

function equalColumns_offset(lCol, rCol, offset){
    l = document.getElementById(lCol);
    r = document.getElementById(rCol);

    height_left = l.offsetHeight;
    height_right = r.offsetHeight + offset;

//    window.alert(height_left);
//    window.alert(height_right);

    if (height_right > height_left) {
      l.style.height = height_right + "px";
    } else if (height_left > height_right) {
      r.style.height = (height_left - offset) + "px";
    }

/*
    if (r.offsetHeight >= (l.offsetHeight + offset)) { 
      l.style.height = (r.offsetHeight + offset) + "px";
    } else if ((l.offsetHeight - offset) > r.offsetHeight) {
      r.style.height = (l.offsetHeight - offset) + "px";
    } else if (r.offsetHeight <= (l.offsetHeight + offset)) { 
    } else if ((l.offsetHeight - offset) < r.offsetHeight) {
    }
*/
//    window.alert(l.offsetHeight);
//    window.alert(r.offsetHeight);
}  

/****
 * addHeight - adds an offset to the height of a DIV.
 * @param {String} col - column ID
 * @param {int} offset - Offset.
 */
function addHeight(col, offset){
    r = document.getElementById(col);
    r.style.height = (r.offsetHeight + offset) + "px";
//    window.alert(r.offsetHeight);
}  
function subtractHeight(col, offset){
    r = document.getElementById(col);
    r.style.height = (r.offsetHeight - offset) + "px";
//    window.alert(r.offsetHeight);
}  

/****
 * relativeColumns - Sets one CSS columns to a minimum of the CSS style height of another column plus a specified offset.
 * @param {String} rCol - Reference column
 * @param {String} aCol - Adjusted column
 * @param {int} offset - Offset
 */
function relativeColumns(rCol, aCol, offset){
    r = document.getElementById(rCol);
    a = document.getElementById(aCol);
    compHeight = r.offsetHeight + offset;

    if ( compHeight >= a.offsetHeight) {
      a.style.height = compHeight + "px";
    }
}  



<!-- Begin
function emailCheck(emailStr) {
    emailCheck1("Email Address", emailStr)
}

function emailCheck1 (emailName, emailStr) {
    var emailText = "* You must modify the ";
    
    /* It also is used to separate the username from the domain. */
    var emailPat=/^(.+)@(.+)$/
    
    /* Not to allow special characters in the address. */   
    var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
    
    /* These chars aren't allowed in username or domainname. */
    var validChars="\[^\\s" + specialChars + "\]"
    
    /* E.g. "jiminy cricket"@disney.com is a legal e-mail address. */
    var quotedUser="(\"[^\"]*\")"
    
    /* The following pattern applies for domains that are IP addresses,
       rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
       e-mail address. NOTE: The square brackets are required. */
    var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
    
    /* The following string represents an atom (basically a series of
       non-special characters.) */
    var atom=validChars + '+'
    
    /* The following string represents one word in the typical username.
       For example, in john.doe@somewhere.com, john and doe are words.
       Basically, a word is either an atom or quoted string. */
    var word="(" + atom + "|" + quotedUser + ")"
    
    // describes the structure of the user
    var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
    
    var invalidSpace = " "
    
    if(emailStr.indexOf(invalidSpace) > -1) {
      error = error + emailText + emailName + "\n" + "  " + " It should not have spaces.\n"
      return false
    }
    
    /* The following pattern describes the structure of a normal symbolic
       domain, as opposed to ipDomainPat, shown above. */
    var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
    var matchArray=emailStr.match(emailPat)
    if (matchArray==null) {
      	error = error + emailText + emailName + "\n" + "  " + " It is not a valid Email Address.\n"
    	return false
    }
    var user=matchArray[1]
    var domain=matchArray[2]
    
    if (user.match(userPat)==null) {    
        error = error + emailText + emailName + "\n" + "  " + " It is not a valid Email Address.\n"
        return false
    }
    
    /* if the e-mail address is at an IP address (as opposed to a symbolic
       host name) make sure the IP address is valid. */
    var IPArray=domain.match(ipDomainPat)
    if (IPArray!=null) {
        // this is an IP address
    	  for (var i=1;i<=4;i++) {
    	    if (IPArray[i]>255) {
    	        error = error + "* You must modify the " + emailName + "\n" + "  " + " It has an invalid IP address.\n"
    		return false
    	    }
        }
        return true
    }
    
    var domainArray=domain.match(domainPat)
    if (domainArray==null) {
    	error = error + "* You must modify the " + emailName + "\n" + "  " + " It has an invalid domain name.\n"
        return false
    }
    
    
    var atomPat=new RegExp(atom,"g")
    var domArr=domain.match(atomPat)
    var len=domArr.length
    if (domArr[domArr.length-1].length<2 || 
        domArr[domArr.length-1].length>3) {   
       error = error + "* You must modify the "  + emailName + "\n" + "  " + " It must end in a three-letter domain, or two letter country.\n"
       return false
    }
    
    // Make sure there's a host name preceding the domain.
    if (len<2) {
       var errStr = "* You must modify the "  + emailName + "\n" + "  " + " It is missing a hostname.\n" 
       error = error + errStr
       return false
    }
    
    return true;
}
