code: function BOOMR_check_doc_domain(domain) {
  	/*eslint no-unused-vars:0*/
  	var test;
  
  	// If domain is not passed in, then this is a global call
  	// domain is only passed in if we call ourselves, so we
  	// skip the frame check at that point
  	if(!domain) {
  		// If we're running in the main window, then we don't need this
  		if(window.parent === window || !document.getElementById("boomr-if-as")) {
  			return;// true;	// nothing to do
  		}
  
  		domain = document.domain;
  	}
  
  	if(domain.indexOf(".") === -1) {
  		return;// false;	// not okay, but we did our best
  	}
  
  	// 1. Test without setting document.domain
  	try {
  		test = window.parent.document;
  		return;// test !== undefined;	// all okay
  	}
  	// 2. Test with document.domain
  	catch(err) {
  		document.domain = domain;
  	}
  	try {
  		test = window.parent.document;
  		return;// test !== undefined;	// all okay
  	}
  	// 3. Strip off leading part and try again
  	catch(err) {
  		domain = domain.replace(/^[\w\-]+\./, "");
  	}
  
  	BOOMR_check_doc_domain(domain);
  }
docs: Check the value of document.domain and fix it if incorrect.
  This function is run at the top of boomerang, and then whenever
  init() is called.  If boomerang is running within an iframe, this
  function checks to see if it can access elements in the parent
  iframe.  If not, it will fudge around with document.domain until
  it finds a value that works.
  
  This allows customers to change the value of document.domain at
  any point within their page's load process, and we will adapt to
  it.