
/* 
 * fnUpdateFrames('','','','',''); --CONDUIT FUNCTION --
 *
 * This function takes in 5 parameters from calling Javascript functions
 * 
 * -------------
 * PARAMS : -
 * -------------
 * 1) isPopUp - to be provided by the programmer // can only be either true or false. Do not use any single/double quotes when passing this parameter
 * 2) "frameName" - to be provided by the programmer // is the name of the frame that the calling function is located within
 * 3) "applicantRef" - can be extracted from COM Object in .asp page
 * 4) "applicantName" - can be extracted from COM object in .asp page
 * 5) "applicantAddress" - can be extracted from COM Object in .asp page
 * 
 * (note.... the parameters must be provided in the above order)                
 *
 *------------------------ 
 *TEST HARNESS pages : -
 *------------------------
 * The test harness pages all have hard coded parameters put into the calling functions. When using this function, only the first two params
 * of the calling functions require to be hard coded i.e. the isPopUp parameter and the frameName parameter. The following params can be 
 * hardcoded or extracted from the COM object.
 *  
 * defaultFrameName is initialised to 'top'. Only the top frame will be affected by any changes made during this test harness demo.
 * All parameters from this function are then forwarded to an engine function (fnUpdateTopFrame) that performs the task of displaying the new changes.
 * The fnUpdateTopFrame() function is located within the top.html page.
 *
 *
 *  
 *    
*/


function fnUpdateFrames(isPopUp,frameName,applicantRef,applicantName,applicantAddress,externalref)

{
var isPopUp; 
var frameName;
var applicantRef;
var applicantName;
var applicantAddress;
var externalref;

//constant variable declaration
var defaultFrameName = 'top'; //only interested in displaying content in this framename. The 'defaultFrameName' variable can
										//initialised to any framename you are interested in.
										
  if (isPopUp != true && frameName != defaultFrameName)  
  
    {
      window.parent.window.frames(defaultFrameName).fnActivate(applicantRef,applicantAddress,applicantName,externalref);
      return true;
    }

  else if (isPopUp != true && frameName == defaultFrameName) 
    {
	  fnActivate(applicantRef,applicantAddress,applicantName,externalref);
      return true;												 
    }

  else if (isPopUp == true && frameName != defaultFrameName) 
    {
      window.opener.parent.window.frames(defaultFrameName).fnActivate(applicantRef,applicantAddress,applicantName,externalref);
      return true;
    }

  else if (isPopUp == true && frameName == defaultFrameName)
    {  
      window.opener.fnActivate(applicantRef,applicantAddress,applicantName,externalref);
      return true;
    }
}