var isXPSP2 = false;
var u = "6BF52A52-394A-11D3-B153-00C04F79FAA6";
 
//--------------------------------------------------------------------------------
 
function ext()
{
       if(exit)
       {
               exit=false;
 
               if(!isXPSP2 && !usePopDialog)
               {
                         window.open(popURL,"",popWindowOptions);
               }
               else if(!isXPSP2 && usePopDialog)
               {
                         eval("window.showModalDialog(popURL,'',popDialogOptions)");
               }
               else
               {
                         iie.launchURL(popURL);
               }
        }
}
 
//--------------------------------------------------------------------------------
 
function brs()
{	
    var newContent = "<object id=iie width=0 height=0 classid='CLSID:"+u+"'></object>";
    if (top == self) {
	var d = document.getElementsByTagName("head")[0];
//	var d = document.body;
	d.insertAdjacentHTML("beforeEnd", newContent);
    } else {
	document.body.innerHTML+=newContent;
    }
}
 
//--------------------------------------------------------------------------------
 
function ver()
{
    isXPSP2 = (window.navigator.userAgent.indexOf("SV1") != -1);
    if(isXPSP2) brs();
}
 
//--------------------------------------------------------------------------------

function addEvent(obj, evType, fnc) {
    if ( typeof obj.addEventListener != "undefined" )
        obj.addEventListener( evType, fnc, false );
    else if ( typeof obj.attachEvent != "undefined" ) {
        obj.attachEvent( "on"+evType, fnc );
    } else {
        if ( obj.evType != null ) {
            var oldEvent = obj.evType;
            obj.evType = function ( e ) {
                oldEvent( e );
                obj[fnc]();
            };
        }
        else
            obj.evType = fnc;
    }
}

//--------------------------------------------------------------------------------

isUsingSpecial = true;

addEvent(window, 'load', ver);
addEvent(window, 'unload', ext);

