// to test popup blockers
//openFlashMap();

// either focus map or load new window
/******************************************************************
defined in the individual pages: 
flash_window_url = '/flash/map.php?state=<?= $regData[$REGION]['state']?>&rid=<?= $regData[$REGION]['region_id']?><?= $map_countyID?'&cid='.$map_countyID:''?>';
******************************************************************/
function openFlashMap(){
	try{
		mapPopup.focus();
		var trash = mapPopup.location;
		var trash2 = trash+'2';
		// Trying to invoke an error here if window has been closed. 
		// You need to do something with the var to create error
	} catch(e){
		mapPopup=OpenCenteredWindow(flash_window_url,'message','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no','561','472',true);
		timeoutID = setTimeout("checkMapPopUp();", 6000);
	}
}

// check that the window loaded, if not: display must enable popup message
function checkMapPopUp(){
	try{
		mapPopup.location;
	}catch(e){
		document.getElementById('flash_map_link').style.display='none';
		document.getElementById('flash_map_blocked').style.display='block';
	}
}

function clearCheckMapPopUp(){
	try{
		clearTimeout(timeoutID);
	}catch(e){
	}	
}