/**
** Ferramentas para Blogs : Colmeia
** Todos os Direitos Reservados
** www.colmeia.blog.br
**/
function messengerWindow()
{
if (document.readyState == undefined || document.readyState == "complete" || document.readyState == "interactive")
{
var mybody = document.body;
if (mybody)
mybody.appendChild(messengerBox());
}
else {
setTimeout ('messengerWindow();', 1000);
}
}
function messengerBox()
{
var mydiv = document.createElement("div");
mydiv.setAttribute("id","coMessengerWindow");
mydiv.style.position = "absolute";
mydiv.style.display = "block";
mydiv.style.zIndex = "99999";
mydiv.style.width = "215px";
mydiv.style.height = "130px";
mydiv.style.margin = "0px";
mydiv.style.padding = "0px";
mydiv.style.left = (f_clientWidth() + f_scrollLeft() - 218) + "px";
mydiv.style.top = (f_clientHeight() + f_scrollTop() + 18) + "px";
var image = "http://lh6.ggpht.com/_WssQk7qVzyc/SxKcepvZxyI/AAAAAAAACa0/9rqHoiRUs8U/s160/140.jpg";
var name = "Santinha";
var text = "Oi... tenho outras fotos no meu perfil.";
var innerdiv = '
';
innerdiv += '

';
innerdiv += '

';
innerdiv += '
';
innerdiv += '
' + name + '';
innerdiv += '
' + text + '';
innerdiv += '
';
mydiv.innerHTML = innerdiv;
return mydiv;
}
var leftC = 218;
var topC = 134;
function fixImage( img )
{
var arVersion = navigator.appVersion.split("MSIE");
var version = parseFloat(arVersion[1]);
if ((version >= 5.5) && (document.body.filters))
{
var imgName = img.src.toUpperCase()
if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
{
var imgID = (img.id) ? "id='" + img.id + "' " : "";
var imgClass = (img.className) ? "class='" + img.className + "' " : "";
var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
var imgStyle = "display:inline-block;" + img.style.cssText;
if (img.align == "left") imgStyle = "float:left;" + imgStyle;
if (img.align == "right") imgStyle = "float:right;" + imgStyle;
if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
var strNewHTML = "";
img.outerHTML = strNewHTML;
i = i-1;
}
}
setWindowPosition();
}
function closeMessengerWindow( node )
{
var mydiv = document.getElementById("coMessengerWindow");
mydiv.parentNode.removeChild(mydiv);
}
var setPosition = false;
function setWindowPosition()
{
if (setPosition)
{
var mycontent = document.getElementById("coMessengerContent")
if (mycontent)
mycontent.style.visibility = "visible";
var mydiv = document.getElementById("coMessengerWindow");
if (mydiv)
{
var leftFinal = (f_clientWidth() + f_scrollLeft()) - leftC;
var topFinal = (f_clientHeight() + f_scrollTop()) - topC;
var leftNow = parseInt(mydiv.style.left.toString().split("px")[0]);
var topNow = parseInt(mydiv.style.top.toString().split("px")[0]);
var leftSize = leftFinal - leftNow;
var topSize = topFinal - topNow;
if (leftSize)
mydiv.style.left = ( leftNow + (leftSize / 5) ) + "px";
if (topSize)
mydiv.style.top = ( topNow + (topSize / 5) ) + "px";
setTimeout("setWindowPosition();", 40);
}
}
else
setPosition = true;
}
function f_clientWidth() {
return f_filterResults (
window.innerWidth ? window.innerWidth : 0,
document.documentElement ? document.documentElement.clientWidth : 0,
0
);
// document.body ? document.body.clientWidth : 0
}
function f_clientHeight() {
return f_filterResults (
window.innerHeight ? window.innerHeight : 0,
document.documentElement ? document.documentElement.clientHeight : 0,
0
);
// document.body ? document.body.clientHeight : 0
}
function f_scrollLeft() {
return f_filterResults (
window.pageXOffset ? window.pageXOffset : 0,
document.documentElement ? document.documentElement.scrollLeft : 0,
document.body ? document.body.scrollLeft : 0
);
}
function f_scrollTop() {
return f_filterResults (
window.pageYOffset ? window.pageYOffset : 0,
document.documentElement ? document.documentElement.scrollTop : 0,
document.body ? document.body.scrollTop : 0
);
}
function f_filterResults(n_win, n_docel, n_body) {
var n_result = n_win ? n_win : 0;
if (n_docel && (!n_result || (n_result > n_docel)))
n_result = n_docel;
return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}
setTimeout ('messengerWindow();', 4000);