// Create FLOOKII Object
var FLOOKII = {};
// Cross browser event registering
FLOOKII.addEvent = function (elm, evType, fn, useCapture) {
    if (elm.addEventListener) {
        elm.addEventListener(evType, fn, useCapture);
        return true;
    }
    else if (elm.attachEvent) {
        var status = elm.attachEvent('on' + evType, fn);
        return status;
    }
    return true;
};
// Create checkParent method : Redirect to main page if report pages are accessed directly
FLOOKII.checkParent = function () {
    if (top.location.href === self.location.href) {
        top.location.href = 'http://www.flookii.com/' + '?frame2=' + self.location.href;
    }
    return true;
};
// Create renderPage method : Add alternate colors to table rows
FLOOKII.renderPage = function () {

    var stop_interval;
    
    var checkParentLoading = function (){
        if(window.parent.stripeTable){
            window.parent.stripeTable();
            clearInterval(stop_interval);
        }
    };
    // Just in case parent js has not loaded repeat call to stripeTable until it is
    stop_interval = setInterval(checkParentLoading,1000);

    return true;
};
FLOOKII.checkParent();
FLOOKII.addEvent(window, 'load', FLOOKII.renderPage, false);


