/*
 *  It is of critical importance that this file is referenced inside the <body> tag of every page 
 *  on your site.  For example: 
 *
 *  <body>
 *  <script src="/userplane/functions.js" type="text/javascript" language="javascript"></script>
 *  
 *  !!! WE HIGHLY RECOMMEND YOU LEAVE up_bDoPresence TO true AND TO IMPLEMENT THE CODE IN ALL asp
 *  PAGES IN THIS FOLDER !!!
 *
 *  Set up_bDoPresence to false if you have your own presence detection and will check for pending 
 *  Webmessenger windows and call up_launchWM on your own.  If so, you will need to call up_launchWM for 
 *  every pending WM window every time the user changes pages.  Also, you will need to implement the logic 
 *  in the wmWindowOpened.asp page to let you know when requests have been denied and also when windows 
 *  have successfully popped up
 */
var up_bDoPresence = false; 
/* 
 *  If you have up_bDoPresence set to true, this is how often (in seconds) we will connect to your 
 *  server via wmLauncher.asp or win_ie_pd.asp
 */
var up_iCheckSeconds = 5; 

function launchChatWindow (userID, destinationUserID, destinationName, host, recipient) {

    up_localUserID = userID;
    uts = get_unix_timestamp();    
    $chatClick = setWindow('upchat/chat?id=' + destinationUserID +'&n=' + uts + '&host=' + host + '&recipient=' + (recipient ? '1' : '0'), 'chat', destinationUserID);        
    
    //popupWindowTest = window.open("http://209.67.240.108/userplane/wm_ads.php?strUserID=" + userID + "&strDestinationUserID=" + destinationUserID + "&destname=" + destinationName, "wmWindow_" + up_replaceAlpha(userID) + "_" + up_replaceAlpha(destinationUserID), "width=485,height=627,toolbar=0,directories=0,menubar=0,status=0,location=0,scrollbars=0,resizable=1" );
    up_clearWMNotify( destinationUserID, false );
    return popupWindowTest; //This returns the reference to the window.
    
}

function up_launchWM( userID, destinationUserID, destinationName ){    
  up_showWMNotify( userID, destinationUserID, destinationName );             
}

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

function up_showWMNotify( userID, destinationUserID, destinationName )
{
    up_localUserID = userID;
    
    var bAdd = true;
    for( var i = 0 ; i < up_launchArray.length ; i++ )
    {
        if( up_launchArray[i].destID == destinationUserID )
        {
            if( destinationName != undefined )
            {
                up_launchArray[i].destName = destinationName;
            }
            bAdd = false;
        }
    }
    
    destinationName = destinationName == undefined ? "A site member" : destinationName;
    
    if( bAdd )
    {
        var userObj = new Object();
        userObj.destID = destinationUserID;
        userObj.destName = destinationName;
        up_launchArray.push( userObj );
    }
    
    up_showNotification();
}

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

function up_clearWMNotify( clearDestID, bForceClear ){
    

    var tempArray = up_launchArray;
    up_launchArray = new Array();
    
    var bRemoved = false;
    
    while( tempArray.length > 0 )
    {
        var userObj = tempArray.pop();
        
        if( userObj.destID != clearDestID )
        {
            up_launchArray.push( userObj );
        }
        else
        {
            bRemoved = true;
        }
    }
    
    if( bRemoved || !bForceClear )
    {
        
        
        if( bForceClear ){
            //alert('in');
            //document.getElementById('up_wmReject').src = "http://209.67.240.108/userplane/cmd.php?strDestinationUserID=" + clearDestID + "&refresh=" + Math.floor( Math.random() * 100000000000 );
            //alert('out');
        }
        
        frames['up_wmLauncher'].location.href = "/userplane/wmWindowOpened.asp?destinationUserID=" + clearDestID + "&doPresence=" + ( up_bDoPresence && !up_is_win_ie ? "true" : "false" ) + "&forceClear=" + ( bForceClear ? "true" : "false" ) + "&iRefreshInterval=" + up_iCheckSeconds + "&refresh=" + Math.floor( Math.random() * 100000000000 );
        
    }
    
    up_showNotification();
}

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

function up_showNotification () {
    var elem = document.getElementById( "up_wmNotifications" );
    
    if ( up_launchArray.length > 0 ) {
        if ( up_displayedNotificationID != up_launchArray[0].destID ) {
            
            currentTime = getCurrentTime();

            if (BrowserDetect.browser == "Explorer" && BrowserDetect.version < 7) {
                document.getElementById('shim').style.display = "block"; //FOR IE 6
                document.getElementById('shim').style.visibility = "visible"; //FOR IE 6
            }
        
            elem.innerHTML = '<div class="up_mbox"> \
                                <div class="up_mboxgut"> \
                                    <h5>'+ currentTime +'</h5> \
                                    <h1>'+ mhDictionary.chat.chatInvite +'</h1> \
                                    <p><a href="javascript:setWindow(\'profile/' + up_launchArray[0].destName + '\', \'profile\');">' + up_launchArray[0].destName + '</a>' + mhDictionary.chat.chatReq + '</p>\
                                    <div class="alialign"> \
                                        <a class="timbutt" href="#Accept" onClick="  chat_window = launchChatWindow( \'' + up_localUserID + '\', \'' + up_launchArray[0].destID + '\', \'false\',\'\',\'' + up_launchArray[0].destName + '\');">'+ mhDictionary.chat.chatAccept +'</a> \
                                        <a class="timbutt" href="#Decline" onClick="  up_clearWMNotify( \'' + up_launchArray[0].destID + '\', true ); return true;">'+ mhDictionary.chat.chatDecline +'</a> \
                                    </div> \
                                    <span id="chatding"></span><div id="clear"></div> \
                                </div> \
                            </div>';
                    
            up_displayedNotificationID = up_launchArray[0].destID;
            up_animate( 10 );
        }
    } else {
        if (BrowserDetect.browser == "Explorer" && BrowserDetect.version < 7) {
            document.getElementById('shim').style.display = "none"; //FOR IE 6
            document.getElementById('shim').style.visibility = "hidden"; //FOR IE 6
        }
        
        up_displayedNotificationID = "";
        up_animate( -200 );
    }
}

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

function up_animate( iWhereTo )
{
    var elem = document.getElementById( "up_wmNotifications" );
    if( up_iDivCurrentY != iWhereTo || up_launchArray.length > 0 )
    {
        if( up_iDivCurrentY != iWhereTo )
        {
            up_iDivCurrentY += iWhereTo < up_iDivCurrentY ? -10 : 10;
        }
        
        var px = up_iDivCurrentY + document.body.scrollTop + 'px';
        elem.style.top = px;
        
        clearTimeout( up_animate_timeoutID );
        up_animate_timeoutID = setTimeout( "up_animate(" + iWhereTo + ")", 33 );
    }
    else
    {
        elem.style.top = iWhereTo;
    }
}

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

function up_replaceAlpha( strIn )
{
    var strOut = "";
    for( var i = 0 ; i < strIn.length ; i++ )
    {
        var cChar = strIn.charAt(i);
        if( ( cChar >= 'A' && cChar <= 'Z' )
            || ( cChar >= 'a' && cChar <= 'z' )
            || ( cChar >= '0' && cChar <= '9' ) )
        {
            strOut += cChar;
        }
        else
        {
            strOut += "_";
        }
    }
    
    return strOut;
}

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

function up_checkWM()
{
    if( up_is_win_ie )
    {
        up_wmCheckImage = new Image();
        up_wmCheckImage.onLoad = up_onImageLoad();
        up_wmCheckImage.src = "/userplane/win_ie_pd.asp?refresh=" + Math.floor( Math.random() * 100000000000 );
        clearTimeout( up_checkWM_timeoutID );
        up_checkWM_timeoutID = setTimeout("up_checkWM()", 1000 * up_iCheckSeconds);
    }
    else
    {
        frames['up_wmLauncher'].location.href = "/userplane/wmLauncher.asp?iRefreshInterval=" + up_iCheckSeconds + "&refresh=" + Math.floor( Math.random() * 100000000000 );
    }
}

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

function up_onImageLoad()
{
    if (!up_wmCheckImage.complete)
    {
        clearTimeout( up_onImageLoad_timeoutID );
        up_onImageLoad_timeoutID = setTimeout("up_onImageLoad()", 250);
    }
    else
    {
        if( up_wmCheckImage.height == 2 )
        {
            frames['up_wmLauncher'].location.href = "/userplane/wmLauncher.asp?iRefreshInterval=0&refresh=" + Math.floor( Math.random() * 100000000000 );
        }
        else
        {
            //alert( "Nothing to launch" );
        }
        
        clearTimeout( up_checkWM_timeoutID );
        up_checkWM_timeoutID = setTimeout("up_checkWM()", 1000 * up_iCheckSeconds);
    }
}

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

function up_launchUL(){ 
    window.open( "ul.php" , "ULWindow" , "width=200,height=750,toolbar=0,directories=0,menubar=0,status=0,location=0,scrollbars=0,resizable=1" ); 
}


//------------------------------------------------------------------------------------------------------------
function getCurrentTime(){
    
    var a_p = "";
    var d = new Date();
    var curr_hour = d.getHours();
    var curr_hour_24 = d.getHours();
    var curr_min = d.getMinutes();
    curr_min = curr_min + "";   

    if (curr_hour < 12){ a_p = "AM"; } else { a_p = "PM"; }

    if (curr_hour == 0){ curr_hour = 12; }
    if (curr_hour > 12) { curr_hour = curr_hour - 12; }

    if (curr_min.length == 1){ curr_min = "0" + curr_min; }


    switch(userLang){
            case 'en': timeString = curr_hour + ":" + curr_min + " " + a_p; break;
            case 'es': timeString = curr_hour_24 + ":" + curr_min; break;
            case 'fr': timeString = curr_hour_24 + "h" + curr_min; break;
            case 'pt': timeString = curr_hour_24 + "h" + curr_min; break;
            case 'de': timeString = curr_hour_24 + ":" + curr_min; break;
            case 'it': timeString = curr_hour_24 + ":" + curr_min; break;
    }


    return (timeString);
}

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


function playSound (soundfile) {
    /*var sound;
    
    sound = $('<a>');
    sound.attr('href', soundfile);
    $.dbj_sound.play(sound);
    */ 
	//var soundPlayer = $('#flashSoundPlayer');
	if (deconcept.SWFObjectUtil.getPlayerVersion().major < 9) return; 	
	if (jQuery('#flashSoundPlayer').length == 0) { 
		jQuery("body").append(jQuery('<div>').attr("id", "flashSoundPlayerContainer").css("display", "block").css("width", "1px").css("height", "1px"));
        //swfobject.embedSWF("/assets/images/mh/ui/SoundPlayer.swf", "flashSoundPlayer", "0", "0", "9.0.0");
        fo = new SWFObject("/assets/manhunt/swf/SoundPlayer.swf", "flashSoundPlayer", "1", "1", "9", "#ffffff", false, "best");
        fo.addVariable("soundfile", soundfile);
        fo.write("flashSoundPlayerContainer");
        return; 
	}
	jQuery("#flashSoundPlayer").get(0).playSound(soundfile);
}

//==================================================================================================================================================
// Flash Player Version Detection - Rev 1.6
// Detect Client Browser type
// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()
{
    var version;
    var axo;
    var e;

    // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

    try {
        // version will be set for 7.X or greater players
        axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
        version = axo.GetVariable("$version");
    } catch (e) {
    }

    if (!version)
    {
        try {
            // version will be set for 6.X players only
            axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
            
            // installed player is some revision of 6.0
            // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
            // so we have to be careful. 
            
            // default to the first public version
            version = "WIN 6,0,21,0";

            // throws if AllowScripAccess does not exist (introduced in 6.0r47)     
            axo.AllowScriptAccess = "always";

            // safe to call for 6.0r47 or greater
            version = axo.GetVariable("$version");

        } catch (e) {
        }
    }

    if (!version)
    {
        try {
            // version will be set for 4.X or 5.X player
            axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
            version = axo.GetVariable("$version");
        } catch (e) {
        }
    }

    if (!version)
    {
        try {
            // version will be set for 3.X player
            axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
            version = "WIN 3,0,18,0";
        } catch (e) {
        }
    }

    if (!version)
    {
        try {
            // version will be set for 2.X player
            axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
            version = "WIN 2,0,0,11";
        } catch (e) {
            version = -1;
        }
    }
    
    return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
    // NS/Opera version >= 3 check for Flash plugin in plugin array
    var flashVer = -1;
    
    if (navigator.plugins != null && navigator.plugins.length > 0) {
        if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
            var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
            var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
            var descArray = flashDescription.split(" ");
            var tempArrayMajor = descArray[2].split(".");           
            var versionMajor = tempArrayMajor[0];
            var versionMinor = tempArrayMajor[1];
            var versionRevision = descArray[3];
            if (versionRevision == "") {
                versionRevision = descArray[4];
            }
            if (versionRevision[0] == "d") {
                versionRevision = versionRevision.substring(1);
            } else if (versionRevision[0] == "r") {
                versionRevision = versionRevision.substring(1);
                if (versionRevision.indexOf("d") > 0) {
                    versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
                }
            }
            var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
            //alert("flashVer="+flashVer);
        }
    }
    // MSN/WebTV 2.6 supports Flash 4
    else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
    // WebTV 2.5 supports Flash 3
    else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
    // older WebTV supports Flash 2
    else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
    else if ( isIE && isWin && !isOpera ) {
        flashVer = ControlVersion();
    }   
    return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
    versionStr = GetSwfVer();
    if (versionStr == -1 ) {
        return false;
    } else if (versionStr != 0) {
        if(isIE && isWin && !isOpera) {
            // Given "WIN 2,0,0,11"
            tempArray         = versionStr.split(" ");  // ["WIN", "2,0,0,11"]
            tempString        = tempArray[1];           // "2,0,0,11"
            versionArray      = tempString.split(",");  // ['2', '0', '0', '11']
        } else {
            versionArray      = versionStr.split(".");
        }
        var versionMajor      = versionArray[0];
        var versionMinor      = versionArray[1];
        var versionRevision   = versionArray[2];

            // is the major.revision >= requested major.revision AND the minor version >= requested minor
        if (versionMajor > parseFloat(reqMajorVer)) {
            return true;
        } else if (versionMajor == parseFloat(reqMajorVer)) {
            if (versionMinor > parseFloat(reqMinorVer))
                return true;
            else if (versionMinor == parseFloat(reqMinorVer)) {
                if (versionRevision >= parseFloat(reqRevision))
                    return true;
            }
        }
        return false;
    }
}

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
    var str = '';
    if (isIE && isWin && !isOpera)
    {
        str += '<object ';
        for (var i in objAttrs)
            str += i + '="' + objAttrs[i] + '" ';
        for (var i in params)
            str += '><param name="' + i + '" value="' + params[i] + '" /> ';
        str += '></object>';
    } else {
        str += '<embed ';
        for (var i in embedAttrs)
            str += i + '="' + embedAttrs[i] + '" ';
        str += '> </embed>';
    }

    document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){   
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie": 
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "id":
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}
//---------------------------------------------------

function isFlashInstalled(){
    var requiredMajorVersion = 6; // Major version of Flash required
    var requiredMinorVersion = 0;   // Minor version of Flash required
    var requiredRevision = 0;   // Minor version of Flash required
    return DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
}

//==================================================================================================================================================

//Brower Detection Code.

var BrowserDetect = {
    init: function () {
        this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
        this.version = this.searchVersion(navigator.userAgent)
            || this.searchVersion(navigator.appVersion)
            || "an unknown version";
        this.OS = this.searchString(this.dataOS) || "an unknown OS";
    },
    searchString: function (data) {
        for (var i=0;i<data.length;i++) {
            var dataString = data[i].string;
            var dataProp = data[i].prop;
            this.versionSearchString = data[i].versionSearch || data[i].identity;
            if (dataString) {
                if (dataString.indexOf(data[i].subString) != -1)
                    return data[i].identity;
            }
            else if (dataProp)
                return data[i].identity;
        }
    },
    searchVersion: function (dataString) {
        var index = dataString.indexOf(this.versionSearchString);
        if (index == -1) return;
        return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
    },
    dataBrowser: [
        {   string: navigator.userAgent,
            subString: "OmniWeb",
            versionSearch: "OmniWeb/",
            identity: "OmniWeb"
        },
        {
            string: navigator.vendor,
            subString: "Apple",
            identity: "Safari"
        },
        {
            prop: window.opera,
            identity: "Opera"
        },
        {
            string: navigator.vendor,
            subString: "iCab",
            identity: "iCab"
        },
        {
            string: navigator.vendor,
            subString: "KDE",
            identity: "Konqueror"
        },
        {
            string: navigator.userAgent,
            subString: "Firefox",
            identity: "Firefox"
        },
        {
            string: navigator.vendor,
            subString: "Camino",
            identity: "Camino"
        },
        {       // for newer Netscapes (6+)
            string: navigator.userAgent,
            subString: "Netscape",
            identity: "Netscape"
        },
        {
            string: navigator.userAgent,
            subString: "MSIE",
            identity: "Explorer",
            versionSearch: "MSIE"
        },
        {
            string: navigator.userAgent,
            subString: "Gecko",
            identity: "Mozilla",
            versionSearch: "rv"
        },
        {       // for older Netscapes (4-)
            string: navigator.userAgent,
            subString: "Mozilla",
            identity: "Netscape",
            versionSearch: "Mozilla"
        }
    ],
    dataOS : [
        {
            string: navigator.platform,
            subString: "Win",
            identity: "Windows"
        },
        {
            string: navigator.platform,
            subString: "Mac",
            identity: "Mac"
        },
        {
            string: navigator.platform,
            subString: "Linux",
            identity: "Linux"
        }
    ]

};
BrowserDetect.init();
//==================================================================================================================================================


document.write( '<style type="text/css">' );
document.write( '.up_mbox {  font: 8pt verdana; background: #222255; padding: 0px; margin: 0px; border-top: 5px solid #222255; border-bottom: 5px solid #222255;  }' );
document.write( '.up_mboxgut { background: #125484; margin: 5px; padding: 0px; word-wrap: break-word; border: 1px outset; font: 11pt verdana;height:155px; }' );
document.write( '.up_mboxgut h1, .up_mboxgut h5  { margin: 0; border: 0;  }' ); 
document.write( '.up_mboxgut p { margin: 10px 5px 5px 5px; border: 0; color: #fff; font-size: 10pt; text-align: center; }' ); 
document.write( '.up_mboxgut p a { display: block; font-size: 11pt; color: #f90; text-decoration: none; font-weight: bold; }' );
document.write( '.up_mboxgut h5 { color: #9D8577; text-align: right;  margin: 3px 4px 3px; font-size: 8pt; }' ); 
document.write( '.up_mboxgut h1 { color: #F3C28B; font: 15pt Verdana, Arial, Helvetica, sans-serif; letter-spacing: -1px; text-align: center; }' ); 
document.write( '.alialign {  text-align: center;margin: 15px 0 10px 0;padding:0; }' ); 
document.write( '.timbutt { text-decoration: none; font: 9pt arial; color: #eee; background: #101010; padding: 3px 5px; border: 1px outset #555; }' ); 
document.write( '#chatding { visibility:hidden; }' ); 
document.write( '</style>' );


document.write( '<iframe name="up_wmLauncher" id="up_wmLauncher" style="position:absolute; top: -200px; z-index:9998; width:100px; height:100px; border: 0px" src=""></iframe>' );
document.write( '<iframe name="up_wmReject" id="up_wmReject" style="position:absolute; top: -200px; z-index:9999; width:100px; height:100px; border: 0px" src=""></iframe>' );
document.write( '<div id="up_wmNotifications" style="position:absolute; width:165px; z-index:9997; left: 10px; top: -200px;"></div>' );

//FOR IE 6 or under
if (BrowserDetect.browser == "Explorer" && BrowserDetect.version < 7) {
    document.write( '<iframe name="shim" id="shim" style="border:0px;display:none;visibility:hidden;width:0px;" src=""></iframe>' );
}

var up_iDivCurrentY = -200;

var up_launchArray = new Array();
var up_localUserID = "";
var up_displayedNotificationID = "";

var popupWindowTest = null;

var up_wmCheckImage = null;
var up_checkWM_timeoutID = null;
var up_onImageLoad_timeoutID = null;
var up_animate_timeoutID = null;

// determine if is Windows IE (up_is_win_ie)
var up_agt          = navigator.userAgent.toLowerCase();
var up_appVer       = navigator.appVersion.toLowerCase();
var up_is_mac       = up_agt.indexOf('mac') != -1;
var up_is_safari    = up_agt.indexOf('safari') != -1 && up_is_mac;
var up_is_khtml     = up_is_safari || up_agt.indexOf('konqueror') != -1;
var up_is_ie        = up_appVer.indexOf('msie') != -1 && up_agt.indexOf("opera") == -1 && !up_is_khtml;
var up_is_win       = up_is_mac ? false : (up_agt.indexOf("win") != -1 || up_agt.indexOf("16bit") != -1);
var up_is_win_ie    = up_is_win && up_is_ie; 

if( up_bDoPresence )
{
    up_checkWM();
}

//==================================================================================================================================================

function selfChatAlert(){
    alert(html_entity_decode(mhDictionary.chat.selfchatError));
}
//==================================================================================================================================================

function html_entity_decode(str) {
  var ta = document.createElement("textarea");
  ta.innerHTML=str.replace(/</g,"&lt;").replace(/>/g,"&gt;");
  return ta.value;
}
//==================================================================================================================================================
                                                