// *******************************************************************************************************************
// **                                                pg_lib2	v5.4                                                  **
// **                                                                                                               **
// **          Copyright 2002 by ProGraphics, Aachen, Germany - Author F. Kuester - All Rights Reserved             **
// *******************************************************************************************************************

document.debug=0; if (!document.debug) onerror = stopError; function stopError() { return true; } function PG_ChangeTitle(txt) { top.document.title = txt; } function PG_Validate() { var args = PG_valid.arguments, o = MM_findObj(args[0]), v = args[1], stopp=0; if (o.value) { a = o.value;  for (var i = 0; i < a.length; i++) if (v.indexOf(a.charAt(i)) < 0 ) stopp++; } else { stopp++; } return (stopp)? 0:1; } function PG_ValidateVar(s,z) { var stopp=0; for (var i = 0; i < s.length; i++) { if (z.indexOf(s.charAt(i)) < 0 ) stopp++; } return (stopp)? 0:1; } function getx(l){ if (l.offsetParent) return (l.offsetLeft + getx(l.offsetParent)); else return (l.offsetLeft); } function gety(l){ if (l.offsetParent) return (l.offsetTop + gety(l.offsetParent)); else return (l.offsetTop); } function PG_GetPicSize(n,p){ var a; var obj = MM_findObj(n); if (p == "x"){ a = obj.x; if (!a) a = getx(obj); } if (p == "y"){ a = obj.y; if (!a) a = gety(obj); } if (p == "h"){ a = obj.height; } if (p == "w"){ a = obj.width; } if(a) return a;  else if (document.debug) if (!obj) alert('pic '+n+' is no object'); } function PG_SetPicSize(o,x,y){ var obj = MM_findObj(o); if(x) obj.width = x; if (y) obj.height = y; return true; } function PG_ClipLayer(layer_name,x,y,w,h) { obj=MM_findObj(layer_name);  if (obj.style){ var sp=" ", a="rect("+y+sp+w+sp+h+sp+x+sp+")"; obj.style.clip = a; } else { obj.clip.left=x;obj.clip.right=w; obj.clip.top=y; obj.clip.bottom=h;} } function PG_SetLayerSize() { arg = PG_SetLayerSize.arguments; obj=MM_findObj(arg[0]); if (obj){ if (obj.style) obj=obj.style; if(arg[1]) obj.left=arg[1];if(arg[2]) obj.top=arg[2];if(arg[4]) obj.height=arg[4];if(arg[3]) obj.width=arg[3];} if (arg[5]) PG_ClipLayer(arg[0],arg[6],arg[7],arg[8],arg[9]); } function PG_GetLayerSize(n,p) { var a; obj = MM_findObj(n);  if (p == "h") { if (obj.document.height) a = obj.document.height; else if (obj.scrollHeight) a = obj.scrollHeight; } if (obj.style) obj=obj.style; if (p == "x") a = obj.left; if (p == "y") a = obj.top; if (p == "h" && !a) a = obj.height; if (p == "w") a = obj.width; if(a) return a;  else if (document.debug) if (!obj) alert('layer '+n+' is no object'); } function PG_ShowLayer(layer_name,v) { if (v!='show' && v!='hide') v=(v)?'show':'hide'; obj=MM_findObj(layer_name);  if (obj.style) { obj=obj.style;   v=(v=='show')?'visible':(v=='hide')?'hidden':v; } obj.visibility=v;  if (!document.PG_sl) document.PG_sl=new Array; document.PG_sl[document.PG_sl.length]=[layer_name,obj.visibility]; } function PG_ShowLayerRestore() { if (!document.PG_sl) document.PG_sl=new Array;  var i,x,vs,t,pg=document.PG_sl; for(i=0;i< pg.length;i++){  x=pg[i][0]; obj=MM_findObj(x); t=pg[i][1]; v=(t=='visible')?'show':'hide';  if (obj) {if (obj.style){ obj=obj.style; v=t; }  obj.visibility=v; } }document.PG_sl=new Array; } function PG_PicPosLayer() { var l,p,x,y,x_off,y_off,arg = PG_PicPosLayer.arguments; l = arg[0]; p = arg[1]; x_off = arg[2]; y_off = arg[3]; s = arg[4];  x = PG_GetPicSize(p,'x'); if (!x) x=0; y = PG_GetPicSize(p,'y'); if (!y) y=0; PG_SetLayerSize(l,x+x_off,y+y_off,0,0); if (s) PG_ShowLayer(l,1); } function PG_FindFrame() {  var n,p,i,x,t,arg =  PG_FindFrame.arguments; n = arg[0]; p = arg[1]; if (!p) p = top.frames; if (p){ if(p.length && !p[n]) {  for (i=0; i < p.length; i++) { t = p[i]; x = PG_FindFrame(n,t.frames) } } else if (p[n]) x=p[n]; return x } } function PG_GoToURL() { var t,f,args=PG_GoToURL.arguments; document.PG_ReturnValue = false; f = args[0]; t = PG_FindFrame(f); if (t) t.document.location.href = args[1];  if (args[0]=="self" || !args[0]) document.location = args[1]; if (args[0]=="blank") MM_openBrWindow(args[1],'temp','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes'); if (args[0]=="top") if (top) document.location.href = args[1]; } function PG_Resize() { var fra,loc,fun,tim,i,fn,lo,fu,ti,topp = top.document;  if (topp.pg_layers_var) { fra = topp.PG_fra; loc = topp.PG_loc; fun = topp.PG_fun; tim = topp.PG_tim; topp.PG_fra = new Array; topp.PG_loc = new Array; topp.PG_fun = new Array; topp.PG_tim = new Array; if (fra.length){ for (i=1; i < fra.length; i++){ fn = fra[i]; lo = loc[fn]; fu = fun[i]; ti = tim[i]; if(fn && lo) {  var temp = PG_FindFrame(fn); if (temp) temp.location.reload(); if (MM_checkBrowser(5.0,1,2,4.0,1,2,2,'yes','no',1) !="yes") PG_GoToURL(fn,lo,i,fu,ti); } } } } else { location.reload(); } } function PG_ReloadPage() { var n,i,l,f,fn=self.name,t,x,topp = top.document, arg = PG_ReloadPage.arguments;  i = arg[0]; l = arg[1]; f = arg[2]; t = arg[3]; if(!t) t = 10; sr = arg[4]; if (!fn) fn="self"; if (i==true) { if (l) { if (!topp.PG_fra) topp.PG_fra = new Array;  if (!topp.PG_fun) topp.PG_fun = new Array; if (!topp.PG_loc) topp.PG_loc = new Array; if (!topp.PG_tim) topp.PG_tim = new Array; x = topp.PG_fra.length+1; if (!topp.PG_loc[fn]) 	{ x = topp.PG_fra.length+1; topp.PG_fra[x] = fn;	topp.PG_fun[x] = f; topp.PG_tim[x] = t;} topp.PG_loc[fn] = document.location.href; } topp.pg_layers_var=l; if (sr) onresize = PG_Resize; }  } function PG_GetUrlVar(n) { var x = document.location.href,end=99999,i,a,t,ia=0,ie=0,aus,l=n.length+1;  for (i=0; i < (x.length); i++){ t=x.substr(i,1);  if (t == "?" || t == "&"){ a=x.substr(i+1,l); if (a == n+"=") {ia=i+l+1; i=end;} } } for (i=ia; i < (x.length); i++){ t=x.substr(i,1); if (t != "?" && t != "&") ie=i; else i=end; } if (ia && ie) return x.substr(ia,(ie+1-ia));  } function PG_PosSVar(n,o,x,s1,s2,s3) { var end=99999,i,is,a,t,ia=0,ie=0,aus,l=n.length+s1.length+s3.length;  for (i=0; i < (x.length); i++){ t=x.substr(i,1); if (t == s1 || t == s2){ a=x.substr(i,l);  if (a == s1+n+s3 || a == s2+n+s3) { ia=i; i=end; is=1; } } } if (is){ for (i=ia+1; i < (x.length); i++){ t=x.substr(i,1); if (t != s1 && t != s2) ie=i+1; else i=end; }} if (o==1) return (ia); if (o==2 && ie) return (ie);  } function PG_GetUrlVar(n) { var x = document.location.href, s1='?', s2='&', s3='='; var an = PG_PosSVar(n,1,x,s1,s2,s3)+n.length+s1.length+s3.length, en =  PG_PosSVar(n,2,x,s1,s2,s3);  if (en) return x.substring(an,en);  } function PG_ClearSVar(n) { (top)? top.window.name ="_"+n : window.name ="_"+n;  } function PG_AlertWinName() { (top)? alert (top.window.name) : alert (window.name);  } function PG_GetSVar(n) { var wn = (top)? top.window.name:window.name, s1='_', s2=s1, s3='XOX',v,t,temp=""; var an = PG_PosSVar(n,1,wn,s1,s2,s3)+n.length+s1.length+s3.length, en =  PG_PosSVar(n,2,wn,s1,s2,s3);  if (en) { v = wn.substring(an,en);  for (i=0; i < v.length; i++){ t = v.substr(i,3); t2= v.substr(i,1); if (t=="XO0") {t2=" "; i+=2;} if (t=="XO1") {t2="."; i+=2;} if (t=="XO2") {t2=","; i+=2;} if (t=="XO3") {t2="-"; i+=2;} if (t=="XO4") {t2="%"; i+=2;} temp+=t2; } return temp; } } function PG_WriteSVar(n,v) { var acept ='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 -,.%+#@*',pos; if (PG_ValidateVar(v,acept)){ var wn = (top)? 1:0, x = (top)? top.window.name:window.name,s1='_', s2=s1, s3='XOX', t, i,temp="";  v = String(v); for (i=0; i < v.length; i++){ t = v.substr(i,1); pos = (acept.indexOf(t)); if (pos >= 62) t='XO'+(pos-acept.indexOf(' ')); temp+=t; } v=temp; var an = PG_PosSVar(n,1,x,s1,s2,s3), en =  PG_PosSVar(n,2,x,s1,s2,s3); if (en) x = x.substring(0,an)+x.substring(en,(x.length));   (top)? top.window.name = x+s1+n+s3+v : window.name = x+s1+n+s3+v;  }else{ if (document.debug) alert(' Ungueltiges Zeichen bei WriteSVar in Zeichenfolge - '+v); } } function PG_BgColor(){ var x,arg=PG_BgColor.arguments,f=arg[0],fn=arg[1];  if (fn) { x=PG_FindFrame(fn); if (x) x.document.bgColor=f; } else self.document.bgColor=f; } function PG_GetValueOf(n){ var o=MM_findObj(n); if (o.value) return o.value; } function PG_SetValueOf(n,v){ var o=MM_findObj(n); if (o) o.value=v; } function PG_CheckIn(a,b){ for (var i=0; i < (b.length); i++) if (b.substr(i,a.length)==a) return 1; return 0; } function PG_Timer(f,t){ if (!document.PG_timerA) document.PG_timerA = new Array;  document.PG_timerA[document.PG_timerA.length] = setTimeout(f,t); } function PG_ClearTimer(){ if (document.PG_timerA) for (var i=0; i < (document.PG_timerA.length); i++) clearTimeout(document.PG_timerA[i]); document.PG_timerA = new Array;  } function PG_SwapImage() { if (!document.PG_sr) document.PG_sr=new Array; var x,a=PG_SwapImage.arguments; if ((x=MM_findObj(a[0]))!=null){if (a[2]) document.PG_sr[document.PG_sr.length]=[a[0],x.src]; x.src=a[1];} } function PG_SwapImgRestore() { var i,x,a=document.PG_sr; for(i=0;a&&i<a.length&&(x=a[i][0]);i++){ obj=MM_findObj(x);  obj.src=a[i][1]; }document.PG_sr=new Array; } function PG_CheckBrowserLang(){ return "de"; } function PG_cangeImage() {  var i,j=0,x,a=PG_cangeImage.arguments; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } function PG_Get_ScreenSize(p){ var r; if (p=="y")  r = screen.availHeight; if (p=="x")  r = screen.availWidth; return r; } function PG_Browser(p,d){ r = 0;  if (d) alert("version = "+navigator.appVersion+" : name = "+navigator.appName); if (p=="v") r = parseInt(navigator.appVersion);  else if (p=="c"){ var a = navigator.appVersion; if (a.indexOf("Windows") != -1) r = "WIN"; if (a.indexOf("Macintosh") != -1) r = "MAC"; } else {  var a = navigator.appName; if (a.indexOf("Netscape") != -1) r = "NN";  if (a.indexOf("Opera") != -1) r = "OP";  if (navigator.appVersion.indexOf("MSIE") != -1) r = "IE";} return r; } function PG_Get_WinSize(p){ var r=0; with (navigator){ if (PG_Browser('v') > 3){ var xx =(p=='x')?true:false; var b = PG_Browser(); if (b == "NN") r = (xx)? window.innerWidth:window.innerHeight; else if (b == "IE") r = (xx)? top.document.body.offsetWidth:top.document.body.offsetHeight; } } return r; } function PG_moveWIN(x,y,a){ if (a && moveTo) { if (PG_Browser() == "IE") top.window.moveTo(x,y); else window.moveTo(x,y); } else if (moveBy) { if (PG_Browser() == "IE") top.window.moveBy(x,y); else window.moveBy(x,y); } } 

// *******************************************************************************************************************
// **          Copyright 2002 by ProGraphics, Aachen, Germany - Author F. Kuester - All Rights Reserved             **
// *******************************************************************************************************************

function PG_SetLayerSize() {  
	var arg = PG_SetLayerSize.arguments, obj = MM_findObj(arg[0]); 
	if (obj.style) obj=obj.style; 
	var adder = (obj.left.indexOf("px")!=-1)? "px":"";
	if(arg[1] && obj.left		) eval("obj.left	='"+arg[1]+adder+"'");
	if(arg[2] && obj.top		) eval("obj.top		='"+arg[2]+adder+"'");
	if(arg[3] && obj.width	) eval("obj.width	='"+arg[3]+adder+"'");
	if(arg[4] && obj.height) eval("obj.height='"+arg[4]+adder+"'");
	if(arg[1] && obj.Left		) eval("obj.Left	='"+arg[1]+adder+"'");
	if(arg[2] && obj.Top		) eval("obj.Top		='"+arg[2]+adder+"'");
	if(arg[3] && obj.Width	) eval("obj.Width	='"+arg[3]+adder+"'");
	if(arg[4] && obj.Height) eval("obj.Height='"+arg[4]+adder+"'");
}

