//functions for interacting with the backend

var _wamiHandlers = new Object();

_wamiHandlers.layoutHandler = layoutHandler;
_wamiHandlers.onLoadHandler = onLoadHandler;

function onLoadHandler() {
	// No need to poll, don't have a relay
	stopPolling();
}

function layoutHandler(frameWidth, frameHeight, top, left) {
	//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
    
	//example of position a div: we put the MainWidnow in the "main" window 
	var mainTop = top + 20;
	var mainWidth = frameWidth - 5;
	var mainLeft = 0;
	var mainHeight = frameHeight - top - 20 - 5;

	var loggedInE = document.getElementById("LoggedInDiv");
	if(loggedInE) {
		loggedInE.style.left = _logoImgWidth + 5 + _appletWidth + 5 + "px";
		loggedInE.style.top = "10px";  
	}
	  
	  
	var mainE = document.getElementById("Main");
	if(mainE) {
		mainE.style.left = mainLeft + "px";
		mainE.style.top = mainTop + "px";
		mainE.style.width = mainWidth + "px";
		mainE.style.height = mainHeight + "px";
	}
	
	
}