﻿function swapImage(e, divWidth, divId, divToSwap, imageUrl, hrefLoc, cssPrefix)
{
    var e = e || window.event;
    if (!e) var e = window.event;
    var tg = (window.event) ? e.srcElement : e.target;
    if (tg.id != divId) return;
    var reltg = (e.relatedTarget) ? e.relatedTarget : e.toElement;
    if (reltg != null)
    {
        while (reltg != tg && reltg.nodeName != 'FORM' && reltg.parentNode != null)
        {
            reltg = reltg.parentNode
            if (reltg == tg) return;
        }
    }
    //the above makes sure that we actually left the div and didn't mouse out of 
    //any of the div's child elements (which would bubble up and fire the onMouseOut event,
    //even though we're still in the div.  The above code handles this.
    var wDiv = document.getElementById(divToSwap);
    wDiv.innerHTML="<a href=\""+hrefLoc+"\" target=\"_top\" style=\"text-decoration:none;\"><img src=\""+imageUrl+"\" height=\"312px\" width=\""+divWidth+"\" border=\"0\"></img></a><br/>";
    wDiv.className=cssPrefix+"HoverAdContent";
    wDiv.style.width = divWidth;
}


function resize(iframeId)
{
    h = document.body.scrollHeight; 
    window.parent.document.getElementById(iframeId).height = h;
}		
