var xmlHttp
var thd
function showSite(page, thd, wheres, s1, s2,s3,s4,s5,s6,s7,limit)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url=page+".php"
url=url+"?thd="+thd+"&wheres="+wheres+"&search1="+s1+"&search2="+s2+"&search3="+s3+"&search4="+s4+"&search5="+s5+"&search6="+s6+"&search7="+s7+"&lim="+limit
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange= function() { stateChanged(thd);}; 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)	
}

function stateChanged(thd) { 

if (xmlHttp.readyState==1) {document.getElementById(thd).innerHTML='<img src=http://www.kreditindex.at/images/ajax-loader.gif>'}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById(thd).innerHTML=xmlHttp.responseText 
 } 
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}


function zuruck()	{
		window.history.back(1);
}



function OpenPopup(htmname, winname, xs, ys, scr) {
	eval (winname+" = window.open(htmname, winname, 'location=0,resizable=0,status=0,titlebar=1,toolbar=0,directories=0,menubar=0,scrollbars="+scr+",screenX=0,screenY=0,width="+xs+",height="+ys+"');");  eval(winname+'.focus();'); 
}


function accept_check(){
if (document.forms.mitglieder.regm.disabled == true){
  document.forms.mitglieder.regm.disabled = false;
  }else{document.forms.mitglieder.regm.disabled = true;}
}

function accept_check_r(){
if (document.forms.regform.reg.disabled == true){
  document.forms.regform.reg.disabled = false;
  }else{document.forms.regform.reg.disabled = true;}
}



function numberFormat(nStr){ 
	var prefix = prefix || ''; 
	nStr += '';
	x = nStr.split('.'); 
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) 
	x1 = x1.replace(rgx, '$1' + '.' + '$2');
	return  x1 + x2;
}


function multi_vwk(i,t,k_id, lz, fwsumme, dev, v, sp, vwk){	
	showSite('ki_subresult',i ,1, t, k_id,lz, fwsumme, dev);
	vwko=(t/0.7)*vwk/100;
	spe=t*sp/100;
	var x=Math.round(vwko+spe);
	x=numberFormat(x)
	var egydiv = document.getElementById(v);
	egydiv.innerHTML = "Spesen und Verwaltungskosten einmalig:<font color='#1a747b'><b> "+x+ "</b></font>,- €" ;
}