/* Prototype JavaScript framework, version 1.6.1
* (c) 2005-2009 Sam Stephenson
*
* Prototype is freely distributable under the terms of an MIT-style license.
* For details, see the Prototype web site: http://www.prototypejs.org/
*
*--------------------------------------------------------------------------*/
var Prototype = {
Version: '1.6.1',
Browser: (function(){
var ua = navigator.userAgent;
var isOpera = Object.prototype.toString.call(window.opera) == '[object Opera]';
return {
IE: !!window.attachEvent && !isOpera,
Opera: isOpera,
WebKit: ua.indexOf('AppleWebKit/') > -1,
Gecko: ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') === -1,
MobileSafari: /Apple.*Mobile.*Safari/.test(ua)
}
})(),
BrowserFeatures: {
XPath: !!document.evaluate,
SelectorsAPI: !!document.querySelector,
ElementExtensions: (function() {
var constructor = window.Element || window.HTMLElement;
return !!(constructor && constructor.prototype);
})(),
SpecificElementExtensions: (function() {
if (typeof window.HTMLDivElement !== 'undefined')
return true;
var div = document.createElement('div');
var form = document.createElement('form');
var isSupported = false;
if (div['__proto__'] && (div['__proto__'] !== form['__proto__'])) {
isSupported = true;
}
div = form = null;
return isSupported;
})()
},
ScriptFragment: ' OR
//
}
MyCall.prototype={
start: function(){
try { console.log('myCall.start...') } catch (e) {};
this.stat=1; // status = waiting
},
startload: function(){
try { console.log('myCall.startload...') } catch (e) {};
this.stat=2; // loading-executing
this.f.apply( window ); // execute settings function
var that = this;
document.write = (function(){
var o=that,
cb=testDone( o );
if ( o.cont !== false ){ // timeout has been defined
try { console.log('myCall.startload --> start foreign script timeout') } catch (e) {};
window.setTimeout(
function(){ // after timeout fill stack
o.stat = 5; // status = done
fillStack(o); // fill div
},
o.cont
);
}
return function( pString ){ // overload document.write()
o.stat=3; // status = processing
if ( o.cont===false ){
window.clearTimeout(o.t);
}
o.oldbuf = o.buf;
o.buf += pString; // add string to buffer
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; // post-processing
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 ){ // public
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();
}
}
})();