function dasDivWindow(udef_variable_name, title, width, height, udef_CloseWindowFunction ){
	var MyNameIsSlimShady=udef_variable_name;
	var displaceForEdges=16;
	var extrawidthforedges = 8;
	var blockWidth=width - displaceForEdges;
	var dasCloseWindowFunction=udef_CloseWindowFunction;
	
	var startX=0;
	var startY=0;
	var offsetX=0;
	var offsetY=0;
	var oldMouseupFunction=null;
	var oldMouseupFunction=null;
	var oldSelectStart=null;
	var mouseX=0;
	var mouseY=0;
	var NEED_OFFSET=false;
	var MovingWindow=false;
	var starZIndex=null;
	//var oldMouseFunction=document.onmousemove;
	//document.onmousemove=this.mouseMoveFunction;
	var IE=false;
			// IE? if not assume firefox (not polite)
			if(navigator.appName=="Microsoft Internet Explorer"){ IE=true; };
	
	var vHeight;
	var vWidth;
	if(IE){
		if( parseInt(parseFloat(document.documentElement.clientHeight).toFixed(0)) > 0 ){
			vHeight=parseInt(parseFloat(document.documentElement.clientHeight).toFixed(0));
			vWidth=parseInt(parseFloat(document.documentElement.clientWidth).toFixed(0));
		}else{
			vHeight=parseInt(parseFloat(document.body.clientHeight).toFixed(0));
			vWidth=parseInt(parseFloat(document.body.clientWidth).toFixed(0));
		}
	}else{
		vHeight=parseInt(parseFloat(window.innerHeight).toFixed(0));
		vWidth=parseInt(parseFloat(window.innerWidth).toFixed(0));
	}
	
	this.showLogo = function() {
		return true;
	}
	
	
	this.setContent = function(content){
		//alert("sc1:  "+dasDivWindow.style.width+" x "+dasDivWindow.style.height+"\n\n"+dasDivWindow.style.left+" x "+dasDivWindow.style.top);
		dasWindowContent.innerHTML="     "+content;
		//alert("sc2:  "+dasDivWindow.style.width+" x "+dasDivWindow.style.height+"\n\n"+dasDivWindow.style.left+" x "+dasDivWindow.style.top);
	}
	
	this.setAlignment = function(alignment){
		dasWindowContent.setAttribute('align', alignment);
	}
	
	this.setZ = function(zindex){
		//alert("sz1:  "+dasDivWindow.style.width+" x "+dasDivWindow.style.height+"\n\n"+dasDivWindow.style.left+" x "+dasDivWindow.style.top);
		dasDivWindow.style.zIndex=parseInt(parseFloat(zindex).toFixed(0));
		//dasDivWindow.setAttribute('style', 'position:absolute;background:#3c91c7;border:1px solid #045c97;display:none;z-index:'+parseInt(parseFloat(zindex).toFixed(0))+';');
		dasDivWindowCover.style.zIndex=( parseInt(parseFloat(zindex).toFixed(0)) - 1 );
		//dasDivWindowCover.setAttribute('style', 'filter:alpha(opacity=0);-moz-opacity:.0;opacity:.0;position:absolute;background:none;border:none;display:none;z-index:'+parseInt(parseFloat(zindex).toFixed(0))+';');
		//alert("sz2:  "+dasDivWindow.style.width+" x "+dasDivWindow.style.height+"\n\n"+dasDivWindow.style.left+" x "+dasDivWindow.style.top);
	}
	
	this.setBackground = function(color){
		//alert("sb1:  "+dasDivWindow.style.width+" x "+dasDivWindow.style.height+"\n\n"+dasDivWindow.style.left+" x "+dasDivWindow.style.top);
		dasWindowContent.style.background=color;
		//dasWindowContent.style.backgroundColor=color;
		//alert("sb2:  "+dasDivWindow.style.width+" x "+dasDivWindow.style.height+"\n\n"+dasDivWindow.style.left+" x "+dasDivWindow.style.top);
	}
	
	this.setScrollable = function(scrollable){
		//alert("ss1:  "+dasDivWindow.style.width+" x "+dasDivWindow.style.height+"\n\n"+dasDivWindow.style.left+" x "+dasDivWindow.style.top);
		if(scrollable){
			dasWindowContent.style.overflow='auto';
		}else{
			dasWindowContent.style.overflow='hidden';
		}
		//alert("ss2:  "+dasDivWindow.style.width+" x "+dasDivWindow.style.height+"\n\n"+dasDivWindow.style.left+" x "+dasDivWindow.style.top);
	}
	
	this.setCloseFunction = function(udef_CloseWindowFunction){
		dasCloseWindowFunction=udef_CloseWindowFunction;
	}
	
	this.addOnCloseListener = function(udef_CloseWindowFunction){
		if(navigator.appName=="Microsoft Internet Explorer"){
			closeButtonImage.attachEvent('onclick', udef_CloseWindowFunction);
		}else{
			closeButtonImage.addEventListener('click', udef_CloseWindowFunction, false);
		}
	}
	
	this.setWindowPos = function(posX, posY){
		dasDivWindow.style.left=( parseInt(parseFloat('0'+posX).toFixed(0)) )+"px";
		dasDivWindow.style.top=( parseInt(parseFloat('0'+posY).toFixed(0)) )+"px";
		dasDivWindowCover.style.left=( parseInt(parseFloat('0'+posX).toFixed(0)) )+"px";
		dasDivWindowCover.style.top=( parseInt(parseFloat('0'+posY).toFixed(0)) )+"px";
	}
	
	this.setWindowSize = function(x,y){
		dasDivWindowCover.style.width = (parseInt(parseFloat('0'+x).toFixed(0))+5+extrawidthforedges)+'px';
		dasDivWindowCover.style.height= (parseInt(parseFloat('0'+y).toFixed(0))+30+extrawidthforedges)+'px';
		dasDivWindow.style.width = (parseInt(parseFloat('0'+x).toFixed(0))+extrawidthforedges)+'px';
		dasDivWindow.style.height= (parseInt(parseFloat('0'+y).toFixed(0))+extrawidthforedges)+'px';
		//alert((parseInt(parseFloat('0'+x).toFixed(0))+extrawidthforedges)+'px' +"  x  "+(parseInt(parseFloat('0'+y).toFixed(0))+extrawidthforedges)+'px');
		//dasHeaderBuffer1.style.height=parseInt((displaceForEdges / 2)) +'px';
		//dasHeaderBuffer1.style.width=( parseInt(parseFloat(dasDivWindow.style.width).toFixed(0)) - displaceForEdges)+'px';
		dasWindowHeader.style.width = (parseInt(parseFloat(dasDivWindow.style.width).toFixed(0))  - displaceForEdges) +'px';
		dasWindowTitle.style.width=(parseInt(parseFloat(dasWindowHeader.style.width).toFixed(0))  - 20 -8)+'px';
		dasWindowContent.style.width=(parseInt(parseFloat(dasWindowHeader.style.width).toFixed(0)) )+'px';
		dasWindowContent.style.height=( parseInt(parseFloat('0'+dasDivWindow.style.height).toFixed(0))  - ( parseInt(parseFloat('0'+dasWindowHeader.style.height).toFixed(0)) ) )+'px';
	}
	
	this.setWindowTitle = function(newTitleText){
		dasNewTitleText=null;
		if( parseInt(newTitleText.indexOf("<"),10)>-1){
			dasNewTitleText=document.createElement('div');
			dasNewTitleText.innerHTML=newTitleText;
		}else{
			dasNewTitleText=document.createTextNode(' '+newTitleText);
		}
		dasWindowTitle.removeChild(dasWindowTitleText);
		dasWindowTitle.appendChild(dasNewTitleText);
		dasWindowTitleText=dasNewTitleText;
	}
	
	this.showWindow=function(){
		var scrolledY=0;
		//alert("sw1:  "+dasDivWindow.style.width+" x "+dasDivWindow.style.height+"\n\n"+dasDivWindow.style.left+" x "+dasDivWindow.style.top);
		if(IE){
			if( document.body && document.body.scrollTop ){
				//alert('body');
				scrolledY=parseInt(parseFloat(document.body.scrollTop).toFixed(0));
			}else if(document.documentElement && document.documentElement.scrollTop){
				//alert('documentElement');
				scrolledY=parseInt(parseFloat(document.documentElement.scrollTop).toFixed(0));
			}
			
		}else{
			scrolledY=parseInt(parseFloat(window.scrollY).toFixed(0));
		}
		
		//alert("scrolledY:  "+scrolledY+"\n\nvHeight:  "+parseInt(parseFloat(vHeight).toFixed(0))+"\n\nWindow Height:  "+parseInt(parseFloat(dasDivWindow.style.height).toFixed(0)));
		
		dasDivWindow.style.top= ((  parseInt(parseFloat(vHeight).toFixed(0)) - parseInt(parseFloat(dasDivWindow.style.height).toFixed(0)) ) / 2)+ scrolledY +'px';
		dasDivWindow.style.left= (  parseInt(parseFloat(vWidth).toFixed(0)) - parseInt(parseFloat(dasDivWindow.style.width).toFixed(0)) ) / 2 +'px';
		
		//dasDivWindow.style.top= ((  parseInt(parseFloat(vHeight).toFixed(0)) - parseInt(parseFloat(dasDivWindow.offsetHeight).toFixed(0)) ) / 2)+ scrolledY +'px';
		//dasDivWindow.style.left= parseInt(  (parseInt(parseFloat("0"+vWidth).toFixed(0)) - parseInt(parseFloat("0"+dasDivWindow.offsetWidth).toFixed(0)) ) / 2) +'px';
		
		
		
		if( parseInt(parseFloat(dasDivWindow.style.top).toFixed(0))  < 0) dasDivWindow.style.top=0+'px';
		if( parseInt(parseFloat(dasDivWindow.style.left).toFixed(0))  < 0) dasDivWindow.style.left=0+'px';
		
		//if( parseInt(parseFloat(dasDivWindow.offsetTop).toFixed(0))  < 0) dasDivWindow.style.top=0+'px';
		//if( parseInt(parseFloat(dasDivWindow.offsetLeft).toFixed(0))  < 0) dasDivWindow.style.left=0+'px';
		
		dasDivWindowCover.style.top= dasDivWindow.style.top;
		dasDivWindowCover.style.left= dasDivWindow.style.left;
		
		//dasDivWindowCover.style.top= dasDivWindow.offsetTop;
		//dasDivWindowCover.style.left= dasDivWindow.offsetLeft;
		
		//alert("sw2:  "+dasDivWindow.style.width+" x "+dasDivWindow.style.height+"\n\n"+dasDivWindow.style.left+" x "+dasDivWindow.style.top);
		dasDivWindow.style.display="block";
		if(IE){
			dasDivWindowCover.style.display="block";
		}
		
		runPNGFix();
	}
	
	this.closeWindow=function(){
		if(dasCloseWindowFunction()){
			dasDivWindow.style.display="none";
			dasDivWindowCover.style.display="none";
		}
	}
	
	this.moveWindow=function(e){
		var startX=dasDivWindow.style.left;
		var startY=dasDivWindow.style.top;
		oldMouseFunction=document.onmousemove;
		oldMouseupFunction=document.onmouseup;
		startZIndex=parseInt(parseFloat(dasDivWindow.style.zIndex).toFixed(0));
		
		
		var temp = "document.onmousemove="+MyNameIsSlimShady+".mouseMoveFunction;";
		if(window.execScript) {
			//alert("1");
			window.execScript(temp);
		} else eval(temp); 
		
		var temp = "document.onmouseup="+MyNameIsSlimShady+".stopWindow;";
		if(window.execScript) {
			//alert("1");
			window.execScript(temp);
		} else eval(temp);
		
		if(IE){
			oldSelectStart=document.onselectstart;
			document.onselectstart=function(){return false;};
		}else{
			oldSelectStart=document.onmousedown;
			document.onmousedown=function(){return false;};
		}
		
		MovingWindow=true;
		NEED_OFFSET=true;
		
		dasDivWindowCover.style.zIndex=9998;
		dasDivWindow.style.zIndex=9999;
	}
	
	this.stopWindow=function(){
		//alert("stopWindow");
		document.onmousemove=oldMouseFunction;
		document.onmouseup=oldMouseupFunction;
		NEED_OFFSET=true;
		mouseX=0;
		mouseY=0;
		offsetX=0;
		offsetY=0;
		MovingWindow=false;
		if(dasDivWindow.style.zIndex) {
			dasDivWindow.style.zIndex=startZIndex;
		}
		if(dasDivWindowCover.style.zIndex) {
			dasDivWindowCover.style.zIndex=(startZIndex - 1);
		}
		if(IE){
			document.onselectstart=oldSelectStart;
		}else{
			document.onmousedown=oldSelectStart;
		}
	}
	
	this.mouseMoveFunction= function(e){
		if(MovingWindow){
			if (IE) { // grab the x-y pos.s if browser is IE
				mouseX = event.clientX;// + document.body.scrollLeft;
				mouseY = event.clientY;// + document.body.scrollTop;
			} else {  // grab the x-y pos.s if browser is NS
				//mouseX = e.pageX;
				//mouseY = e.pageY;
				mouseX = e.clientX;
				mouseY = e.clientY;
			}  
			// catch possible negative values in NS4
			if (mouseX < 0){mouseX = 0}
			if (mouseY < 0){mouseY = 0}
		
			//oldMouseFunction(e);
			if(NEED_OFFSET){
				offsetX=mouseX - parseInt( parseFloat('0'+dasDivWindow.style.left).toFixed(0));
				offsetY=mouseY - parseInt(parseFloat('0'+dasDivWindow.style.top).toFixed(0));
				NEED_OFFSET=false;
			}
			
			dasDivWindow.style.left=mouseX-offsetX+"px";
			dasDivWindow.style.top=mouseY-offsetY+"px";
			dasDivWindowCover.style.left=dasDivWindow.style.left;
			dasDivWindowCover.style.top=dasDivWindow.style.top;
		}else{
			document.onmousemove=oldMouseFunction;
			document.onmouseup=oldMouseupFunction;
			NEED_OFFSET=true;
			mouseX=0;
			mouseY=0;
			offsetX=0;
			offsetY=0;
			MovingWindow=false;
			dasDivWindow.style.zIndex=9998;
			if(IE){
				document.onselectstart=oldSelectStart;
			}else{
				document.onmousedown=oldSelectStart;
			}
			return false;
		}
	}
	
	this.append=function(udef_transformed){
		var dis=( browser.isIE()==true ? new erjIENode(dasWindowContent) : dasWindowContent );
		dis.hide();
		if( browser.isIE()==true ){
			dis.innerHTML+=udef_transformed;
		}else{
			dis.appendChild(udef_transformed);
		}
		dis.show();
	}
	
	this.killChildren=function(){
		while( dasWindowContent.hasChildNodes() ){
			dasWindowContent.removeChild(dasWindowContent.firstChild);
		}
	}
	
	this.resetScroll=function(){
		dasWindowContent.scrollTop=0;
		dasWindowContent.scrollLeft=0;
	}
	
	//########################################## WINDOW DIV ####################################
	var dasDivWindowCover = document.createElement('iframe');
	dasDivWindowCover.setAttribute('class', 'dasDivWindowCover');
	dasDivWindowCover.setAttribute('className', 'dasDivWindowCover');
	dasDivWindowCover.style.width = (parseInt(width)+5+extrawidthforedges)+'px';
	dasDivWindowCover.style.height= (parseInt(height)+30+extrawidthforedges)+'px';
	dasDivWindowCover.src="https://www.iclasspro.com/main/blank.html";
	document.getElementsByTagName('body')[0].appendChild(dasDivWindowCover);
	
	
	//########################################## WINDOW DIV ####################################
	var dasDivWindow = document.createElement('div');
	dasDivWindow.setAttribute('class', 'dasDivWindow');
	dasDivWindow.setAttribute('className', 'dasDivWindow');
	dasDivWindow.style.width = (width+extrawidthforedges)+'px';
	dasDivWindow.style.height= (height+extrawidthforedges)+'px';
	
	layouttable = document.createElement("table");
	layouttable.style.width = "100%";
	layouttable.style.height = "100%";
	//layouttable.class = 'plaintable';
	layouttable.setAttribute('class', 'plaintable');
	layouttable.setAttribute('className', 'plaintable');
	layouttable.cellPadding = "0";
	layouttable.cellSpacing = "0";
	var topborder = layouttable.insertRow(0);
	var tlb = topborder.insertCell(0);
	tlb.setAttribute('class', 'topleftb');
	tlb.setAttribute('className', 'topleftb');

	var tb = topborder.insertCell(1);
	tb.setAttribute('class', 'topb');
	tb.setAttribute('className', 'topb');
	
	var trb = topborder.insertCell(2);
	trb.setAttribute('class', 'toprightb');
	trb.setAttribute('className', 'toprightb');
	
	
	var toprow = layouttable.insertRow(1);
	var lb1 = toprow.insertCell(0);
	lb1.setAttribute('class', 'leftb');
	lb1.setAttribute('className', 'leftb');

	var content1 = toprow.insertCell(1);
	content1.setAttribute('class', 'dwcontent1');
	content1.setAttribute('className', 'dwcontent1');
	content1.setAttribute('valign', 'middle');
	
	var rb1 = toprow.insertCell(2);
	rb1.setAttribute('class', 'rightb');
	rb1.setAttribute('className', 'rightb');
	

	var bottomrow = layouttable.insertRow(2);
	var lb2 = bottomrow.insertCell(0);
	lb2.setAttribute('class', 'leftb');
	lb2.setAttribute('className', 'leftb');

	var content2 = bottomrow.insertCell(1);
	content2.setAttribute('class', 'dwcontent2');
	content2.setAttribute('className', 'dwcontent2');
	
	var rb2 = bottomrow.insertCell(2);
	rb2.setAttribute('class', 'rightb');
	rb2.setAttribute('className', 'rightb');
	
	
	var bottomborder = layouttable.insertRow(3);
	var blb = bottomborder.insertCell(0);
	blb.setAttribute('class', 'bottomleftb');
	blb.setAttribute('className', 'bottomleftb');

	var bb = bottomborder.insertCell(1);
	bb.setAttribute('class', 'bottomb');
	bb.setAttribute('className', 'bottomb');
	
	var brb = bottomborder.insertCell(2);
	brb.setAttribute('class', 'bottomrightb');
	brb.setAttribute('className', 'bottomrightb');
	
	
	
	//var newcontent = "<table class='plaintable' cellspacing='0' cellpadding='0' width='100%'><tr><td height='10' width='10' class='topleftb'></td><td class='topb'></td><td width='10' class='toprightb'></td></tr></table>";
	//dasDivWindow.innerHTML = newcontent;
	document.getElementsByTagName('body')[0].appendChild(dasDivWindow);
	dasDivWindow.appendChild(layouttable);
	
	
	//########################################## BUFFER1 ####################################
	//var dasHeaderBuffer1=document.createElement('div');
	//alert(dasDivWindow.style.width);
	//dasHeaderBuffer1.style.width=( parseInt(parseFloat(dasDivWindow.style.width).toFixed(0)) - displaceForEdges)+'px';//(dasDivWindow.style.width - displaceForEdges)+'px';
	//dasHeaderBuffer1.style.height=parseInt((displaceForEdges / 2)) +'px';
	//dasHeaderBuffer1.style.height='3px';
	//dasHeaderBuffer1.setAttribute('style', 'height:3px;margin:0px;padding:0px;border:none;');
	//content1.appendChild(dasHeaderBuffer1);
	
	
	//########################################## HEADER ####################################
	var dasWindowHeader=document.createElement('div');
	dasWindowHeader.setAttribute('class', 'dasDivWindow_Header');
	dasWindowHeader.setAttribute('className', 'dasDivWindow_Header');
	dasWindowHeader.setAttribute('valign', 'middle');
	dasWindowHeader.style.width = (parseInt(parseFloat(dasDivWindow.style.width).toFixed(0))  - displaceForEdges) +'px';
	dasWindowHeader.style.height = (22 )+'px';
	content1.appendChild(dasWindowHeader);
		
	
	//########################################## TITLE ####################################
	var dasWindowTitle=document.createElement('div');
	dasWindowTitle.setAttribute('class', 'dasDivWindow_Title');
	dasWindowTitle.setAttribute('className', 'dasDivWindow_Title');
	dasWindowTitle.setAttribute('valign', 'middle');
	dasWindowTitle.onmousedown=this.moveWindow;
	//dasWindowTitle.onmouseup=this.stopWindow;
	var dasWindowTitleText=null;
	if( parseInt(title.indexOf("<"),10)>-1){
		dasWindowTitleText=document.createElement('div');
		dasWindowTitleText.innerHTML=title;
	}else{
		dasWindowTitleText=document.createTextNode(( (title!=null && title!=undefined && title!='') ? ' '+title : ' New Unnamed Window' ));
	}
	//var dasWindowTitleText=document.createTextNode(( (title!=null && title!=undefined && title!='') ? ' '+title : ' New Unnamed Window' ));
	dasWindowTitle.appendChild(dasWindowTitleText);
	dasWindowTitle.style.width=(parseInt(parseFloat(dasWindowHeader.style.width).toFixed(0))  - 20 -2-6)+'px';
	//dasWindowTitle.style.display='inline';
	dasWindowHeader.appendChild(dasWindowTitle);
	
	
	//########################################## CLOSE BUTTON ####################################
	var dasWindowCloseButton = document.createElement('div');
	dasWindowCloseButton.setAttribute('id', 'dasDivWindow_CloseButton');
	dasWindowCloseButton.setAttribute('class', 'dasDivWindow_CloseButton');
	dasWindowCloseButton.setAttribute('className', 'dasDivWindow_CloseButton');
	//dasWindowCloseButton.setAttribute('ondrag', 'return false');
	dasWindowCloseButton.style.width=15+'px';
	dasWindowCloseButton.style.height=15+'px';
	//var closeButtonText=document.createTextNode('X');
	//dasWindowCloseButton.appendChild(closeButtonText);
	var closeButtonImage=document.createElement('img');
	//closeButtonImage.src="images/closeButtonImage.png";
	closeButtonImage.src="https://www.iclasspro.com/images/dwb2/close.gif";
	closeButtonImage.onmousedown=function (){this.src="https://www.iclasspro.com/images/dwb2/close_pressed.gif";};
	closeButtonImage.onmouseup=function (){this.src="https://www.iclasspro.com/images/dwb2/close.gif";};
	closeButtonImage.onmouseout=function (){this.src="https://www.iclasspro.com/images/dwb2/close.gif";};
	//closeButtonImage.ondragstart=function (){return false};
	closeButtonImage.setAttribute('class', "dasDivWindow_CloseButtonImage");
	closeButtonImage.setAttribute('className', "dasDivWindow_CloseButtonImage");
	closeButtonImage.setAttribute('name', "dasDivWindow_CloseButtonImage");
	//closeButtonImage.setAttribute('width', "15");
	//closeButtonImage.setAttribute('height', "15");
	closeButtonImage.onclick=this.closeWindow;
	dasWindowCloseButton.appendChild(closeButtonImage);
	//dasWindowCloseButton.style.display='inline';
	dasWindowHeader.appendChild(dasWindowCloseButton);
	
	
	//########################################## BUFFER 2 ####################################
	//var dasHeaderBuffer2 = dasHeaderBuffer1.cloneNode(true);
	//content1.appendChild(dasHeaderBuffer2);
	
	
	//########################################## CONTENT ####################################
	var dasWindowContent=document.createElement('div');
	dasWindowContent.setAttribute('class', 'dasDivWindow_Content');
	dasWindowContent.setAttribute('className', 'dasDivWindow_Content');
	dasWindowContent.style.width=(parseInt(parseFloat(dasWindowHeader.style.width).toFixed(0)) )+'px';
	dasWindowContent.style.height=( parseInt(parseFloat('0'+dasDivWindow.style.height).toFixed(0))  - ( parseInt(parseFloat('0'+dasWindowHeader.style.height).toFixed(0))  ) )+'px';
	//dasWindowContent.appendChild(document.createTextNode('die'));
	content2.appendChild(dasWindowContent);
	
	
	//########################################## BUFFER 3 ####################################
	//var dasFooterBuffer = dasHeaderBuffer1.cloneNode(true);
	//content2.appendChild(dasFooterBuffer);
	
	runPNGFix();
	
	
	return this;
}
