//######
//### 
//### soopapop
function soopaPopSetup() {
	var a;
	for (var i = 0; (a = document.links[i]); i++) {
		if (a.target && a.target.indexOf("_soopaPop") == 0) {
			a.onclick = soopaPop;
		}
	}
}

function soopaPop() {
	var a = this.target.split(":");
	var sFeatures = a[1];
	window.open(this.href, a.length > 2 ? a[2] : String((new Date()).getTime()), sFeatures);
	return false;
	alert("hi")
}

//######
//### 
//### generic rollover
function swapImgRestore() {
  var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function swapImage() {
  var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function rO(obj,loImg,hiImg){var msie=(document.all&&document.styleSheets)?true:false;var objRef=(msie)?obj.parentNode.parentNode:obj;
if(msie){objRef.style.filter=objRef.style.filter.split(loImg).join(hiImg);}else{var imgSrcName=loImg.split('/');var imgOverName=hiImg.split('/');objRef.src=objRef.src.split(imgSrcName[imgSrcName.length-1]).join(imgOverName[imgOverName.length-1]);}}

//######
//### 
//### preloader for rollover images
function iP(){
	if (doc.images){
	tImgs=new Array();
	for(var i=0;i<doc.images.length;i++){if(regEx.test(doc.images[i].src))tImgs[tImgs.length]=doc.images[i].src;var txt=doc.images[i].src;if(txt.indexOf('submit')>=0)alert(doc.images[i].src);}}for (var j=0;j<tImgs.length;j++){tImg_lo=new Image();tImg_hi=new Image();tImg_lo.src=tImgs[j];tImg_hi.src=tImgs[j].split('_lo'+RegExp.$1).join('_hi'+RegExp.$1);}}
	var doc=document;var regEx=/_lo([_|\.])/;
	//doc.write('<scr'+'ipt for=window event=onload language="JScr'+'ipt">');doc.write('iP();');doc.write('<\/scr'+'ipt>');if(window.addEventListener!=null){window.addEventListener("load",iP,true);}


//######
//### 
//### hide/show form elements
function showElement(whichOne){
	if(document.getElementById(whichOne).style.display=="none"){
		document.getElementById(whichOne).style.display="block";
	}
	else {
		document.getElementById(whichOne).style.display="none";
	}
}


//######
//### 
//###  afp41 (advanced flexible popup, version 4.1)
var afpl = false;function gpd(dv,wh){absV=0;calV=parseInt(dv);calV=(calV<1)?1:(calV>100)?100:calV;absV=Math.round((calV * (eval('screen.'+wh)/100)));return absV;}function gsc(wh){cp = Math.round(eval('screen.'+wh+'-openPopup_'+wh)/2);return cp;}function pps(){aa=arguments[0].split(',');rs=',left='+aa[0]+',top='+aa[1];return rs;}function wps(){aa=arguments[0].split(',');sb=false;tb=false;st=false;lb=false;di=false;mb=false;rz=false;for (i=0;i<aa.length;i++){sb = (aa[i].indexOf('scrollbars') != -1)? aa[i]:(!sb)? 'scrollbars=no':sb;tb = (aa[i].indexOf('toolbar') != -1)? aa[i]:(!tb)? 'toolbar=no':tb;st = (aa[i].indexOf('status') != -1)? aa[i]:(!st)? 'status=no':st;lb = (aa[i].indexOf('location') != -1)? aa[i]:(!lb)? 'location=no':lb;di = (aa[i].indexOf('directories') != -1)? aa[i]:(!di)? 'directories=no':di;mb = (aa[i].indexOf('menubar') != -1)? aa[i]:(!mb)? 'menubar=no':mb;rz = (aa[i].indexOf('resizable') != -1)? aa[i]:(!rz)? 'resizable=no':rz;}rs=','+sb+','+tb+','+st+','+lb;return rs;}function pds(){aa = arguments[0].split(',');bName=navigator.appName;bApp=navigator.appVersion;bVer=parseInt(navigator.appVersion);ns4=(document.layers||(bName.indexOf('Netscape')>=0&&bVer<5))?true:false;ie4=(document.all&&document.styleSheets)?true:false;ns5=(document.getElementById&&!document.all)?true:false;op5=(document.all&&!document.styleSheets)?true:false;win=(bApp.indexOf('Win')>=0)?true:false;mac=(bApp.indexOf('Mac')>=0)?true:false;diw =(ie4&&win)?aa[0]:(ns4&&win)?aa[2]:(ns5&&win)?aa[4]:(op5&&win)?aa[6]:(ie4&&mac)?aa[8]:(ns4&&mac)?aa[10]:(ns5&&mac)?aa[12]:(op5&&mac)?aa[14]:0;dih=(ie4&&win)?aa[1]:(ns4&&win)?aa[3]:(ns5&&win)?aa[5]:(op5&&win)?aa[7]:(ie4&&mac)?aa[9]:(ns4&&mac)?aa[11]:(ns5&&mac)?aa[13]:(op5&&mac)?aa[15]:0;pw=parseInt(openPopup_width)+parseInt(diw);ph=parseInt(openPopup_height)+parseInt(dih);rs='width='+pw+',height='+ph;return rs;}function openPopup(){pa=new Array('customPosition','customParams','browserDiff');for (i=0;i<pa.length;i++) eval('openPopup_'+pa[i]+'=false');openPopup_popupUrl = arguments[0];openPopup_width=(typeof(arguments[1])=='string'&&arguments[1].indexOf('%')>-1)?gpd(arguments[1],'width'):arguments[1];openPopup_height=(typeof(arguments[2])=='string'&&arguments[2].indexOf('%')>-1)?gpd(arguments[2],'height'):arguments[2];opo=(arguments.length>3)?arguments[3]:'';if(opo!=''){opo=opo.slice(1,opo.length);opoArray = opo.split('-');for (i=0;i<opoArray.length;i++){for (j=0;j<pa.length;j++){eval('openPopup_'+pa[j]+' = (opoArray[i].indexOf("'+pa[j]+'") != -1 && typeof(opoArray[i]) == "string")? opoArray[i].substring(opoArray[i].indexOf("[")+1,opoArray[i].indexOf("]")):(!openPopup_'+pa[j]+')? false:openPopup_'+pa[j]);}}}ps=(!openPopup_browserDiff)?'width='+openPopup_width+',height='+openPopup_height:pds(openPopup_browserDiff);ps+=(!openPopup_customPosition)?',left='+gsc('width')+',top='+gsc('height'):pps(openPopup_customPosition);ps+=(!openPopup_customParams)?',scrollbars=no,toolbar=no,status=no,location=no,directories=no,menubar=no,resizable=no':wps(openPopup_customParams);var poa=new Array();var time=new Date();var rnd=time.getTime();var pna='POPUP'+rnd;poa[poa.length]=window.open(openPopup_popupUrl,pna,ps);if (typeof(poa[poa.length-2]) == 'object') poa[poa.length-2].close();poa[poa.length-1].focus();}var afpl = true;



//######
//### 
//### geoeffnete pro block wieder ausblenden, aktiven einblenden
function fZusatzSammler(whichOne,whichArray,whichFunction){
	var whichOneFound=false;
	for(var i=0;i<whichArray.length;i++){
		if(whichArray[i]==whichOne){
			
			whichOneFound=true;
		} else {
			whichFunction(whichArray[i],false);
		}
	}
	if(!whichOneFound){
		whichArray.push(whichOne);
	}
	whichFunction(whichOne,(document.getElementById(whichOne+"_div").style.display=="none"));
}
//
//### sammelwerte pro tabellenblock
var Zusatz1=new Array();
var Zusatz2=new Array();
var Zusatz2Active=new Array();
//### hide/show tarif elements block1
function ZusatzBlock1(whichOne,show){
	if(show){
		document.getElementById(whichOne+"_div").style.display="block";
		document.getElementById(whichOne+"_heightFix").style.display="block";
		document.getElementById(whichOne+"_link").style.color="#000000";
		document.getElementById(whichOne+"_preis").style.color="#0772A7";
		document.getElementById(whichOne+"_leistung").style.display="none";
		document.getElementById(whichOne+"_input").style.background="#FCFCF8";
	} else{
		document.getElementById(whichOne+"_div").style.display="none";
		document.getElementById(whichOne+"_heightFix").style.display="none";
		document.getElementById(whichOne+"_link").style.color="#0772A7";
		document.getElementById(whichOne+"_preis").style.color="#666666";
		document.getElementById(whichOne+"_leistung").style.display="block";
		document.getElementById(whichOne+"_input").style.background="#DBDBD5";
	}
}
function ZusatzBlock2(whichOne,show){
	if(show){
		document.getElementById(whichOne+"_div").style.display="block";
		document.getElementById(whichOne+"_heightFix").style.display="block";
		document.getElementById(whichOne+"_link").style.color="#000000";
		document.getElementById(whichOne+"_preis").style.color="#0772A7";
		document.getElementById(whichOne+"_leistung").style.display="none";
		document.getElementById(whichOne+"_input").style.background="#FCFCF8";
	} else{
		document.getElementById(whichOne+"_div").style.display="none";
		document.getElementById(whichOne+"_heightFix").style.display="none";
		document.getElementById(whichOne+"_link").style.color="#0772A7";
		document.getElementById(whichOne+"_preis").style.color="#666666";
		document.getElementById(whichOne+"_leistung").style.display="block";
		document.getElementById(whichOne+"_input").style.background="#DBDBD5";
	}
}
function ZusatzBlock2Active(whichOne,show){
	if(show){
		document.getElementById(whichOne+"_div").style.display="block";
		document.getElementById(whichOne+"_heightFix").style.display="block";
		document.getElementById(whichOne+"_leistung").style.display="none";
	} else{
		document.getElementById(whichOne+"_div").style.display="none";
		document.getElementById(whichOne+"_heightFix").style.display="none";
		document.getElementById(whichOne+"_leistung").style.display="block";
	}
}
//### pruefen
function showZusatzBlock1(whichOne){
	fZusatzSammler(whichOne,Zusatz1,ZusatzBlock1);
}
function showZusatzBlock2(whichOne){
	fZusatzSammler(whichOne,Zusatz2,ZusatzBlock2);
}
function showZusatzBlock2Active(whichOne){
	fZusatzSammler(whichOne,Zusatz2Active,ZusatzBlock2Active);
}
//### pop-up window
function openWindow (url) {
 fenster = window.open(url, "window1", "width=600,height=400,status=yes,scrollbars=yes,resizable=yes");
 fenster.focus();
}
