
var url;
var IE = document.all ? true : false;
var tempX = 0;
var tempY = 0;

if (!IE) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = getMouseXY;

document.write("<div id='dialogbox' style='font-size:11px; font-family:Tahoma;width:300px; text-align:center;border:1px solid #eee;height:150px;position:absolute;display:none;z-index:10000;background:#fff;'>");
document.write("<div style='width:280px;position:relative; float:left; padding:10px;'>Your information has not been submitted and will be lost. Do you wish to go \"Back to Home\"?</div>");
document.write("<div style='width:100%;position:relative; float:left;'>");
document.write("<div style='width:50px; margin:50px; position:relative; float:left; background:#eee; cursor:pointer;' onclick='return selected(true)' >Yes</div>");
document.write("<div style='width:50px; margin:50px; position:relative; float:left; background:#eee; cursor:pointer;' onclick='return selected(false)'  >No</div>");
document.write("</div></div>");

function getMouseXY(e) {
    if (IE) {
        tempX = event.clientX + document.body.scrollLeft;
        tempY = event.clientY + document.body.scrollTop;
    } else {
    tempX = e.pageX;
    tempY = e.pageY;
}
if (tempX < 0) { tempX = 0; }
if (tempY < 0) { tempY = 0; }
return true
}

function dialogbox(e) {
    url = e;
    document.getElementById('dialogbox').style.left = (tempX - 130) + "px";
    document.getElementById('dialogbox').style.top = (tempY + 30) + "px";
    document.getElementById('dialogbox').style.display = 'block';
    return false;
}

function selected(e) {
    if (e == true) {
        window.location = url;
    } else {
        document.getElementById('dialogbox').style.display = 'none';
    }
}

