Javascript needing updated for ie8

I have the following javascript which works fine in IE7 but not in IE8. Inherited code and I'm a javascript novice, hence why i need the help. The code basically displays an overlayed div when a radio button list choice is selected. Code is actually run in an ASP.Net page.
// Get the position of an element
var x=0, y=0;
function getAbsElemPos(el) {
	var posX=0, posY=0;
	while (el!=null) {
function eventDisplayWarning() {
    // set delay and only display if rb19 is default, only fire once
    var o=document.getElementById("msg");
    if (o) {
    	// make the message visible
	} else {
		alert('Undefined message object');
// Timeout functions
function closeMessage() {
    var o=document.getElementById("msg");
	if (o) {
		// hide the message'hidden';
	} else {
		alert('Undefined message object');
function eventDisplayWarningPause(e) {
function insertElement(o) {
	// insert the msg div into the DOM
	var el='<div id="msg" class="bx"><p class="bxt">Please read the next question (Q19) and response options carefully.</p></div>';
	if (o && typeof HTMLElement!="undefined") {
		var r=o.ownerDocument.createRange();
		var parsedHTML=r.createContextualFragment(el);
	} else {
function connectEvents() {

    var fld = document.getElementsByName('ctl00$phBody$rblQ18');
	for (var i=0;i<fld.length;i++){

		if (i==1) { insertElement(fld[i]); } // choose a visible element as insertion point
		if (fld[i].addEventListener)
		} else {

// run now

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Obadiah ChristopherCommented:
What exactly is the problem that u r facing. Is it the overlay div doesn't get displayed?

U'll have to provide some more code


Where is this function called from?

Which is the function called onclick of the radiobutton
suromaAuthor Commented:
eventDisplayWarningPause to added to the radiobutton click in connectEvents. The problem is that in IIS8 the overlay div is not displayed.

The proceedure just runs when the page loads - connectEvents

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.