Академический Документы
Профессиональный Документы
Культура Документы
var SkypeActiveCallButtonPart = 0;
var skype_aFreeCallIds = new Array();
//var skype_sPathPrefix = "skype_ff_toolbar_win/";
//chrome://skype_ff_toolbar_win/content/
var skype_sPathPrefix = "chrome://skype_ff_toolbar_win/content/";
function SkypeSetCallButtonPart(obj)
{
if (obj.getAttribute('id') == '__skype_highlight_id_left')
{
SkypeActiveCallButtonPart = 0;
}
else if (obj.getAttribute('id') == '__skype_highlight_id_right')
{
SkypeActiveCallButtonPart = 1;
}
}
function skype_getCallButtonsParts(obj)
{
var res = new Object();
res.cb_part_l = null;
res.cb_part_ml = null;
res.cb_part_mr = null;
res.cb_part_r = null;
if (obj.getAttribute('rtl') == 'false')
{
res.cb_part_l = obj.firstChild.firstChild;
res.cb_part_ml = obj.firstChild.lastChild;
res.cb_part_mr = obj.lastChild.firstChild;
res.cb_part_r = obj.lastChild.lastChild;
res.cb_flag = obj.firstChild.lastChild.firstChild;
if (res.cb_flag &&
res.cb_flag.isSameNode(obj.firstChild.firstChild.firstChild) == true)
res.cb_flag = null;
}
else
{
res.cb_part_l = obj.lastChild.lastChild;
res.cb_part_ml = obj.lastChild.firstChild;
res.cb_part_mr = obj.firstChild.lastChild;
res.cb_part_r = obj.firstChild.firstChild;
res.cb_flag = obj.lastChild.firstChild.lastChild;
if (res.cb_flag &&
res.cb_flag.isSameNode(obj.lastChild.lastChild.lastChild) == true)
res.cb_flag = null;
}
return res;
}
var name =
skype_getSettingById("skype_message_msgFreeCallTooltip").getAttribute("value");
parts.cb_part_mr.parentNode.setAttribute("title", name);
parts.cb_part_ml.firstChild.src = skype_sPathPrefix +
"icons/skypeicon_16x16.gif";
parts.cb_part_ml.firstChild.style.backgroundImage = "none";
parts.cb_part_ml.firstChild.style.height = "12px";
function skype_isFreeCall(obj)
{
return (obj.getAttribute('freecall') == null || obj.getAttribute('freecall')
== "0") ? false : true;
}
if (hl == 1)
{
if (isFreeCall)
{
try{
var innerTextObj = obj.lastChild.firstChild;
var coords = getElementAbsolutePos(innerTextObj);
var x2 = coords.x + innerTextObj.offsetWidth;
var y2 = coords.y + innerTextObj.offsetHeight;
/*if ((_event.pageX > coords.x) && (_event.pageY > coords.y) &&
(_event.pageX < x2) && (_event.pageY < y2))
{
return;
}*/
obj.lastChild.firstChild.removeChild(obj.lastChild.firstChild.lastChild);
obj.lastChild.firstChild.removeChild(obj.lastChild.firstChild.lastChild);
}
obj.lastChild.firstChild.innerHTML +=
obj.getAttribute('context');
}
catch(e)
{alert(e);}
}
else
{
cb_part_l.style.backgroundImage = "url('" + skype_sPathPrefix +
"cb_mouseover_l.gif')";
if (cb_part_l.isSameNode(cb_part_ml) != true)
cb_part_ml.style.backgroundImage = "url('" +
skype_sPathPrefix + "cb_mouseover_m.gif')";
cb_part_mr.style.backgroundImage = "url('" + skype_sPathPrefix +
"cb_mouseover_m.gif')";
if (isInternational == "0")
{
if (SkypeActiveCallButtonPart == 0) //left
{
cb_part_r.style.backgroundImage = "url('" +
skype_sPathPrefix + "cb_mouseonflag_r"+(isFax?"_fax":"")+".gif')";
//shadow
if (cb_flag)
{
cb_flag.style.top = '1px';
cb_flag.style.left = '1px';
/*top right bottom left*/
cb_flag.style.padding = '1px 0px 0px
1px';//'2px 0px 0px 0px';
}
}
else //right
{
cb_part_r.style.backgroundImage = "url('" +
skype_sPathPrefix + "cb_mouseover_r"+(isFax?"_fax":"")+".gif')";
//flag
if (cb_flag)
{
cb_flag.style.top = '0px';
cb_flag.style.left = '0px';
cb_flag.style.padding = '0px 1px 1px
0px';//'0px 1px 1px 0px';
cb_flag.style.margin = '0px 0px 2px 0px;';
}
}
}
else
{
cb_part_r.style.backgroundImage = "url('" +
skype_sPathPrefix + "cb_mouseover_r"+(isFax?"_fax":"")+".gif')";
//flag
if (cb_flag)
{
cb_flag.style.top = '0px';
cb_flag.style.left = '0px';
cb_flag.style.padding = '0px 1px 1px 0px';
cb_flag.style.margin = '0px 0px 2px 0px;';
}
}
}
}
else
{
if (isFreeCall)
{
var innerTextObj = obj.lastChild.firstChild;
if (typeof(innerTextObj.lastChild.tagName) == "undefined")
{
var blockWidth = innerTextObj.offsetWidth - 60; // 56px -
width of freecall_label.gif, 4px - padding-left
var inject = "<img src='" + skype_sPathPrefix +
"freecall_label.gif' id='freecallLabel'>";
if (blockWidth > 0)
{
inject += "<img src='" + skype_sPathPrefix +
"space.gif' style='height: 1px; width: " + blockWidth + "px;' id='freecallSpace'>";
}
obj.lastChild.firstChild.lastChild.nodeValue = "";
innerTextObj.innerHTML += inject;
}
}
else
{
cb_part_l.style.backgroundImage = "url('" + skype_sPathPrefix +
"cb_normal_l.gif')";
if (cb_part_l.isSameNode(cb_part_ml) != true)
cb_part_ml.style.backgroundImage = "url('" +
skype_sPathPrefix + "cb_normal_m.gif')";
cb_part_mr.style.backgroundImage = "url('" + skype_sPathPrefix +
"cb_normal_m.gif')";
cb_part_r.style.backgroundImage = "url('" + skype_sPathPrefix +
"cb_normal_r"+(isFax?"_fax":"")+".gif')";
//flag
if (cb_flag)
{
cb_flag.style.top = '0px';
cb_flag.left = '0px';
cb_flag.style.padding = '0px 1px 1px 0px';
cb_flag.style.margin = '0px 0px 2px 0px;';
}
}
}
}
var skype_cb_l = '';
var skype_cb_m = '';
var skype_cb_r = '';
if (!isFreeCall)
{
if (pr == 1)
{
skype_cb_l =
cb_part_l.style.backgroundImage;//getAttribute('src');
skype_cb_m = cb_part_mr.style.backgroundImage;
skype_cb_r =
cb_part_r.style.backgroundImage;//getAttribute('src');
if (isInternational == "0")
{
if (SkypeActiveCallButtonPart == 0) //left
{
//obj.firstChild.firstChild.setAttribute('src', '" +
skype_sPathPrefix + "cb_down_l.gif');
cb_part_l.style.backgroundImage = "url('" +
skype_sPathPrefix + "cb_down_l.gif')";
if (cb_part_l.isSameNode(cb_part_ml) != true)
cb_part_ml.style.backgroundImage = "url('" +
skype_sPathPrefix + "cb_down_m.gif')";
}
else //right
{
//obj.firstChild.firstChild.setAttribute('src', '" +
skype_sPathPrefix + "cb_down_l.gif');
cb_part_l.style.backgroundImage = "url('" +
skype_sPathPrefix + "cb_down_l.gif')";
if (cb_part_l.isSameNode(cb_part_ml) != true)
cb_part_ml.style.backgroundImage = "url('" +
skype_sPathPrefix + "cb_down_m.gif')";
cb_part_mr.style.backgroundImage = "url('" +
skype_sPathPrefix + "cb_down_m.gif')";
//obj.lastChild.lastChild.setAttribute('src', '" +
skype_sPathPrefix + "cb_down_r"+(isFax?"_fax":"")+".gif');
cb_part_r.style.backgroundImage = "url('" +
skype_sPathPrefix + "cb_down_r"+(isFax?"_fax":"")+".gif')";
}
}
else
{
//obj.firstChild.firstChild.setAttribute('src', '" +
skype_sPathPrefix + "cb_down_l.gif');
cb_part_l.style.backgroundImage = "url('" +
skype_sPathPrefix + "cb_down_l.gif')";
if (cb_part_l.isSameNode(cb_part_ml) != true)
cb_part_ml.style.backgroundImage = "url('" +
skype_sPathPrefix + "cb_down_m.gif')";
cb_part_mr.style.backgroundImage = "url('" +
skype_sPathPrefix + "cb_down_m.gif')";
//obj.lastChild.lastChild.setAttribute('src', '" +
skype_sPathPrefix + "cb_down_r"+(isFax?"_fax":"")+".gif');
cb_part_r.style.backgroundImage = "url('" +
skype_sPathPrefix + "cb_down_r"+(isFax?"_fax":"")+".gif')";
}
}
else
{
//obj.firstChild.firstChild.setAttribute('src', skype_cb_l);
cb_part_l.style.backgroundImage = skype_cb_l;
if (cb_part_l.isSameNode(cb_part_ml) != true)
cb_part_ml.style.backgroundImage = skype_cb_m;
cb_part_mr.style.backgroundImage = skype_cb_m;
//obj.lastChild.lastChild.setAttribute('src', skype_cb_r);
cb_part_r.style.backgroundImage = skype_cb_r;
}
}
}
function __skype_nh_icon_mouseOver(obj)
{
//obj.setAttribute("src", getArrowedIcon(obj.getAttribute('src')));
arrowImg.setAttribute('src',"chrome://skype_ff_toolbar_win/content/icons/arrow.gif"
);
arrowImg.style.position = "absolute";
arrowImg.style.left = (coords.x + 12) + "px";
arrowImg.style.top = (coords.y) + "px";
arrowImg.setAttribute("onmouseover", "__skype_nh_icon_mouseOut2();");
arrowImg.setAttribute("onmouseout", "__skype_nh_icon_mouseOut();");
document.body.appendChild(arrowImg);
}
}
{
while (offsetParent != parentNode && parentNode !== null)
{
res.x -= parentNode.scrollLeft;
res.y -= parentNode.scrollTop;
parentNode = parentNode.parentNode;
}
}
parentNode = offsetParent.parentNode;
offsetParent = offsetParent.offsetParent;
}
}
return res;
};
function __skype_nh_icon_mouseOut(obj)
{
timerID = setTimeout(__skype_nh_icon_mouseOut1, 10);
}
function __skype_nh_icon_mouseOut2()
{
if (timerID) clearTimeout(timerID);
timerID = null;
}
function __skype_nh_icon_mouseOut1()
{
var arrow = document.getElementById("skype_arrow");
if(arrow)
document.body.removeChild(arrow);
lastX = 0;
lastY = 0;
}