function PopupMenuController(viewElement, controlElement, timeToClose) {

	if (viewElement == null)
		alert("viewElement cannot be null ... " + this.getConstructor());
		
	if (controlElement == null)
		alert("controlElement cannot be null ... " + this.getConstructor());
		
	if (timeToClose == null)
		timeToClose = 5000;
		
	this.view = document.getElementById(viewElement);
	this.control = document.getElementById(controlElement);
	this.timeToClose = timeToClose;
	
	this.control.controller = this;
	this.control.onmouseover = function() {this.controller.showView()};
	this.control.onmouseout = function() {this.controller.hideViewDelayed()};
	
	this.showView = function() {
		clearTimeout(this.timeout);
	  this.view.style.visibility = "visible";
	}
	
	this.hideViewDelayed = function() {
	  var thisObj = this;
	  this.timeout = setTimeout(function() {thisObj.hideView()}, this.timeToClose);
	}
	
	this.hideView = function() {
	  this.view.style.visibility = "hidden";
	  clearTimeout(this.timeout);
	}
	
	this.getConstructor = function() {
		alert("PopupController(viewElement, controlElement, timeToClose, triggerType)");
	}
	
}