
			// JavaScript file for mlAjaxDlg component
			// (c) by Mindlend AG, www.mindlend.com
			// Created: 2012-01-27 14:51:24
			// Component version: 0.1 
			
			var mlAjaxDlg=function(){
				/************************************************** properties **************************************************/
					this.oAjaxDlg=null;
					this.instanceName='';
					this.isVisible=false;
					this.dlgContImg='';
					this.xOffset=17;
					this.yOffset=0;
					this.dragX=0;
					this.dragY=0;
					this.posX=0;
					this.posY=0;
					
				/************************************************** functions **************************************************/
				// initBox
					this.initBox=function(pInstanceName_s,pParentNode_s){
						this.instanceName=pInstanceName_s;
						var oNewDiv=document.createElement('div');
						var oParentNode=null;
						if(pParentNode_s.toLowerCase()=='body') oParentNode=document.getElementsByTagName('body')[0];
						try{oParentNode=document.getElementById(pParentNode_s)}
						catch(dummy){oParentNode=document.getElementsByTagName('body')[0];}
						var oAjaxDlgBox=oParentNode.appendChild(oNewDiv);
						oAjaxDlgBox.id='dlg_'+pInstanceName_s;
						oAjaxDlgBox.className='ajaxDlg';
						oAjaxDlgBox.style.display='none';
						this.oAjaxDlg=oAjaxDlgBox;
						this.posX=this.getXOffset();
						this.posY=this.getYOffset();
					}
				// initBoxObj
					this.initBoxObj=function(){
						if(!this.oAjaxDlg) this.oAjaxDlg=document.getElementById(this.instanceName);
					}
				// initHeadObj
					this.initHeadObj=function(){
						this.initBoxObj();
						if(!this.oAjaxDlgHead) {
							for(var i in this.oAjaxDlg.childNodes)
								if(this.oAjaxDlg.childNodes[i].id=='ajaxDlgHead'){
									this.oAjaxDlgHead=this.oAjaxDlg.childNodes[i];
									return;
								}
						}
					}
				// initActionIcoTblObj
					this.initActionIcoTblObj=function(){
						this.initHeadObj();
						if(!this.oAjaxDlgHeadIcoTbl) {
							for(var i in this.oAjaxDlgHead.childNodes)
								if(this.oAjaxDlgHead.childNodes[i].id=='ajaxDlgHeadIcoTbl'){
									this.oAjaxDlgHeadIcoTbl=this.oAjaxDlgHead.childNodes[i];
									return;
								}
						}
					}
				// initTitleObj
					this.initTitleObj=function(){
						this.initHeadObj();
						if(!this.oAjaxDlgTitle) {
							for(var i in this.oAjaxDlgHead.childNodes)
								if(this.oAjaxDlgHead.childNodes[i].id=='ajaxDlgHeadCont'){
									this.oAjaxDlgTitle=this.oAjaxDlgHead.childNodes[i];
									return;
								}
						}
					}
				// initHeadImgObj
					this.initHeadImgObj=function(){
						this.initHeadObj();
						if(!this.oAjaxDlgHeadImg) {
							for(var i in this.oAjaxDlgHead.childNodes)
								if(this.oAjaxDlgHead.childNodes[i].id=='ajaxDlgHeadImg'){
									this.oAjaxDlgHeadImg=this.oAjaxDlgHead.childNodes[i];
									return;
								}
						}
					}
				// initContObj
					this.initContObj=function(){
						this.initBoxObj();
						if(!this.oAjaxDlgCont) {
							for(var i in this.oAjaxDlg.childNodes)
								if(this.oAjaxDlg.childNodes[i].id=='ajaxDlgCont'){
									this.oAjaxDlgCont=this.oAjaxDlg.childNodes[i];
									return;
								}
						}
					}
				// initContImgObj
					this.initContImgObj=function(){
						this.initContObj();
						if(!this.oAjaxDlgContImg) {
							for(var i in this.oAjaxDlgCont.childNodes)
								if(this.oAjaxDlgCont.childNodes[i].id=='ajaxDlgContImg'){
									this.oAjaxDlgContImg=this.oAjaxDlgCont.childNodes[i];
									return;
								}
						}
					}
				// loadDlgLayout
					this.loadDlgLayout=function(pHTMLCode_s){
						this.initBoxObj();
						this.oAjaxDlg.innerHTML=pHTMLCode_s;
					}
				// getXOffset
					this.getXOffset=function(){
						var retVal=0;
						try{retVal=window.scrollX;}
						catch(dummy){/* do nothing */}
						if(retVal > 0) return retVal;
						try{retVal=document.body.scrollLeft;}
						catch(dummy){/* do nothing */}
						return retVal;
					}
				// getYOffset
					this.getYOffset=function(){
						var retVal=0;
						try{retVal=window.scrollY;}
						catch(dummy){/* do nothing */}
						if(retVal > 0) return retVal;
						try{retVal=document.body.scrollTop;}
						catch(dummy){/* do nothing */}
						return retVal;
					}
				// open
					this.open=function(pTitle_s,pCont_s){
						this.setTitle(pTitle_s);
						this.setContent(pCont_s);
						this.setVisible(true);
					}
				// close
					this.close=function(pTitle_s,pCont_s){this.setVisible(false);}
				/***** drag / drop functionalities just experimental at this stage *****/
				// startDrag
					this.startDrag=function(e){
						setDragAjaxObj(this);
						dragAjaxObj=this;
						/*this.dragX=this.posX-dragAjaxObj.oAjaxDlg.offsetLeft;
						this.dragY=this.posY-dragAjaxObj.oAjaxDlg.offsetTop;
						this.dragX=this.posX-this.getXOffset();
						this.dragY=this.posY-this.getYOffset();
						this.dragX=this.posX;
						this.dragY=this.posY;*/
						if(document.all){
							this.dragX=window.event.clientX;
							this.dragX=window.event.clientY;
						} else {
							this.dragX=e.pageX;
							this.dragX=e.pageY;
						}
						document.onmousemove=function(){dragAjaxObj.drag();};
						document.onmouseup=function(){dragAjaxObj.stopDrag();};
					}
				// stopDrag
					this.stopDrag=function(){
						dragAjaxObj=null;
						this.posX=parseInt(this.oAjaxDlg.style.left);
						this.posY=parseInt(this.oAjaxDlg.style.top);
						document.onmousemove=null;
						document.onmouseup=null;
					}
				// drag
					this.drag=function(e){
						if(document.all){
							this.posX=window.event.clientX;
							this.posY=window.event.clientY;
						} else {
							this.posX=e.pageX;
							this.posY=e.pageY;
						}
						if(dragAjaxObj != null){
							this.oAjaxDlg.style.left=this.posX-this.dragX;
							this.oAjaxDlg.style.top=this.posY-this.dragY;
							this.setTitle(this.oAjaxDlg.style.left+';'+this.oAjaxDlg.style.top);
						}
					}
				// move
					this.move=function(pLeft_i,pTop_i){
						this.initBoxObj();
						pLeft_i=pLeft_i+this.xOffset+this.getXOffset();
						pTop_i=pTop_i+this.yOffset+this.getYOffset();
						this.oAjaxDlg.style.left=pLeft_i+'px';
						this.oAjaxDlg.style.top=pTop_i+'px';
					}
				// setVisible
					this.setVisible=function(pVisible_b){
						this.isVisible=pVisible_b;
						if(!pVisible_b){
							this.hideBox();
							return;
						}
						if(this.setVisible.arguments.length == 1) this.showBox();
						else setTimeout('catInfoBox.showBox()', this.setVisible.arguments[1]);
					}
				// showBox
					this.showBox=function(){
						if(this.isVisible){
							this.initBoxObj();
							this.oAjaxDlg.style.display='block';
						}
					}
				// hideBox
					this.hideBox=function(){
						this.initBoxObj();
						this.oAjaxDlg.style.display='none';
					}
				// setTitle
					this.setTitle=function(pTitle_s){
						this.initTitleObj();
						this.oAjaxDlgTitle.innerHTML=pTitle_s;
					}
				// setHeadImg
					this.setHeadImg=function(pImg_s){
						this.initHeadImgObj();
						if(pImg_s=='') this.oAjaxDlgHeadImg.style.display='none';
						else {
							this.oAjaxDlgHeadImg.src=pImg_s;
							this.oAjaxDlgHeadImg.style.display='block';
						}
					}
				// setContImg
					this.setContImg=function(pImg_s){
						/*this.initContImgObj();
						if(pImg_s=='') this.oAjaxDlgContImg.style.display='none';
						else {
							this.oAjaxDlgContImg.src=pImg_s;
							this.oAjaxDlgContImg.style.display='block';
						}*/
						this.dlgContImg=pImg_s;
					}
				// setContent
					this.setContent=function(pCont_s){
						this.initContObj();
						if(this.dlgContImg != '') pCont_s='<img id="ajaxDlgContImg" src="'+this.dlgContImg+'" class="ajaxDlgContImg">'+pCont_s+'</span>';
						this.oAjaxDlgCont.innerHTML=pCont_s;
					}
				// setStyle
					this.setStyle=function(pProperty_s,pValue_s){
						this.initBoxObj();
						oStyleProp=eval('this.oAjaxDlg.style.'+pProperty_s);
						oStyleProp=pValue_s;
					}
				// showActionIco
					this.showActionIco=function(pIco_s,pVisible_b){
						addEventListener=false;
						if(this.showActionIco.arguments.length>2) {
							addEventListener=true;
							eventType=this.showActionIco.arguments[2];
							handler=this.showActionIco.arguments[3];
						}
						this.initActionIcoTblObj();
						if(!this.oAjaxDlgHeadIcoTbl.cells) return;
						for(var i=0;i<this.oAjaxDlgHeadIcoTbl.cells.length;i++)
							if(this.oAjaxDlgHeadIcoTbl.cells[i].id=='ajaxDlg'+pIco_s+'Ico'){
								cell=this.oAjaxDlgHeadIcoTbl.cells[i]
								cell.style.display= pVisible_b ? 'inline' : 'none';
								if(addEventListener) {
									try{
										if(cell.addEventListener) cell.addEventListener(eventType, handler, false);
										else if(cell.attachEvent) cell.attachEvent("on" + eventType, handler);
									} catch(dummy){}
								}
							}
					}
			}
		

