<!--

var HideDoc = document.getElementById("HideDoc");
if ( !HideDoc ) {
  document.write("<div id=HideDoc style=\"position: absolute; z-index: 100; top: 0; left: 0; background-color: White; opacity: 0.9; -moz-opacity: 0.9; filter: alpha(opacity=90); visbility: hidden\"></div>");
  HideDoc = document.getElementById("HideDoc");
}

var InBodyShadow = document.getElementById("InBodyShadow");
if ( !InBodyShadow ) {
  document.write("<div id=InBodyShadow style=\"position: absolute; z-index: 101; top: 0; left: 0; opacity: 0.5; -moz-opacity: 0.5; filter: alpha(opacity=50); visbility: hidden\"></div>");
  InBodyShadow = document.getElementById("InBodyShadow");
}

var InBody = document.getElementById("InBody");
if ( !InBody ) {
  document.write("<div id=InBody style=\"position: absolute; z-index: 102; top: 0; left: 0; overflow: hidden; visbility: hidden\"></div>");
  InBody = document.getElementById("InBody");
}

function InPopup(w, h, t, u, r) {
  var pageWidth = window.innerWidth != null ? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;
  var pageHeight = window.innerHeight != null ? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null ? document.body.clientHeight : null;
  
  var x, y;
  
  if ( HideDoc ) with ( HideDoc.style ) {
    width = pageWidth; height = pageHeight; background = "Gray";
    visibility = "visible";
  }
  
  var ShadowInAngle = true;
  
  if ( InBodyShadow ) with ( InBodyShadow.style ) {
    width = w; height = h; background = "Black";
    x = ( ( w < pageWidth ) ? Math.floor( ( pageWidth - w ) / 2 ) : 10 );
    y = ( ( h < pageHeight ) ? Math.floor( ( pageHeight - h ) / 2 ) : 10 );
    if ( ShadowInAngle ) {
      x += 2; y += 2;
    } else {
      width = w + 10; height = h + 10;
      x -= 5; y -= 5;
    }
    top = y; left = x; visibility = "visible";
  }
  
  if ( InBody ) {
    with ( InBody.style ) {
      width = w; height = h; background = "White";
      if ( ShadowInAngle ) border = "1px solid Black";
      x = ( ( w < pageWidth ) ? Math.floor( ( pageWidth - w ) / 2 ) : 10 );
      y = ( ( h < pageHeight ) ? Math.floor( ( pageHeight - h ) / 2 ) : 10 );
      top = y; left = x; visibility = "visible";
    }
    
    if ( typeof(Language) == "undefined" ) Language = "PT";
    
    with ( InBody ) {
      slt = ( Language == "PT" ) ? "Fechar" : "Close"; slc = "Black";
      innerHTML = "<div style=\"width: 100%; background: LightSteelBlue; height: 17px; border-bottom: 1px solid LightGrey; padding: 2px; margin: 1px\">" +
                  "<div style=\"float: left; font-family: Verdana, sans-serif; font-size: 9pt; font-weight: bold\">" + t + "</div>" +
                  "<div style=\"float: right; font-family: Verdana, sans-serif; font-size: 7pt; text-transform: uppercase; width: 70px; height: 17px\">" +
                  "<a href=\"JavaScript:CloseInPopup(" + r + ");\" style=\"color: " + slc + "; text-decoration: none\">" +
                  slt + " <span style=\"font-size: 6pt; text-align: center; border: 1px solid " + slc + "; cursor: pointer\" title=\"" + slt + "\">&nbsp;x&nbsp;</div></span>" +
                  "</a>&nbsp;&nbsp;</div>" +
                  "</div>\n";
      if ( u == "online" ) {
        //--- Skype
        innerHTML += "<div class=Skype align=center>Skype<sup>TM</sup><br>\n" +
                     "<script type=\"text/javascript\" src=\"http://download.skype.com/share/skypebuttons/js/skypeCheck.js\"></script>\n" +
                     "<a href=\"skype:caladan.software?call\"><img src=\"http://mystatus.skype.com/smallclassic/caladan%2Esoftware\" border=0 title=\"Skype Caladan Software\" vspace=5></a><br>\n" +
                     "</div>\n";
        //--- Windows Live Messenger
        innerHTML += "<div class=Messenger align=center>Windows Live Messenger<br>\n" +
                     "<script type=text/javascript src=http://settings.messenger.live.com/controls/1.0/PresenceButton.js></script>\n" +
                     "<div id=Microsoft_Live_Messenger_PresenceButton_7e330cdef74ad0a9 \n" +
                     "msgr:width=100 msgr:backColor=#77ADCF msgr:altBackColor=#FFFFFF msgr:foreColor=#424542 \n" +
                     "msgr:conversationUrl=http://settings.messenger.live.com/Conversation/IMMe.aspx?invitee=7e330cdef74ad0a9@apps.messenger.live.com&mkt=" + ( ( Language == "PT" )?"pt-br":"en-us" ) + 
                     "&useTheme=true&themeName=blue&foreColor=333333&backColor=E8F1F8&linkColor=333333&borderColor=AFD3EB&buttonForeColor=333333&buttonBackColor=EEF7FE&buttonBorderColor=AFD3EB&buttonDisabledColor=EEF7FE" +
                     "&headerForeColor=0066A7&headerBackColor=8EBBD8&menuForeColor=333333&menuBackColor=FFFFFF&chatForeColor=333333&chatBackColor=FFFFFF&chatDisabledColor=F6F6F6&chatErrorColor=760502&chatLabelColor=6E6C6C " +
                     "title=\"Windows Live Messenger\"></div>\n" +
                     "<script type=text/javascript src=http://messenger.services.live.com/users/7e330cdef74ad0a9@apps.messenger.live.com/presence?dt=&mkt=" + ( ( Language == "PT" )?"pt-br":"en-us" ) + 
                     "&cb=Microsoft_Live_Messenger_PresenceButton_onPresence></script>\n" +
                     "</div>\n";
        //---
      } else innerHTML += "<iframe src=\"" + u + "\" width=100% height=100% frameborder=0></iframe>";
    }
  }
}

function CloseInPopup(r) {
  var InBody = document.getElementById("InBody");
  InBody.style.visibility = "hidden";
  
  var InBodyShadow = document.getElementById("InBodyShadow");
  InBodyShadow.style.visibility = "hidden";
  
  var HideDoc = document.getElementById("HideDoc");
  HideDoc.style.visibility = "hidden";
  
  if ( r ) window.location.reload();
}

//-->
