var projkey = '21460b3f5d3e6ca2e77a74a4798cd84d'; var myWindow=window; //Hack for milonic myWindow.disableMouseMove=true; var eventHandlerWatch=new Object(); //This should let us map from objects to handles var eventObjectHandleMap=new Object(); // and vice versa var eventHandleObjectMap=new Object(); //Event list globals var workingEvtList=""; var doneEvtList=new Array(); var workingEvtCount=0; //Page and session globals var session_id= "stss_"+Uniq(); var _old_session_id ="stss_4c818749eb158"; var page_id= "stpg_"+Uniq(); var _old_page_id = "stpg_4c818749eb543"; //iframe globals var iframe_installed=0; iframe_form = '\
\ \ \ \ \
'; //Set height and width to 0 to hide these: iframe_html='\
\
\
\ '; window.onerror=postErrorEvent; if(document.body != undefined){ document.write(iframe_form+"\n"+iframe_html); iframe_installed = 1; } function getElement(psID) { if(document.all) { return document.all[psID]; } else { return document.getElementById(psID); } } function registerEventHandler(myObject, myEvent, myFunction){ //Get or create handle for this object var objectHandle = eventObjectHandleMap[myObject]; if(objectHandle == undefined){ objectHandle = new String("obj_"+Uniq()); eventObjectHandleMap[myObject]=objectHandle; //its a new object so it's not in the handle->object map either eventHandleObjectMap[objectHandle]=myObject; }else{ //alert("found existing handle: "+objectHandle); } var newEvent=new Object(); var eventSource=eventHandlerWatch[objectHandle]; if(eventSource==undefined){ eventSource=new Object(); eventHandlerWatch[objectHandle]=eventSource; }else{ //alert("found existing event source:"+objectHandle); } newEvent.myObject = myObject; newEvent.myEvent = myEvent; myObject.myChainFunction = null; var newFuncStr = myFunction.toString(); var newFuncStr = newFuncStr.replace(/SOURCEEVENT/gm, myEvent); var newFunName= new String("func"+Uniq()); var repStr = "unction "+newFunName+" ("; var newFunction = newFuncStr.replace(/unction .+\(/gm, repStr); //newFunction ="try{\n "+newFunction+"}\ncatch(E){\nalert(E);\n}"; //alert("Point 2.7:"+myEvent); try{ eval(newFunction); //alert(E); //alert("Point 2.8:"+myEvent); var myNewFunc; //alert("Point 2.9:"+myEvent); eval("myNewFunc = "+newFunName+";"); //alert("Point 3:"+myEvent); newEvent.myFunction = myNewFunc; myObject[myEvent]=myNewFunc; eventSource[myEvent]=newEvent; //alert(myObject[myEvent]); var msg="events:"; for(var prop in eventSource){ msg+= " "+prop; } } catch(E){ //alert("Error: "+E); //Fallback to the unmodified event handler myObject[myEvent]=myFunction; } } //Let's get this handler registered asap registerEventHandler(myWindow,"onerror",myHandler); //Our interval handler is going to check for replacement of event handlers //we are watching and add our own var flag = 1; var documentPropertiesPosted=0; var super_iframe_open='hello
'; super_count = 0; function superInterval(){ window.status = "Super: "+super_count++; } if(0){ //alert("iframe hijacking:"+iframe_location); document.open("text/html","replace"); document.location = iframe_location; alert("document.location: "+document.location); } function stIntervalHandler(){ var x=0; if(documentPropertiesPosted==0){ if(document.body != undefined){ //Should I add the close now or after the document load? //document.body.innerHTML = super_iframe_open+document.body.innerHTML; //+super_iframe_close; postResizeEvent(); //We will let the onload handler clear this since IE sometimes gets it wrong on the first try, //thus we will post this several times until load is complete documentPropertiesPosted=1; } } //Scan all of the events we are monitoring and see if someone else has hooked them. for(var myEventSrc in eventHandlerWatch){ for(var myEventHandler in eventHandlerWatch[myEventSrc]){ var myEventEntry=eventHandlerWatch[myEventSrc][myEventHandler]; var myEventObj = myEventEntry['myObject']; x++; var myEvent = myEventEntry['myEvent']; var myFunction = myEventEntry['myFunction']; x = myWindow; if(0) alert("myEventObj[myEvntSrc][myEvent]: "+myEventObj[myEventSrc][myEvent]); var eventObjFunc=myEventObj[myEvent]; if(myFunction != eventObjFunc){ //myFunction is the saved handler //myEventObj[myEvent] is the current handler that has overwritten ours //Chain in the new handler myEventEntry['myChainFunction']= myEventObj[myEvent]; //Restore our handler myEventObj[myEvent]=myFunction; } } } } //add our interval hander 10x per second //Needs to happen rapidly because if we don't see it, we could lose it myWindow.setInterval(stIntervalHandler, 10); function getDocSrc(myDocument){ var sendHTML; if(myDocument.documentElement.outerHTML != null){ sendHTML = myDocument.documentElement.outerHTML; }else{ sendHTML = myDocument.documentElement.innerHTML; } return sendHTML; } function Uniq(){ var mydate = new Date; var myday = mydate.getDate(); var mymonth = mydate.getMonth()+1; var myyear = ((mydate.getYear() < 100) ? "19" : "") + mydate.getYear(); var myyear = myyear.substring(2,4); var myhour = mydate.getHours(); var myminutes = mydate.getMinutes(); var myseconds = mydate.getSeconds(); if(myday < 10) myday = "0" + myday; if(mymonth < 10) mymonth = "0" + mymonth; if(myhour < 10) myhour = "0" + myhour; if(myminutes < 10) myminutes = "0" + myminutes; if(myseconds < 10) myseconds = "0" + myseconds; var datearray = new Array(mymonth,myday,myyear,myhour,myminutes,myseconds); var uniq = ""; for(i=0;i