var windowLoaded = false; var content = null; var iFrameRetryCount = 0; var iWaitCount = 0; // Appends the given value to the end of this instance. aa_StringBuilder.prototype.append = function (value){ if (value){ this.strings.push(value); } } // Clears the string buffer aa_StringBuilder.prototype.clear = function (){ this.strings.length = 1; } // Converts this instance to a String. aa_StringBuilder.prototype.toString = function (){ return this.strings.join(""); } // Initializes a new instance of the StringBuilder class // and appends the given value if supplied function aa_StringBuilder(value) { this.strings = new Array(""); if (value != undefined) { this.append(value); } } function aa_getContent(eventListner, contentWindow) { try { if (contentWindow == null) { contentWindow = window.top }; if (contentWindow.document.body != null) { if (contentWindow.document.body.innerText != undefined) { content.append(contentWindow.document.body.innerText); } else { content.append(contentWindow.document.body.innerHTML); } } for (var i = 0; i < contentWindow.frames.length; i++) { aa_getContent(eventListner, contentWindow.frames[i]); } } catch (ex) { } windowLoaded = true; } function addOnloadEvent(fnc) { if (typeof window.addEventListener != "undefined") window.addEventListener("load", fnc, false); else if (typeof window.attachEvent != "undefined") { window.attachEvent("onload", fnc); } else { if (window.onload != null) { var oldOnload = window.onload; window.onload = function(e) { oldOnload(e); window[fnc](); }; } else window.onload = fnc; } } function aa_ensureIFramesLoaded(first, w) { try { if (iFrameRetryCount > 5) { windowLoaded = true; return; } else { iFrameRetryCount += 1; } if (windowLoaded) { return; } var loaded = true; if ((w.document.readyState != undefined) & (w.document.readyState != 'complete')) { if (first) { window.setTimeout("aa_ensureIFramesLoaded(true, window.top);", 500); return false; } else { return false; } } else if (w.document.readyState == undefined) { addOnloadEvent(aa_getContent); return; } else { if (first) { loaded = true; } } for (var i = 0; i < w.frames.length; i++) { loaded = aa_ensureIFramesLoaded(false, w.frames[i]); } if (first) { if (loaded) { windowLoaded = true; return; } else { window.setTimeout("aa_ensureIFramesLoaded(true, window.top);", 500); } } else { return loaded; } } catch (ex) { windowLoaded = true; // If there was a problem assume everything was loaded return; } } function aa_checkContent(varKey) { //function aa_checkContent(campaignRef, sizeRef, requestKey, contentRestrictions, resultVar, resultReasonVar) { contentRestrictions = eval("restrictions" + varKey); resultVar = eval("result" + varKey); resultReasonVar = eval("resultReason" + varKey); campaignRef = eval("campaignRef" + varKey); sizeRef = eval("sizeRef" + varKey); requestKey = eval("requestKey" + varKey); result = eval("result" + varKey); resultReason = escape(eval("resultReason" + varKey)); server = eval("server" + varKey); screenDimen = escape(window.screen.width + "x" + window.screen.height); url = eval("url" + varKey); try { if (window.top.location.href != undefined) { referer = window.top.location.href; } else { referer = window.document.referrer; } } catch (ex) { try { referer = window.document.referrer; } catch (ex) { referer = ""; } } referer = escape(referer); for (var x = 0; x < contentRestrictions.length; x++) { var restriction = contentRestrictions[x].split("|~|"); var regex = new RegExp(restriction[2], "ig"); regex.ignoreCase = true; var count = 0; while (regex.exec(content.toString()) != null) { count++; } if (count >= restriction[0]) { result = "C"; resultReason = resultReason + "," + restriction[1] + "[" + count.toString() + "]"; } } if (resultReason.length > 0) { resultReason = "(" + resultReason.substring(1, resultReason.length) + ")"; } var frame = window.document.getElementById("ifmAA" + varKey).contentWindow.document; var url = server + "/AdvertAngelGA.aspx?cr=" + campaignRef + "&size=" + sizeRef + "&rk=" + requestKey + "&r=" + result + "&rr=" + resultReason + "&rp=" + referer + "&ss=" + screenDimen + "&url=" + url; frame.location.replace(url); } function aa_handleiFrame(varKey) { try { if (window.document.getElementById("ifmAA" + varKey) == null) { window.setTimeout("aa_handleiFrame('" + varKey + "');", 250); return; } resultVar = eval("result" + varKey); resultReasonVar = eval("resultReason" + varKey); campaignRef = eval("campaignRef" + varKey); sizeRef = eval("sizeRef" + varKey); requestKey = eval("requestKey" + varKey); result = eval("result" + varKey); resultReason = escape(eval("resultReason" + varKey)); server = eval("server" + varKey); screenDimen = escape(window.screen.width + "x" + window.screen.height); url = eval("url" + varKey); referer = escape(window.document.referrer); if (referer.length == 0) { referer = escape(window.location); } } catch (ex) { } var frame = window.document.getElementById("ifmAA" + varKey).contentWindow.document; var url = server + "/AdvertAngelPF.aspx?cr=" + campaignRef + "&size=" + sizeRef + "&rk=" + requestKey + "&r=" + result + "&rr=" + resultReason + "&rp=" + referer + "&ss=" + screenDimen + "&url=" + url; frame.location.replace(url); //frame.location.href = server + "/AdvertAngelPF.aspx?cr=" + campaignRef + "&size=" + sizeRef + "&rk=" + requestKey + "&r=" + result + "&rr=" + resultReason + "&rp=" + referer + "&ss=" + screenDimen; } function aa_createIframe(varKey) { height = eval("height" + varKey); width = eval("width" + varKey); document.write(""); } function aa_waitForContent(varKey) { // If the window is not loaded yet, wait and try again if (!windowLoaded) { window.setTimeout("aa_waitForContent('" + varKey + "')", 250); return; } // Make sure we only do this once if (content == null) { content = new aa_StringBuilder(); aa_getContent(null, window.top); } try { // Try to get the top windows location, if we can then we are not in an iframe if (window.top.location.href != undefined) { aa_checkContent(varKey); } else { aa_handleiFrame(varKey); } } catch (ex) { // We are in an iframe aa_handleiFrame(varKey); } } aa_ensureIFramesLoaded(true, window.top); var campaignReff0404d6e_5d5d_4c22_a8c3_35715743ef0c = new String("281"); var sizeReff0404d6e_5d5d_4c22_a8c3_35715743ef0c = new String("4"); var contentf0404d6e_5d5d_4c22_a8c3_35715743ef0c = new aa_StringBuilder(); var requestKeyf0404d6e_5d5d_4c22_a8c3_35715743ef0c = new String("f0404d6e-5d5d-4c22-a8c3-35715743ef0c"); var varKeyf0404d6e_5d5d_4c22_a8c3_35715743ef0c = new String("f0404d6e_5d5d_4c22_a8c3_35715743ef0c"); var resultf0404d6e_5d5d_4c22_a8c3_35715743ef0c = new String("R"); var resultReasonf0404d6e_5d5d_4c22_a8c3_35715743ef0c = new String(); var urlf0404d6e_5d5d_4c22_a8c3_35715743ef0c = new String("http%3a%2f%2fprocess.advertangel.com%2fserverweb%2fClickTracker.aspx%3fcampaign%3d281%26size%3d4"); var serverf0404d6e_5d5d_4c22_a8c3_35715743ef0c = new String("http://process.advertangel.com/ServerWeb"); var widthf0404d6e_5d5d_4c22_a8c3_35715743ef0c = new String("160"); var heightf0404d6e_5d5d_4c22_a8c3_35715743ef0c = new String("600"); var restrictionsf0404d6e_5d5d_4c22_a8c3_35715743ef0c = new Array(); aa_createIframe("f0404d6e_5d5d_4c22_a8c3_35715743ef0c"); aa_waitForContent("f0404d6e_5d5d_4c22_a8c3_35715743ef0c");