
window.addEvent('domready', function() {
									 
	var domWrite = (function(){               // by Frank Thuerigen
	 // private 
	 // (probably helper functions for code sanitizing etc.)
	 
	 return function( pDiv, pSrc ){           // public
	 
	  var vbn = ( typeof pDiv == 'string' ?
				document.getElementById( pDiv ) :
				pDiv ),
		  s = document.createElement('script'),
		  dw = document.write,              // save document.write()
		  buf = '',                         // output string buffer
		  oldbuf = '',                      // output string buffer
		  t = '',                           // timeout
		  ms = 100;                         // milliseconds
		  
	  function evals( pString ){            // eval embedded script tags in HTML code
	   var scripts = [],
		   script,
		   regexp = /<script[^>]*>([\s\S]*?)<\/script>/gi;
	   while ((script = regexp.exec(pString))) scripts.push(script[1]);
	   scripts = scripts.join('\n');
	   if (scripts) eval(scripts);
	   }
	   
	  function exec(){                      // output & restore document.write()
	   if ( buf !== oldbuf ){
		oldbuf = buf;
		t=window.setTimeout( exec, ms );    // repeat test timeout
		}
	   else {
		vbn.innerHTML = buf;                  // write output to element
		evals( buf );                       // tbd: correct eval sequence if multiple scripts
		document.write=dw;                  // restore document.write()
		}
	   }
	   
	  document.write = function( pString ){ // overload document.write()
	   window.clearTimeout(t);
	   oldbuf = buf;
	   buf += pString;                        // add string to buffer
	   t=window.setTimeout( exec, ms );
	   }
	
	  s.setAttribute('language','javascript');
	  s.setAttribute('type','text/javascript');
	  s.setAttribute('src', pSrc);
	  document.getElementsByTagName('head')[0].appendChild(s);
	  }
	 })();
									 
	domWrite('vbn', 'http://vbn.tyumen.ru/cgi-bin/hints.cgi?vbn&ngr');
});