// JavaScript Document
/**simple class to print warnings, errors and info to user
* inputContainerId - id of container witch will be used to display message
* inputInfoClass, inputWarningClass, inputErrorClass - name of css class, for styling particular kind of message
*/

function W2b_Popup(inputContainerId, inputInfoClass, inputWarningClass, inputErrorClass){
	var containerId = inputContainerId;
	var infoClass = inputInfoClass
	var warningClass = inputWarningClass;
	var errorClass = inputErrorClass
	
	this.show = show;
	/**
	* show message
	* message - message to display
	* type - type of popup info, warnign, popup
	*/
	function show(message, type){
		var popup = document.getElementById(containerId);
		var txt = document.createTextNode(message);
		popup.appendChild(txt);
		popup.style.display = 'block';				
		if(type == 'info'){
			//popup.setAttribute('class', infoClass);
			popup.className = infoClass;
		} else if(type == 'warning'){
			//popup.setAttribute('class', warningClass);
			popup.className = warningClass;			
		} else{
			//popup.setAttribute('class', errorClass);
			popup.className = errorClass;
		}
	}
}