/*
  Javascript to validate new applicants. After enterying name
  on Page 1 of application, we query IMIS to see if they aleady
  exists. We do nothing, we just notify the applicant.
  ********************
  Author: Tom Smith
  Version: 1
  Date: 9/28/06
*/

/************
* Functions *
************/

function gE( i ) { return document.getElementById( i ); }
function cE( i ) { return document.createElement( i ); }

function nameLookup(fObj,mObj,lObj) {
  try{
   var sOpt="nameValidate";
   var lName=lObj.value;
   var fName=fObj.value;
   var mName=mObj.value;

   if(fObj && lObj) {
       removeShim();
       buildShim();

       gE( 'eshim' ).src = "previousMember.cfm?lName=" + lName + "&fName=" + fName + "&mName=" + mName;
    }else {
       removeShim();
    }
  }catch(err){};
}

function buildShim(txtObj) {
    if(!gE( 'eshim' )){
      try{

       var eShim = cE( "Iframe" );
       eShim.id = "eshim";      
       eShim.scrolling = "no";
       eShim.frameborder = "0";
       eShim.border = "0";
       eShim.src = "javascript:''";
       eShim.style.backgroundColor="#FFFFFF";
       eShim.style.display='none';
       eShim.style.position = "absolute";
       eShim.style.top = "0";
       eShim.style.left = "0";
       eShim.style.height = "380px";
       eShim.style.width = "380px";

       document.body.appendChild( eShim );
      }catch(err){};
    }
}


function removeShim() {
  try{
   if(gE( 'eshim' ) ) document.body.removeChild( gE( 'eshim' ) );
  }catch(err){};
}
