function layoutHandler(frameWidth, frameHeight, topHeight, statusHeight) {
  //Any app-specific layout goes here, you should be prepared to resize any part of your app
  //on application intialization and when the window is resized
  
   setTableWidth(frameWidth);
  
   //var appletTop = topHeight + topHeight + statusHeight + 10;
   appletTop = topHeight;
  
   var cqeWidth = 450;
   var galaxyHTMLWidth = Math.max(frameWidth - cqeWidth, 500); 
   //var cqeTop = topHeight + topHeight + statusHeight + 10;
   var cqeTop = appletTop + _appletHeight;
   var cqeHeight = frameHeight - topHeight - statusHeight - topHeight - 5;
  
   var statusBarE = document.getElementById("StatusBar");
   if (statusBarE) {
    statusBarE.style.visibility = "hidden";
    statusBarE.style.display = "none";
   }
   
   var conversationE = document.getElementById("conversation");
   if (conversationE) {
    var logoWidth = 450;
    var conversationWidth = Math.max(frameWidth - logoWidth, 500);
    var conversationHeight = topHeight - 10;
    conversationE.style.top = "0px";
    conversationE.style.left = logoWidth + "px";
    conversationE.style.width = conversationWidth + "px";
    conversationE.style.height = conversationHeight + "px";
    //conversationE.style.visibility = "hidden";
    //conversationE.style.display = "none";
   }
   
   var nlInteractionE = document.getElementById("nlInteraction");
   if (nlInteractionE) {
   		nlInteractionE.style.top = "75px";
   		nlInteractionE.style.left = "950px";
   		nlInteractionE.style.zIndex = 30;
   }
   
   if (_iPhone){
	   document.getElementById("RecResults").style.display = 'none';
	   document.getElementById("nlInteraction").style.display = 'none';
   }
  
   var currentQueryE = document.getElementById("currentQuery");
   if(currentQueryE) {  
    currentQueryE.style.top = cqeTop + "px";
    currentQueryE.style.left = "0" + "px";
    if (_iPhone) {
    	currentQueryE.style.top = cqeTop - 180 + "px";
    	currentQueryE.style.left = '15px';
    	currentQueryE.style.width = '410px';
    	}
    else{
    	currentQueryE.style.width = cqeWidth + "px";
    }
    
    
    currentQueryE.style.height = frameHeight + "px";
  }

/*  
  var galaxyHTMLE = document.getElementById("galaxyHTML");
  if(galaxyHTMLE) {
  	galaxyHTMLE.style.left = cqeWidth + "px";
  	galaxyHTMLE.style.width = galaxyHTMLWidth + "px";
  }
*/
  
  // not using galaxyHTML anymore, make size 0
  // i need to remove this eventually
  var galaxyHTMLE = document.getElementById("galaxyHTML");
  if(galaxyHTMLE) {
  	galaxyHTMLE.style.height = 0 + "px";
  	galaxyHTMLE.style.width = 0 + "px";
  }
  
  var appletE = document.getElementById("AppletDiv");
  if (appletE) {
  	appletE.style.top = appletTop + "px";
  	appletE.style.left = 0 + "px";
  	appletE.style.zIndex = 1;
  	// If iPhone, size of div should be zero so it doesn't catch
  	// mouseovers intended for other items.
  	if (_iPhone){
  		appletE.style.height = 0 + "px";
  		appletE.style.width = 0 + "px";
  	}
  }
  
  /* not using this
  var appletHideE = document.getElementById("appletHide");
  if (appletHideE) {
  	appletHideE.style.top = appletTop + "px";
  	appletHideE.style.left = 0 + "px";
  	var appletHideHeight = _appletHeight + 100; 
  	appletHideE.style.height = appletHideHeight + "px";
  	var appletHideWidth = _appletWidth + 100;
  	appletHideE.style.width = appletHideWidth + "px";
  	appletHideE.style.zIndex = 2;
  	alert(appletHideE.style.zIndex);
  }
  */
  
  var flightDisplayE = document.getElementById("flightDisplay");
  if(flightDisplayE) {
  	
  	if (_iPhone){

  		flightDisplayE.style.top = 115 + "px";
  		flightDisplayE.style.left = 15 + "px";
  		flightDisplayE.style.width = 400 + "px";
  	}
  	else{
  		flightDisplayE.style.top = appletTop + "px";
	  	flightDisplayE.style.left = cqeWidth + "px";
	  	flightDisplayE.style.width = galaxyHTMLWidth + "px";
  	}
  	flightDisplayE.style.height = frameHeight + "px";
  }
  
  var itineraryDisplayE = document.getElementById("itineraryDisplay");
  if (itineraryDisplayE) {
  	var itineraryDisplayTop;	
  	if (document.getElementById("formTable").style.visibility == "hidden") {
  		itineraryDisplayTop = cqeTop;
  	} else {
  		itineraryDisplayTop = cqeTop + 190;
  	}
  	if (_iPhone){
  		//itineraryDisplayE.style.display = 'none';
  		itineraryDisplayTop = cqeTop + 20;
  	}
  	itineraryDisplayE.style.top = itineraryDisplayTop + "px";
  	itineraryDisplayE.style.left = 18 + "px";
  	if (_iPhone){
  	  	itineraryDisplayE.style.width = "400px";

  	}
  	else{
  	  	itineraryDisplayE.style.width = cqeWidth + "px";

  	}
  	itineraryDisplayE.style.height = 0 + "px";
  }
  
  var helpBoxE = document.getElementById("helpBox");
  if (helpBoxE) {
  	helpBoxE.style.top = "75px";
  	helpBoxE.style.left = "325px";
  	helpBoxE.style.height = "450px";
  	helpBoxE.style.width = "650px";
  	helpBoxE.style.zIndex = 30;
  	helpBoxE.style.backgroundColor = "#fff";
  }
  
  var taskBoxE = document.getElementById("taskBox");
  if (taskBoxE) {
  	taskBoxE.style.top = "175px"
  	taskBoxE.style.left = "425px";
  	//taskBoxE.style.height = "250px";
  	taskBoxE.style.width = "450px";
  	taskBoxE.style.zIndex = 29;
  	taskBoxE.style.backgroundColor = "#fff"; 	
  }
  
  var taskButtonDivE = document.getElementById("taskButtonDiv");
  if (taskButtonDivE) {
  	taskButtonDivE.style.top = "125px";
  	taskButtonDivE.style.left = "280px";
  }
  
  var historyRevisionDivE = document.getElementById("historyRevisionDiv");
  if (historyRevisionDivE) {
  	historyRevisionDivE.style.top = "110px";
  	if (_iPhone) {historyRevisionDivE.style.left = "10px"}
  	else historyRevisionDivE.style.left = "265px";
  }

}