if (document.createElement && document.getElementsByTagName && document.getElementById) {
    function addEventSimple(obj,evt,fn) {
        if (obj.addEventListener)
            obj.addEventListener(evt,fn,false);
        else if (obj.attachEvent)
            obj.attachEvent('on'+evt,fn);
    }
    addEventSimple(window,'load',setEvent);
}

// introduce some variables we need for all functions
var aElm;

function setEvent() {
    var container = document.getElementById('virtualTour');
    var aList = container.getElementsByTagName('a');
    aElm = aList[0];
    addEventSimple(aElm,'click',popup);
}
function popup(e) {
    var newWindow = window.open(aElm,'popupVirtualTour','width=600,height=436,scrollbars=yes,resizable=yes');
    if (window.focus) {
        newWindow.focus()
    }
    // Make sure e is defined and the preventDefault method is supported
    if (e && e.preventDefault) {
        // W3C standard
        e.preventDefault();
    }
    // If e is not defined or the preventDefault method is not supported, define e and use the returnValue method
    else {
        //  Microsoft’s way
        e = window.event;
        e.returnValue = false;
    }
}
