
function backToSite() {
  if (window.opener && !window.opener.closed){
    // close this window and give focus to the previous window
	window.opener.focus();
	window.close();

  } else {
	// take the user directly to the market intelligence pages
  	location.href='/market_intelligence/';
  }
}


function checkUnload(){
	if (window.opener && !window.opener.closed){window.opener.checkFocus()};
}

function checkFocus() {
	window.setTimeout("checkFocusB()",500);
}
function checkFocusB() {
	
	if (winObj.closed){
			window.focus();
		}
}
function handleError() {
	return true; 
	
}

window.onerror = handleError;

