function printFilecontent(dieSeite,responseTo){var req=null;try{req=new XMLHttpRequest();}
catch(ms){try{req=new ActiveXObject("Msxml2.XMLHTTP");}
catch(nonms){try{req=new ActiveXObject("Microsoft.XMLHTTP");}
catch(failed){req=null;}}}
if(req==null)
alert("Ajax Fehler req=Null");req.open("GET",dieSeite,true);req.onreadystatechange=function(){switch(req.readyState){case 4:if(req.status!=200){alert("Ajax-Fehler! Errcode: "+req.status);}else{document.getElementById(responseTo).innerHTML=req.responseText;}
break;default:return false;break;}};req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");req.send(null);}
var domWrite=(function(){var dw=document.write,dwln=document.writeln,myCalls=[],t='',checkMs=100,maxMs=100,maxT;function getid(){var myDate=new Date();return'_'+myDate.getTime()+'_'+Math.random().toString().replace(/\./,'');}
function startnext(){if(myCalls.length>0){try{console.log('function startnext: Status='+myCalls[0].stat)}catch(e){};switch(myCalls[0].stat){case 0:try{console.log('startnext.start')}catch(e){};myCalls[0].start();startnext();break;case 1:try{console.log('startnext.startload')}catch(e){};myCalls[0].startload();break;case 4:try{console.log('startnext.resume')}catch(e){};myCalls[0].resume();break;case 5:myCalls.shift();try{console.log('startnext.end # of myCalls left: '+myCalls.length)}catch(e){};startnext();break;}}
else{try{console.log('startnext.END ALL: restore document.write functions')}catch(e){};document.write=dw;document.writeln=dwln;}}
function fillStack(pCall){try{console.log('function fillStack()')}catch(e){};var regexp1=/[^'"]*<script[^>]*>([\s\S]*?)<\/script[^>]*>[^'"]*/gi,regexp2=/src[^=]*=[^'"]*['"]([^'"]*?)['"]/i,regexp3=/<script[^>]*>/gi,hasScript;try{console.log(pCall.buf)}catch(e){};while(pCall.buf!==''){hasScript=(pCall.buf.toLowerCase()).indexOf('<script')>-1?true:false;if(!hasScript){try{console.log('-->fillStack: ONLY HTML')}catch(e){};pCall.stack.push({type:'HTML',str:pCall.buf});pCall.buf='';}
else{var i=(pCall.buf.toLowerCase()).indexOf('<script');if(i!==0){try{console.log('fillStack.HTML PART: '+pCall.buf.substr(0,i))}catch(e){};pCall.stack.push({type:'HTML',str:pCall.buf.substr(0,i)});pCall.buf=pCall.buf.substr(i);}
else{if(((pCall.buf.toLowerCase()).indexOf('src')===-1)||((pCall.buf.toLowerCase()).indexOf('src')>pCall.buf.indexOf('>'))){var myMatch=pCall.buf.match(regexp1),myCode=' '+myMatch+' ';myCode=myCode.replace(/[^'"]*<script[^>]*>/gi,'');myCode=myCode.replace(/<\/script[^>]*>[^'"]*/gi,'');try{console.log('fillStack.INLINE CODE: '+myCode)}catch(e){};pCall.stack.push({type:'CODE',str:myCode});pCall.buf=pCall.buf.substr(pCall.buf.indexOf('>')+1);pCall.buf=pCall.buf.substr(myMatch.length);pCall.buf=pCall.buf.substr(pCall.buf.indexOf('>')+1);}
else{var myMatch=pCall.buf.match(regexp2);try{console.log('fillStack.FILE: '+myMatch[1])}catch(e){};pCall.stack.push({type:'FILE',str:myMatch[1]});if(pCall.buf.indexOf('/>')<pCall.buf.indexOf('>')){pCall.buf=pCall.buf.substr(pCall.buf.indexOf('>')+1);pCall.buf=pCall.buf.substr(pCall.buf.indexOf('>')+1);}
else{pCall.buf=pCall.buf.substr(pCall.buf.indexOf('/>')+2);}}}}}
outputStack(pCall);}
function outputStack(pCall){try{console.log('function outputStack()')}catch(e){};while(pCall.stack.length>0){var myPart=pCall.stack.shift();switch(myPart.type){case'HTML':try{console.log('outputstack.HTML: '+myPart.str)}catch(e){};pCall.e.innerHTML=pCall.e.innerHTML+myPart.str;break;case'CODE':try{console.log('outputstack.CODE: '+myPart.str)}catch(e){};eval(myPart.str);pCall.e.innerHTML=pCall.e.innerHTML+pCall.buf;pCall.buf='';pCall.oldbuf='';break;case'FILE':try{console.log('outputstack.FILE: '+myPart.str)}catch(e){};pCall.pause();domWrite(pCall.e,myPart.str,null,(maxMs||1000),true);return;break;}}
pCall.stop();startnext();}
function testDone(pCall){var myCall=pCall;return function(){try{console.log('function testDone()')}catch(e){};if(myCall.buf!==myCall.oldbuf){myCall.oldbuf=myCall.buf;t=window.setTimeout(testDone(myCall),myCall.ms);try{console.log('testdone: still processing')}catch(e){};}
else{try{console.log('testdone: start stack execution')}catch(e){};fillStack(myCall);}}}
function MyCall(pDiv,pSrc,pOnBefore,pContinue,pForce){this.e=(typeof pDiv=='string'?document.getElementById(pDiv):pDiv),this.f=pOnBefore||function(){},this.cont=pContinue||false,this.force=pForce||false,this.stat=0,this.dw,this.src=pSrc,this.buf='',this.oldbuf='',this.ms=checkMs||200,this.scripttag,this.t,this.stack=[];}
MyCall.prototype={start:function(){try{console.log('myCall.start...')}catch(e){};this.stat=1;},startload:function(){try{console.log('myCall.startload...')}catch(e){};this.stat=2;this.f.apply(window);var that=this;document.write=(function(){var o=that,cb=testDone(o);if(o.cont!==false){try{console.log('myCall.startload --> start foreign script timeout')}catch(e){};window.setTimeout(function(){o.stat=5;fillStack(o);},o.cont);}
return function(pString){o.stat=3;if(o.cont===false){window.clearTimeout(o.t);}
o.oldbuf=o.buf;o.buf+=pString;if(o.cont===false){o.t=window.setTimeout(cb,o.ms);}};})();document.writeln=document.write;this.dw=document.write;this.dwln=document.writeln;var s=document.createElement('script');s.setAttribute('language','javascript');s.setAttribute('type','text/javascript');s.setAttribute('src',this.src);document.getElementsByTagName('head')[0].appendChild(s);try{console.log('myCall.startload --> script appended: '+this.src)}catch(e){};},resume:function(){try{console.log('myCall.resume... document.write(), .writeln() reset to object functions...')}catch(e){};this.stat=3;document.write=this.dw;document.writeln=this.dwln;outputStack(myCalls[0]);},pause:function(){try{console.log('myCall.pause...')}catch(e){};this.stat=4;},stop:function(){try{console.log('myCall.stop...')}catch(e){};window.clearTimeout(this.t);this.stat=5;}}
return function(pDiv,pSrc,pFunc,pContinue,pForce){if(myCalls.length>0&&pForce!==true){try{console.log('==> domWrite call POSTPONED: '+pDiv)}catch(e){};window.setTimeout(function(){domWrite(pDiv,pSrc,pFunc,pContinue);},1000);return;}
try{console.log('==> domWrite call: '+pSrc)}catch(e){};var c=new MyCall(pDiv,pSrc,pFunc,pContinue);if(pContinue){myCalls.unshift(c);startnext();}
else{myCalls.push(c);}
try{console.log('==> ADDED # of myCalls now: '+myCalls.length)}catch(e){};if(myCalls.length===1){startnext();}}})();
