if(document.createStyleSheet)
        {
            document.createStyleSheet('http://api.aggregateknowledge.com/2007/01/15/css');
        } else {
            var styles = "@import url(' http://api.aggregateknowledge.com/2007/01/15/css ');";
            var akStylesheet = document.createElement('link');
            akStylesheet.rel = 'stylesheet';
            akStylesheet.href = 'data:text/css,' + escape(styles);
            document.getElementsByTagName('head')[0].appendChild(akStylesheet);
        }
function execScripts(documentElement) {
var scriptElements = documentElement.getElementsByTagName('script'); 
var scriptElementsCount = scriptElements.length;
for (var i = 0; i < scriptElementsCount;i++){
var scriptElement = scriptElements[i]; 
var agkn = scriptElement.getAttribute("agkn");
if (agkn == 'agkn' && scriptElement.id != 'akfooterscript'){
if (scriptElement.innerHTML != '')
eval(scriptElement.innerHTML);
else {
var createdScriptElement = document.createElement('script');
createdScriptElement.src = scriptElement.src;
createdScriptElement.type = 'text/javascript';
documentElement.removeChild(scriptElement);
documentElement.appendChild(createdScriptElement); 
}}}};

if (!window.ak) var ak = function() {};
ak.getAKContent = function() {
return '<!--\r\n'
+ '    <link rel="stylesheet" HREF="http://api.aggregateknowledge.com/2007/01/15/css" TYPE="text/css" MEDIA=screen>\r\n'
+ '-->\r\n'
+ '    <scr' + 'ipt agkn=\'agkn\' type = "text/javascript" id = "akheaderscript">\r\n'
+ '        if(document.createStyleSheet)\r\n'
+ '        {\r\n'
+ '            document.createStyleSheet(\'http://api.aggregateknowledge.com/2007/01/15/css\');\r\n'
+ '        } else {\r\n'
+ '            var styles = "@import url(\' http://api.aggregateknowledge.com/2007/01/15/css \');";\r\n'
+ '            var akStylesheet = document.createElement(\'link\');\r\n'
+ '            akStylesheet.rel = \'stylesheet\';\r\n'
+ '            akStylesheet.href = \'data:text/css,\' + escape(styles);\r\n'
+ '            document.getElementsByTagName(\'head\')[0].appendChild(akStylesheet);\r\n'
+ '        }\r\n'
+ '    </scr' + 'ipt>\r\n'
+ '<scr' + 'ipt agkn=\'agkn\' type="text/javascript" id = "akfooterscript">\r\n'
+ '</scr' + 'ipt>\r\n'
+ '<scr' + 'ipt agkn=\'agkn\' type="text/javascript" id="akfooterscript">\r\n'
+ 'if(!window.ak) var ak = function() {};\r\n'
+ 'function getIFrameDocument(iframe)\r\n'
+ '{\r\n'
+ '    var document = iframe.contentWindow || iframe.contentDocument;\r\n'
+ '    if(document.document)\r\n'
+ '        document = document.document;\r\n'
+ '    return document;\r\n'
+ '}\r\n'
+ 'ak.getIFrameDocument = function(iframe)\r\n'
+ '{\r\n'
+ '    var document = iframe.contentWindow || iframe.contentDocument;\r\n'
+ '    if(document.document)\r\n'
+ '        document = document.document;\r\n'
+ '    return document;\r\n'
+ '};\r\n'
+ '</scr' + 'ipt>\r\n'
+ '<iframe src=\'\r\n'
+ '://api.aggregateknowledge.com/results/beacons?k=&i=&s=&w=&tag=\r\n'
+ '\' width=1 height=1 frameborder=0></iframe>\r\n'
+ '<scr' + 'ipt agkn=\'agkn\' type="text/javascript" id = "akfooterscript">\r\n'
+ '    if(!window.ak) var ak = function() {};\r\n'
+ '    if(window.onAKLoad) onAKLoad(); \r\n'
+ '    if(ak.onLoad) ak.onLoad(); \r\n'
+ '    if(ak.notifyAKDebugConsoleOfLoading) ak.notifyAKDebugConsoleOfLoading(); \r\n'
+ '</scr' + 'ipt>\r\n'
;
};

if (ak.recordRoundTripExecutionTime) ak.recordRoundTripExecutionTime();

ak.anchor = document.getElementById('akAPI');
ak.discoveryWindowContent = ak.getAKContent();
if (ak.discoveryWindowContent != null && ak.anchor != null) {
ak.anchor.innerHTML = ak.discoveryWindowContent;
setTimeout('execScripts(ak.anchor)', 2000);
}


if(!window.ak) var ak = function() {};

function getIFrameDocument(iframe)
{
    
    var document = iframe.contentWindow || iframe.contentDocument;
    
    if(document.document)
        document = document.document;
    return document;
}

ak.getIFrameDocument = function(iframe)
{
    
    var document = iframe.contentWindow || iframe.contentDocument;
    
    if(document.document)
        document = document.document;
    return document;
};
if(!window.ak) var ak = function() {};

    
    if(window.onAKLoad) onAKLoad(); 
    if(ak.onLoad) ak.onLoad(); 
    if(ak.notifyAKDebugConsoleOfLoading) ak.notifyAKDebugConsoleOfLoading();
