/**
 * Vers. 3.2 (18-09-2011)(c) by Bernd Kiessling 
 * All Rights Reserved.
 * Es ist nicht erlaubt, diese Scripts ohne schriftliche Zustimmung des Autorīs zu verwenden, zu kopieren oder weiterzugeben !!
**/
function DLG(p_obj,p_dlgcl,p_alpha,p_caller){
	var thisobj=this;
	thisobj.obj=p_obj;
	//cont
	thisobj.cont=document.createElement("div");
	thisobj.cont.style.position="absolute";
	thisobj.cont.style.left="0px";
	thisobj.cont.style.top="0px";
	thisobj.cont.style.width=String(pcdi_docwidth)+"px";
	thisobj.cont.style.height=String(pcdi_docheight)+"px";
	thisobj.cont.style.zIndex=lstZI(document.getElementsByTagName("body")[0]);
	//back
	var bck=document.createElement("div");
	bck.style.position="absolute";
	bck.style.left="0px";
	bck.style.top="0px";
	bck.style.width=thisobj.cont.style.width;
	bck.style.height=thisobj.cont.style.height;
	bck.className=p_dlgcl;
	if(isIE()){
		setFilter(bck,"alpha(opacity="+String(Number(p_alpha))+")");
	}else{
		bck.style.opacity=Number(p_alpha)/100;
	}
	//close
	thisobj.clbt=document.createElement("a");
	thisobj.clbt.href="#";
	thisobj.clbt.tabindex=1;
	thisobj.clbt.style.position="absolute";
	thisobj.clbt.style.left="0px";
	thisobj.clbt.style.top="0px";
	thisobj.clbt.style.width="30px";
	thisobj.clbt.style.height="30px";
	thisobj.clbt.className="dlgcl";
	thisobj.clbt.id="dlgcl_0_0";
	thisobj.cont.appendChild(bck);
	thisobj.cont.appendChild(p_obj);
	thisobj.cont.appendChild(thisobj.clbt);
	document.getElementsByTagName("body")[0].appendChild(thisobj.cont);
	thisobj.obj.style.width=String(bc_getCurrentSzStyle(thisobj.obj,"width")[1])+bc_getCurrentSzStyle(thisobj.obj,"width")[2];
	thisobj.obj.style.height=String(bc_getCurrentSzStyle(thisobj.obj,"height")[1])+bc_getCurrentSzStyle(thisobj.obj,"height")[2];
	thisobj.obj.style.position="absolute";
	thisobj.obj.style.left="0px";
	thisobj.obj.style.top="0px";
	thisobj.setPos=function(){
		var tmpl=Number(pcdi_docwidth)/2-Number(bc_getObjSValue(thisobj.obj,"width"))/2;
		if(tmpl<15){
			tmpl=15;
		}
		bc_setObjSValue(thisobj.obj,"left",tmpl);
		var tmpt=Number(rs_height)/2-Number(bc_getObjSValue(thisobj.obj,"height"))/2;
		if(tmpt<20){
			tmpt=20;
		}
		bc_setObjSValue(thisobj.obj,"top",tmpt);
		bc_setObjSValue(thisobj.clbt.alink,"left",Math.round(tmpl+Number(bc_getObjSValue(thisobj.obj,"width")-bc_getObjSValue(thisobj.clbt.alink,"width")/3)));
		bc_setObjSValue(thisobj.clbt.alink,"top",Math.round(tmpt-Number(bc_getObjSValue(thisobj.clbt.alink,"height")/2)));
		rs_rsObjSub(thisobj.cont);
	};				
	thisobj.clbt=new Bt(thisobj.clbt,thisobj);
	bc_addRsObj(thisobj.cont);
	thisobj.setPos();
	thisobj.scrollX=window.scrollX || window.pageXOffset || document.body.scrollLeft;
	thisobj.scrollY=window.scrollY || window.pageYOffset || document.body.scrollTop;
	window.scroll(0,0);
	thisobj.sio=new SInOut(500,thisobj);	
	thisobj.clbt.setVisible(false);
	thisobj.sio.sIn(thisobj.obj,20,100);
	thisobj.btmover=function(p_bt){		
	};
	thisobj.btmout=function(p_bt){
	};
	thisobj.btmdown=function(p_bt){
	};
	thisobj.btmup=function(p_bt){
		thisobj.close();
	};
	thisobj.btmclick=function(p_bt){		
	};
	thisobj.sInF=function(p_si){
		thisobj.clbt.setVisible(true);
	};
	thisobj.sOnF=function(p_so){
		
	};
	thisobj.close=function(){
		window.scroll(thisobj.scrollX,thisobj.scrollY);
		if(p_caller!=null){
			p_caller.clDLG(thisobj);	
		}
		document.getElementsByTagName("body")[0].removeChild(thisobj.cont);
		bc_remObj(thisobj.cont);
		thisobj=null;
	};
}
function nIF(p_url,p_ifcl,p_alpha,p_dlgcl){
	var ifr=document.createElement("iframe");
	ifr.frameborder="0";
	ifr.allowtransparency="true";
	ifr.src=p_url;
	ifr.className=p_ifcl;
	new DLG(ifr,p_dlgcl,p_alpha,null);
}
function nWait(p_wleft,p_wtop,p_dlgcl){
	thisobj=this;
	thisobj.loadimg=document.createElement("img");
	thisobj.loadimg.src=rtPh()+"local/img/lout/laden.gif";
	thisobj.loadimg.style.position="absolute";
	thisobj.loadimg.style.left=p_wleft+"px";
	thisobj.loadimg.style.top=p_wtop+"px";
	thisobj.loadimg.style.width="50px";
	thisobj.loadimg.style.height="50px";
	thisobj.cont=document.createElement("div");
	thisobj.cont.style.position="absolute";
	thisobj.cont.style.left="0px";
	thisobj.cont.style.top="0px";
	thisobj.cont.style.width=String(pcdi_docwidth)+"px";
	thisobj.cont.style.height=String(pcdi_docheight)+"px";
	thisobj.cont.style.zIndex=lstZI(document.getElementsByTagName("body")[0]);
	//back
	var bck=document.createElement("div");
	bck.style.position="absolute";
	bck.style.left="0px";
	bck.style.top="0px";
	bck.style.width=thisobj.cont.style.width;
	bck.style.height=thisobj.cont.style.height;
	bck.className=p_dlgcl;
	if(isIE()){
		setFilter(bck,"alpha(opacity="+String(Number(50))+")");
	}else{
		bck.style.opacity=Number(50)/100;
	}
	thisobj.cont.appendChild(bck);
	thisobj.cont.appendChild(thisobj.loadimg);
	document.getElementsByTagName("body")[0].appendChild(thisobj.cont);
	bc_addRsObj(thisobj.cont);
	thisobj.finish=function(){
		document.getElementsByTagName("body")[0].removeChild(thisobj.cont);
		bc_remObj(thisobj.cont);
	};
}
function dlg_mkBig(p_obj,p_allobj,p_ifcl,p_alpha,p_dlgcl,p_caller){
	var thisobj=this;
	thisobj.parent=p_obj.parentNode;
	thisobj.prefSib;
	thisobj.obj;
	thisobj.nxtSib;
	thisobj.subobj;
	thisobj.allobj=p_allobj;
	thisobj.bgr=document.createElement("div");
	thisobj.bgr.className=p_ifcl;
	thisobj.txt=document.createElement("div");
	thisobj.txt.style.textAlign="center";
	thisobj.txt.style.position="absolute";
	thisobj.txt.style.top="2px";
	thisobj.txt.style.width="100px";
	thisobj.txt.style.height="18px";
	thisobj.prevbt=document.createElement("a");
	thisobj.prevbt.href="#";
	thisobj.prevbt.className="none";
	thisobj.prevbt.id="prev_500_0";
	thisobj.prevbt.style.position="absolute";
	thisobj.prevbt.style.width="30px";
	thisobj.prevbt.style.height="20px";
	thisobj.prevbt.style.top="-3px";
	thisobj.nxtbt=document.createElement("a");
	thisobj.nxtbt.href="#";
	thisobj.nxtbt.className="none";
	thisobj.nxtbt.id="nxt_500_0";
	thisobj.nxtbt.style.position="absolute";
	thisobj.nxtbt.style.width="30px";
	thisobj.nxtbt.style.height="20px";
	thisobj.nxtbt.style.top="-3px";
	thisobj.dlg;
	thisobj.bgr.appendChild(thisobj.txt);
	thisobj.btmover=function(p_bt){
		//alert("over");
	};		
	thisobj.btmout=function(p_bt){
		//alert("out");
	};
	thisobj.btmdown=function(p_bt){
		//alert("down");
	};
	thisobj.btmup=function(p_bt){			
		thisobj.resetObj();
		if(p_bt==thisobj.nxtbt){
			for(var i=0;i<thisobj.allobj.length;i++){
				if((thisobj.obj[0][0]==thisobj.allobj[i])&&(i<thisobj.allobj.length-1)){
					thisobj.setBig(thisobj.allobj[i+1]);
					break;
				}
			}
		}else if(p_bt==thisobj.prevbt){
			for(var i=0;i<thisobj.allobj.length;i++){
				if((thisobj.obj[0][0]==thisobj.allobj[i])&&(i>0)){
					thisobj.setBig(thisobj.allobj[i-1]);
					break;
				}
			}
		}
	};
	thisobj.btmclick=function(p_bt){
		//alert("click");
	};
	thisobj.mkSmall=function(){
		if(thisobj.obj[0][0].className.toLowerCase().indexOf("forgrd_")>-1){
			rs_rsObj(thisobj.obj[0][0].nextSibling);
		}
		if(thisobj.obj[0][0].className.toLowerCase().indexOf("bckgrd_")>-1){
			rs_rsObj(thisobj.obj[0][0].previousSibling);
		}
		rs_rsObjSub(thisobj.obj[0][0]);
		if(thisobj.obj[0][0].className.toLowerCase().indexOf("forgrd_")>-1){
			try{
				if((isIE())&&(!isIEM())){
					thisobj.obj[0][0].nextSibling.style.cursor="url("+rtPh()+btfolder+"zplus.cur),pointer";
				}else{
					thisobj.obj[0][0].nextSibling.style.cursor="url("+rtPh()+btfolder+"zplus.png),pointer";
				}
			}catch(e){
				//nothing
			}
			thisobj.obj[0][0].nextSibling.onmouseup=function(p_event){
				p_event = p_event || window.event;
				var target = p_event.target || p_event.srcElement;
				new dlg_mkBig(target.previousSibling,thisobj.allobj,p_ifcl,p_alpha,p_dlgcl,thisobj);
			};
		}else{
			try{
				if((isIE())&&(!isIEM())){
					thisobj.obj[0][0].style.cursor="url("+rtPh()+btfolder+"zplus.cur),pointer";
				}else{
					thisobj.obj[0][0].style.cursor="url("+rtPh()+btfolder+"zplus.png),pointer";
				}
			}catch(e){
				//nothing
			}
			thisobj.obj[0][0].onmouseup=function(p_event){
				p_event = p_event || window.event;
				var target = p_event.target || p_event.srcElement;
				if(target.className.toLowerCase().indexOf("bigover_")>-1){
					new dlg_mkBig(target,thisobj.allobj,p_ifcl,p_alpha,p_dlgcl,thisobj);
				}else{
					new dlg_mkBig(target.parentNode,thisobj.allobj,p_ifcl,p_alpha,p_dlgcl,thisobj);
				}
			};
		}
	};	
	thisobj.mkBigSub=function(p_obj,p_zoom){
		if((bc_getObjSValue(p_obj,"width")!=null)&&(bc_getObjSValue(p_obj,"height")!=null)&&(bc_getObjSValue(p_obj,"left")!=null)&&(bc_getObjSValue(p_obj,"top")!=null)&&(p_obj.nodeType==1)){
			thisobj.subobj.push(new Array(p_obj,bc_getObjSValue(p_obj,"left"),bc_getObjSValue(p_obj,"top"),bc_getObjSValue(p_obj,"width"),bc_getObjSValue(p_obj,"height")));
			bc_setObjSValue(p_obj,"left",Math.round(p_zoom*Number(bc_getObjSValue(p_obj,"left"))/100));
			bc_setObjSValue(p_obj,"top",Math.round(p_zoom*Number(bc_getObjSValue(p_obj,"top"))/100));
			bc_setObjSValue(p_obj,"width",Math.round(p_zoom*Number(bc_getObjSValue(p_obj,"width"))/100));
			bc_setObjSValue(p_obj,"height",Math.round(p_zoom*Number(bc_getObjSValue(p_obj,"height"))/100));
			if(p_obj.childNodes){
				for(var i=0;i<p_obj.childNodes.length;i++){
					thisobj.mkBigSub(p_obj.childNodes[i],p_zoom);
				}
			}				
		}
	};
	thisobj.setBig=function(p_curobj){
		thisobj.prefSib=new Array();
		thisobj.obj=new Array();
		thisobj.nxtSib=new Array();
		thisobj.subobj=new Array();
		var tmpw=Math.round(90*pcdi_docwidth/100);
		var tmph=Math.round(tmpw*(rs_height*100/rs_width)/100);
		var param=p_curobj.className.substr(p_curobj.className.toLowerCase().indexOf("bigover_")+8,1);
		var tmpzoom=0;
		var tmphzoom=0;
		var tmpobjw=0;
		var tmpobjh=0;
		var tmpleft=0;
		var tmptop=0;
		if(p_curobj.className.toLowerCase().indexOf("bckgrd_")>-1){
		thisobj.prefSib.push(new Array(p_curobj.previousSibling,bc_getObjSValue(p_curobj.previousSibling,"left"),bc_getObjSValue(p_curobj.previousSibling,"top"),bc_getObjSValue(p_curobj.previousSibling,"width"),bc_getObjSValue(p_curobj.previousSibling,"height")));
		thisobj.bgr.appendChild(thisobj.prefSib[0][0]);
		if(param=="1"){		
			if(tmpw*100/Math.round(Number(bc_getObjSValue(thisobj.prefSib[0][0],"width")))>tmph*100/Math.round(Number(bc_getObjSValue(thisobj.prefSib[0][0],"height")))){
				tmpzoom=Math.round(tmph*100/Number(bc_getObjSValue(thisobj.prefSib[0][0],"height")))-2;
			}else{
				tmpzoom=Math.round(tmpw*100/Number(bc_getObjSValue(thisobj.prefSib[0][0],"width")))-2;
			}
			tmpobjw=Math.round(tmpzoom*Number(bc_getObjSValue(thisobj.prefSib[0][0],"width"))/100);
			tmpobjh=Math.round(tmpzoom*Number(bc_getObjSValue(thisobj.prefSib[0][0],"height"))/100);
		}else if(param=="2"){
			tmpzoom=Math.round(tmpw*100/Number(bc_getObjSValue(thisobj.prefSib[0][0],"width")))-1;
			tmphzoom=Math.round(tmph*100/Number(bc_getObjSValue(thisobj.prefSib[0][0],"height")))-1;
			tmpobjw=Math.round(tmpzoom*Number(bc_getObjSValue(thisobj.prefSib[0][0],"width"))/100);
			tmpobjh=Math.round(tmphzoom*Number(bc_getObjSValue(thisobj.prefSib[0][0],"height"))/100);
		}
		tmpw=106*tmpobjw/100;
		tmph=106*tmpobjh/100;
		bc_setObjSValue(thisobj.prefSib[0][0],"left",tmpw/2-tmpobjw/2);
		bc_setObjSValue(thisobj.prefSib[0][0],"top",tmph/2-tmpobjh/2);
		bc_setObjSValue(thisobj.prefSib[0][0],"width",tmpobjw);
		bc_setObjSValue(thisobj.prefSib[0][0],"height",tmpobjh);
		}
		if(p_curobj.className.toLowerCase().indexOf("forgrd_")>-1){
			//thisobj.nxtSib.p_curobj.nextSibling;
			//thisobj.nextObj=p_curobj.nextSibling.nextSibling;
		}else{
			thisobj.nextObj=p_curobj.nextSibling;	
		}
		thisobj.obj.push(new Array(p_curobj,bc_getObjSValue(p_curobj,"left"),bc_getObjSValue(p_curobj,"top"),bc_getObjSValue(p_curobj,"width"),bc_getObjSValue(p_curobj,"height")));
		if(tmpzoom==0){
			if(tmpw*100/Math.round(Number(bc_getObjSValue(thisobj.obj[0][0],"width")))>tmph*100/Math.round(Number(bc_getObjSValue(thisobj.obj[0][0],"height")))){
				tmpzoom=Math.round(tmph*100/Number(bc_getObjSValue(thisobj.obj[0][0],"height")))-2;
			}else{
				tmpzoom=Math.round(tmpw*100/Number(bc_getObjSValue(thisobj.obj[0][0],"width")))-2;
			}		
			if(param=="1"){
				tmpobjw=Math.round(tmpzoom*Number(bc_getObjSValue(thisobj.obj[0][0],"width"))/100);
				tmpobjh=Math.round(tmpzoom*Number(bc_getObjSValue(thisobj.obj[0][0],"height"))/100);
			}else if(param=="2"){
				tmpobjw=tmpw;
				tmpobjh=tmph;
			}		
			tmpw=106*tmpobjw/100;
			tmph=106*tmpobjh/100;
		}else{
			if(param=="1"){
				tmpobjw=Math.round(tmpzoom*Number(bc_getObjSValue(thisobj.obj[0][0],"width"))/100);
				tmpobjh=Math.round(tmpzoom*Number(bc_getObjSValue(thisobj.obj[0][0],"height"))/100);
			}else if(param=="2"){
				tmpobjw=Math.round(tmpzoom*Number(bc_getObjSValue(thisobj.obj[0][0],"width"))/100);;
				tmpobjh=Math.round(tmphzoom*Number(bc_getObjSValue(thisobj.obj[0][0],"height"))/100);;
			}
		}
		bc_setObjSValue(thisobj.obj[0][0],"left",tmpw/2-tmpobjw/2);
		bc_setObjSValue(thisobj.obj[0][0],"top",tmph/2-tmpobjh/2);
		bc_setObjSValue(thisobj.obj[0][0],"width",tmpobjw);
		bc_setObjSValue(thisobj.obj[0][0],"height",tmpobjh);
		if(p_curobj.childNodes){
			for(var i=0;i<p_curobj.childNodes.length;i++){
				thisobj.mkBigSub(p_curobj.childNodes[i],tmpzoom);
			}
		}
		if(bc_getObjSValue(thisobj.bgr,"width")==null){
			thisobj.bgr.style.width=String(tmpw)+"px";
		}else{
			bc_setObjSValue(thisobj.bgr,"width",tmpw);
		}
		if(bc_getObjSValue(thisobj.bgr,"height")==null){
			thisobj.bgr.style.height=String(tmph)+"px";
		}else{
			bc_setObjSValue(thisobj.bgr,"height",tmph);
		}
		if(bc_getObjSValue(thisobj.txt,"left")==null){
			thisobj.txt.style.left=String(tmpw/2-50)+"px";
		}else{
			bc_setObjSValue(thisobj.txt,"left",tmpw/2-50);
		}		
		thisobj.bgr.appendChild(thisobj.obj[0][0]);
		if(bc_getObjSValue(thisobj.prevbt.alink,"left")==null){
			thisobj.prevbt.alink.style.left=String(tmpw/2-50-30)+"px";
		}else{
			bc_setObjSValue(thisobj.prevbt.alink,"left",tmpw/2-50-30);
		}	
		if(bc_getObjSValue(thisobj.nxtbt.alink,"left")==null){
			thisobj.nxtbt.alink.style.left=String(tmpw/2+50)+"px";
		}else{
			bc_setObjSValue(thisobj.nxtbt.alink,"left",tmpw/2+50);
		}
		if(thisobj.dlg!=null){
			thisobj.dlg.setPos();
		}
		for(var i=0;i<p_allobj.length;i++){
			if(p_curobj==p_allobj[i]){
				if(thisobj.txt.childNodes.length>0){
					thisobj.txt.removeChild(thisobj.txt.childNodes[0]);
				}
				thisobj.txt.appendChild(document.createTextNode(String(i+1)+"/"+String(p_allobj.length)));
				if(i==0){
					thisobj.prevbt.alink.style.display="none";
				}else{
					thisobj.prevbt.alink.style.display="inline";
				}
				if(i==p_allobj.length-1){
					thisobj.nxtbt.alink.style.display="none";
				}else{
					thisobj.nxtbt.alink.style.display="inline";
				}
				break;
			}
		}
		if(p_curobj.className.toLowerCase().indexOf("forgrd_")>-1){
			try{
				if((isIE())&&(!isIEM())){
					p_curobj.nextSibling.style.cursor="url("+rtPh()+btfolder+"zminus.cur),pointer";
				}else{
					p_curobj.nextSibling.style.cursor="url("+rtPh()+btfolder+"zminus.png),pointer";
				}
			}catch(e){
				//nothing
			}
			p_curobj.nextSibling.title="schliessen";
			p_curobj.nextSibling.onmouseup=function(p_event){
				thisobj.dlg.close();
			};
		}else{
			try{
				if((isIE())&&(!isIEM())){
					p_curobj.style.cursor="url("+rtPh()+btfolder+"zminus.cur),pointer";
				}else{
					p_curobj.style.cursor="url("+rtPh()+btfolder+"zminus.png),pointer";
				}
			}catch(e){
				//nothing
			}
			p_curobj.title="schliessen";
			p_curobj.onmouseup=function(p_event){
				thisobj.dlg.close();
			};
		}
	};
	thisobj.bgr.appendChild(thisobj.prevbt);
	thisobj.bgr.appendChild(thisobj.nxtbt);
	thisobj.prevbt=new Bt(thisobj.prevbt,thisobj);
	thisobj.nxtbt=new Bt(thisobj.nxtbt,thisobj);
	thisobj.setBig(p_obj);
	thisobj.dlg=new DLG(thisobj.bgr,p_dlgcl,p_alpha,thisobj);
	thisobj.resetObj=function(){
		if(p_obj.className.toLowerCase().indexOf("bckgrd_")>-1){
			bc_setObjSValue(thisobj.prefSib[0][0],"left",thisobj.prefSib[0][1]);
			bc_setObjSValue(thisobj.prefSib[0][0],"top",thisobj.prefSib[0][2]);
			bc_setObjSValue(thisobj.prefSib[0][0],"width",thisobj.prefSib[0][3]);
			bc_setObjSValue(thisobj.prefSib[0][0],"height",thisobj.prefSib[0][4]);
			thisobj.parent.insertBefore(thisobj.prefSib[0][0],thisobj.nextObj);
		}
		if(p_obj.className.toLowerCase().indexOf("forgrd_")>-1){
			//nothing
		}else{
			//nothing
		}
		bc_setObjSValue(thisobj.obj[0][0],"left",thisobj.obj[0][1]);
		bc_setObjSValue(thisobj.obj[0][0],"top",thisobj.obj[0][2]);
		bc_setObjSValue(thisobj.obj[0][0],"width",thisobj.obj[0][3]);
		bc_setObjSValue(thisobj.obj[0][0],"height",thisobj.obj[0][4]);
		thisobj.parent.insertBefore(thisobj.obj[0][0],thisobj.nextObj);
		for(var i=0;i<thisobj.subobj.length;i++){
			bc_setObjSValue(thisobj.subobj[i][0],"left",thisobj.subobj[i][1]);
			bc_setObjSValue(thisobj.subobj[i][0],"top",thisobj.subobj[i][2]);
			bc_setObjSValue(thisobj.subobj[i][0],"width",thisobj.subobj[i][3]);
			bc_setObjSValue(thisobj.subobj[i][0],"height",thisobj.subobj[i][4]);
		}
		thisobj.mkSmall();
	};
	thisobj.clDLG=function(p_dlg){
		thisobj.resetObj();
	};
}
