if (typeof (stLight) == "undefined" && typeof (SHARETHIS) == "undefined") {
stLight = new function() {
this.publisher = null;
this.sessionID_time = (new Date()).getTime().toString();
this.sessionID_rand = Number(
Math.random().toPrecision(5).toString().substr(2)).toString();
this.sessionID = this.sessionID_time + "." + this.sessionID_rand;
this.fpc = null;
this.counter = 0;
this.readyRun = false;
this.meta = {
hostname : document.location.host,
location : document.location.pathname
}
};
stLight.onReady = function() {
stLight.readyRun = true;
if (stLight.publisher == null) {
if (typeof (window.console) !== "undefined") {
try {
console
.log("Please specify a ShareThis Publisher Key \nFor help, contact support@sharethis.com")
} catch (a) {
}
}
}
stLight.log("pview", null, null);
stWidget.options.sessionID = stLight.sessionID;
stWidget.options.fpc = stLight.fpc;
stButtons.onReady()
};
stLight.log = function(c) {
var d = (("https:" == document.location.protocol) ? "http://l."
: "http://l.")
+ "sharethis.com/log?event=";
if (c == "pview") {
d = (("https:" == document.location.protocol) ? "http://l."
: "http://l.")
+ "sharethis.com/pview?event="
}
var a = stLight.dbrInfo();
if (a == false) {
a = ""
}
d += c;
d += "&source=lightLoader";
d += "&publisher=" + encodeURIComponent(stLight.publisher)
+ "&hostname=" + encodeURIComponent(stLight.meta.hostname)
+ "&location=" + encodeURIComponent(stLight.meta.location)
+ "&url=" + encodeURIComponent(document.location.href)
+ "&sessionID=" + stLight.sessionID + "&fpc=" + stLight.fpc
+ "&ts" + (new Date()).getTime() + "." + stLight.counter++
+ "&r_sessionID=&hash_flag=&shr=&count=" + a;
var b = new Image(1, 1);
b.src = d;
b.onload = function() {
return
};
if (c == "pview") {
stLight.createSegmentFrame()
}
};
stLight._stFpc = function() {
if (!document.domain || document.domain.search(/\.gov/) > 0) {
return false
}
var g = stLight._stGetFpc("__unam");
if (g == false) {
var c = Math.round(Math.random() * 2147483647);
c = c.toString(16);
var h = (new Date()).getTime();
h = h.toString(16);
var e = "";
var a = stLight._stGetD();
a = a.split(/\./)[1];
if (!a) {
return false
}
e = stLight._stdHash(a) + "-" + h + "-" + c + "-1";
g = e;
stLight._stSetFpc(g)
} else {
var b = g;
var f = b.split(/\-/);
if (f.length == 4) {
var d = Number(f[3]);
d++;
b = f[0] + "-" + f[1] + "-" + f[2] + "-" + d;
g = b;
stLight._stSetFpc(g)
}
}
return g
};
stLight._stSetFpc = function(g) {
var a = "__unam";
var c = new Date;
var i = c.getFullYear();
var f = c.getMonth() + 9;
var h = c.getDate();
var d = a + "=" + escape(g);
if (i) {
var b = new Date(i, f, h);
d += "; expires=" + b.toGMTString()
}
var e = stLight._stGetD();
d += "; domain=" + escape(e) + ";path=/";
document.cookie = d
};
stLight._stGetD = function() {
var b = document.domain.split(/\./);
var a = "";
if (b.length > 1) {
a = "." + b[b.length - 2] + "." + b[b.length - 1]
}
return a
};
stLight._stGetFpc = function(b) {
var a = document.cookie.match("(^|;) ?" + b + "=([^;]*)(;|$)");
if (a) {
return (unescape(a[2]))
} else {
return false
}
};
stLight._stdHash = function(a) {
var e = 0, d = 0;
for ( var c = a.length - 1; c >= 0; c--) {
var b = parseInt(a.charCodeAt(c));
e = ((e << 8) & 268435455) + b + (b << 12);
if ((d = e & 161119850) != 0) {
e = (e ^ (d >> 20))
}
}
return e.toString(16)
};
stLight._thisScript = null;
stLight.getShareThisLightScript = function() {
var d = document.getElementsByTagName("script");
var c = null;
for ( var b = 0; b < d.length; b++) {
var a = d[b].src;
if (a.search(/.*sharethis.*\/button\/light.*/) >= 0) {
c = d[b]
}
}
return c
};
stLight.dbrInfo = function() {
var a = document.referrer;
var d = new RegExp(document.domain, "gi");
if (d.test(a) == true) {
return false
}
if (a && a.length > 0) {
var c = /(http:\/\/)(.*?)\/.*/i;
var b = /(^.*\?)(.*)/ig;
var g = "";
var f = a.replace(c, "$2");
if (f.length > 0) {
g += "&refDomain=" + f
} else {
return false
}
var e = a.replace(b, "$2");
if (e.length > 0) {
g += "&refQuery=" + encodeURIComponent(e)
}
return g
} else {
return false
}
};
stLight.odjs = function(a, b) {
this.head = document.getElementsByTagName("head")[0];
this.scriptSrc = a;
this.script = document.createElement("script");
this.script.setAttribute("type", "text/javascript");
this.script.setAttribute("src", this.scriptSrc);
this.script.onload = b;
this.script.onreadystatechange = function() {
if (this.readyState == "loaded" || this.readyState == "complete") {
b()
}
};
this.head.appendChild(this.script)
};
if (window.document.readyState == "completed") {
stLight.onReady()
} else {
if (typeof (window.addEventListener) != "undefined") {
window.addEventListener("load", stLight.onReady, false)
} else {
if (typeof (document.addEventListener) != "undefined") {
document.addEventListener("load", stLight.onReady, false)
} else {
if (typeof window.attachEvent != "undefined") {
window.attachEvent("onload", stLight.onReady)
}
}
}
}
stLight.createSegmentFrame = function() {
try {
stLight.segmentframe = document
.createElement('')
} catch (b) {
stLight.segmentframe = document.createElement("iframe")
}
stLight.segmentframe.id = "stSegmentFrame";
stLight.segmentframe.name = "stSegmentFrame";
var c = document.body;
var a = (("https:" == document.location.protocol) ? "http://seg."
: "http://seg.")
+ "sharethis.com/getSegment.php?rnd=" + (new Date()).getTime();
stLight.segmentframe.src = a;
c.appendChild(stLight.segmentframe);
stLight.segmentframe.frameBorder = "0";
stLight.segmentframe.scrolling = "no";
stLight.segmentframe.width = "0px";
stLight.segmentframe.height = "0px"
};
stLight.fpc = stLight._stFpc();
stLight.options = function(a) {
if (a && a.publisher) {
stLight.publisher = a.publisher
}
for ( var b in a) {
if (stWidget.options.hasOwnProperty(b) && a[b] !== null) {
stWidget.options[b] = a[b]
}
}
}
}
var stButtons = {};
stButtons.makeButton = function(d) {
var w = d.service;
var k = d.text;
if (k == null && (d.type == "vcount" || d.type == "hcount")) {
k = "Share"
}
var f = stWidget.ogurl ? stWidget.ogurl : document.location.href;
f = d.url ? d.url : f;
var v = stWidget.ogtitle ? stWidget.ogtitle : document.title;
v = d.title ? d.title : v;
if (/(http|https):\/\//.test(f) == false) {
f = decodeURIComponent(f);
v = decodeURIComponent(v)
}
if (/(http|https):\/\//.test(f) == false) {
f = decodeURIComponent(f);
v = decodeURIComponent(v)
}
var u = document.createElement("span");
u
.setAttribute("style",
"text-decoration:none;color:#000000;display:inline-block;cursor:pointer;");
u.className = "stButton";
if (d.type == "custom") {
d.element.onclick = function() {
var x = document.createElement("form");
x.setAttribute("method", "GET");
x.setAttribute("action", "http://wd.sharethis.com/api/sharer.php");
x.setAttribute("target", "_blank");
var y = {
url : f,
title : v,
destination : w,
publisher : stLight.publisher,
fpc : stLight.fpc,
sessionID : stLight.sessionID
};
if (stWidget.ogimg != null) {
y.image = stWidget.ogimg
}
if (stWidget.ogdesc != null) {
y.desc = stWidget.ogdesc
}
for ( var b in y) {
var a = document.createElement("input");
a.setAttribute("type", "hidden");
a.setAttribute("name", b);
a.setAttribute("value", y[b]);
x.appendChild(a)
}
document.body.appendChild(x);
x.submit()
};
return false
}
if (w != "email" && w != "sharethis") {
u.onclick = function() {
var x = document.createElement("form");
x.setAttribute("method", "GET");
x.setAttribute("action", "http://wd.sharethis.com/api/sharer.php");
x.setAttribute("target", "_blank");
var y = {
url : f,
title : v,
destination : w,
publisher : stLight.publisher,
fpc : stLight.fpc,
sessionID : stLight.sessionID
};
if (stWidget.ogimg != null) {
y.image = stWidget.ogimg
}
if (stWidget.ogdesc != null) {
y.desc = stWidget.ogdesc
}
for ( var b in y) {
var a = document.createElement("input");
a.setAttribute("type", "hidden");
a.setAttribute("name", b);
a.setAttribute("value", y[b]);
x.appendChild(a)
}
document.body.appendChild(x);
x.submit()
}
}
if (d.type == "chicklet") {
var p = document.createElement("span");
p.className = "chicklets " + w;
if (k == null) {
p.innerHTML = " "
} else {
p.appendChild(document.createTextNode(k))
}
u.appendChild(p);
return u
} else {
if (d.type == "large") {
var p = document.createElement("span");
p.className = "stLarge";
p.style.backgroundImage = "url('http://w.sharethis.com/images/" + w
+ "_32.png')";
u.appendChild(p);
return u
} else {
if (d.type == "button" || d.type == "vcount" || d.type == "hcount") {
var c = document.createElement("span");
c.className = "stButton_gradient";
var j = document.createElement("span");
j.className = "chicklets " + w;
if (k == null) {
j.innerHTML = " "
} else {
j.appendChild(document.createTextNode(k))
}
c.appendChild(j);
if (w == "twitter") {
var r = document.createElement("span");
r.className = "stTwbutton";
r.innerHTML = " ";
c = r
} else {
if (w == "facebook") {
var q = document.createElement("span");
q.className = "stFb";
var n = document.createElement("span");
n.className = "stFb_text";
n.innerHTML = "Share";
q.appendChild(n);
c = q
}
}
if (d.type == "vcount") {
if (w == "twitter") {
var i = document.createElement("span");
var t = document.createElement("div");
t.className = "stTwbubble";
var g = document.createElement("div");
g.className = "stBubble_count";
t.appendChild(g);
i.appendChild(t);
i.appendChild(r);
u.appendChild(i);
stButtons.getCount(f, w, g)
} else {
if (w == "facebook") {
var t = document.createElement("div");
t.className = "stFb_vbubble";
var g = document.createElement("div");
g.className = "stBubble_count";
var m = document.createElement("span");
m.className = "stFb_bottom";
t.appendChild(g);
u.appendChild(t);
u.appendChild(m);
u.appendChild(q);
stButtons.getCount(f, w, g)
} else {
var i = document.createElement("span");
var t = document.createElement("div");
t.className = "stBubble";
var g = document.createElement("div");
g.className = "stBubble_count";
t.appendChild(g);
i.appendChild(t);
i.appendChild(c);
u.appendChild(i);
stButtons.getCount(f, w, g)
}
}
} else {
if (d.type == "hcount") {
if (w == "twitter") {
var i = document.createElement("span");
var q = document.createElement("span");
q.setAttribute("style", "display:inline-block");
var o = document.createElement("span");
o.className = "stTwVbubble_left";
o.innerHTML = " ";
var n = document.createElement("span");
n.className = "stTwVbubble";
q.appendChild(o);
q.appendChild(n);
i.appendChild(r);
i.appendChild(q);
u.appendChild(i);
stButtons.getCount(f, w, n)
} else {
if (w == "facebook") {
var m = document.createElement("span");
m.className = "stFb_left";
var l = document.createElement("span");
l.className = "stFb_hbubble";
u.appendChild(q);
u.appendChild(m);
u.appendChild(l);
stButtons.getCount(f, w, l)
} else {
var i = document.createElement("span");
var s = document.createElement("span");
s.className = "stButton_gradient stHBubble";
var h = document.createElement("span");
h.className = "stButton_left";
h.innerHTML = " ";
var e = document.createElement("span");
e.className = "stButton_right";
e.innerHTML = " ";
var g = document.createElement("span");
g.className = "stBubble_hcount";
s.appendChild(g);
i.appendChild(c);
i.appendChild(s);
u.appendChild(i);
stButtons.getCount(f, w, g)
}
}
} else {
u.appendChild(c)
}
}
}
}
}
return u
};
stButtons.getCount = function(c, a, e) {
var b = false;
for ( var d = 0; d < stButtons.counts.length; d++) {
var g = stButtons.counts[d];
if (g.ourl == c) {
b = true;
var h = "";
try {
if (a == "sharethis") {
h = (g.total > 0) ? stButtons.human(g.total) : "New"
} else {
if (a == "facebook" && typeof (g.facebook2) != "undefined") {
h = stButtons.human(g.facebook2)
} else {
if (typeof (g[a]) != "undefined") {
h = (g[a] > 0) ? stButtons.human(g[a]) : "0"
} else {
h = "0"
}
}
}
e.appendChild(document.createTextNode(h))
} catch (f) {
}
}
}
if (b == false) {
stButtons.getCountsFromService(c, a, e)
}
};
stButtons.human = function(a) {
if (a >= 10000) {
a = a / 100;
a = Math.round(a);
a = a / 10;
a = a + "K"
}
return a
};
stButtons.locateElements = function() {
var f = document.getElementsByTagName("*");
var h = [];
var g = new RegExp(/st_(.*?)_custom/);
var e = new RegExp(/st_(.*?)_vcount/);
var d = new RegExp(/st_(.*?)_hcount/);
var c = new RegExp(/st_(.*?)_button/);
var b = new RegExp(/st_(.*?)_large/);
var a = new RegExp(/^st_(.*?)$/);
var k = f.length;
for ( var j = 0; j < k; j++) {
if (f[j].className.match(g) && f[j].className.match(g).length >= 2
&& f[j].className.match(g)[1]) {
if (stButtons.testElem(f[j]) == false) {
stButtons.elemArr.push(f[j]);
h.push( {
service : f[j].className.match(g)[1],
element : f[j],
url : f[j].getAttribute("st_url"),
title : f[j].getAttribute("st_title"),
text : f[j].getAttribute("displayText"),
type : "custom"
})
}
} else {
if (f[j].className.match(e) && f[j].className.match(e).length >= 2
&& f[j].className.match(e)[1]) {
if (stButtons.testElem(f[j]) == false) {
stButtons.elemArr.push(f[j]);
h.push( {
service : f[j].className.match(e)[1],
element : f[j],
url : f[j].getAttribute("st_url"),
title : f[j].getAttribute("st_title"),
text : f[j].getAttribute("displayText"),
type : "vcount"
})
}
} else {
if (f[j].className.match(d)
&& f[j].className.match(d).length >= 2
&& f[j].className.match(d)[1]) {
if (stButtons.testElem(f[j]) == false) {
stButtons.elemArr.push(f[j]);
h.push( {
service : f[j].className.match(d)[1],
element : f[j],
url : f[j].getAttribute("st_url"),
title : f[j].getAttribute("st_title"),
text : f[j].getAttribute("displayText"),
type : "hcount"
})
}
} else {
if (f[j].className.match(c)
&& f[j].className.match(c).length >= 2
&& f[j].className.match(c)[1]) {
if (stButtons.testElem(f[j]) == false) {
stButtons.elemArr.push(f[j]);
h.push( {
service : f[j].className.match(c)[1],
element : f[j],
url : f[j].getAttribute("st_url"),
title : f[j].getAttribute("st_title"),
text : f[j].getAttribute("displayText"),
type : "button"
})
}
} else {
if (f[j].className.match(b)
&& f[j].className.match(b).length >= 2
&& f[j].className.match(b)[1]) {
if (stButtons.testElem(f[j]) == false) {
stButtons.elemArr.push(f[j]);
h.push( {
service : f[j].className.match(b)[1],
element : f[j],
url : f[j].getAttribute("st_url"),
title : f[j].getAttribute("st_title"),
text : f[j].getAttribute("displayText"),
type : "large"
})
}
} else {
if (f[j].className.match(a)
&& f[j].className.match(a).length >= 2
&& f[j].className.match(a)[1]) {
if (stButtons.testElem(f[j]) == false) {
stButtons.elemArr.push(f[j]);
h
.push( {
service : f[j].className
.match(a)[1],
element : f[j],
url : f[j]
.getAttribute("st_url"),
title : f[j]
.getAttribute("st_title"),
text : f[j]
.getAttribute("displayText"),
type : "chicklet"
})
}
}
}
}
}
}
}
}
for ( var j = 0; j < h.length; j++) {
stWidget.addEntry(h[j])
}
};
stButtons.odcss = function(a, b) {
this.head = document.getElementsByTagName("head")[0];
this.scriptSrc = a;
this.css = document.createElement("link");
this.css.setAttribute("rel", "stylesheet");
this.css.setAttribute("type", "text/css");
this.css.setAttribute("href", this.scriptSrc);
setTimeout(function() {
b()
}, 500);
this.head.appendChild(this.css)
};
stButtons.makeButtons = function() {
stButtons.odcss("http://w.sharethis.com/button/css/buttons.css",
function() {
});
stButtons.locateElements()
};
stButtons.addCount = function(a) {
stButtons.counts.push(a)
};
stButtons.getCountsFromService = function(b, a, c) {
if (stButtons.checkQueue(b) == false) {
stLight.odjs("http://wd.sharethis.com/api/getCount.php?url="
+ encodeURIComponent(b), function() {
if (typeof (__stCount) != "undefined") {
__stCount.ourl = b;
stButtons.addCount(__stCount);
stButtons.getCount(b, a, c)
}
});
stButtons.queue.push(b)
} else {
setTimeout(function() {
stButtons.getCount(b, a, c)
}, 300)
}
};
stButtons.checkQueue = function(a) {
for ( var b = 0; b < stButtons.queue.length; b++) {
if (stButtons.queue[b] == a) {
return true
}
}
return false
};
stButtons.elemArr = [];
stButtons.testElem = function(c) {
var a = false;
for ( var b = 0; b < stButtons.elemArr.length; b++) {
if (c == stButtons.elemArr[b]) {
a = true
}
}
if (a == true) {
return true
} else {
return false
}
};
function Shareable(a) {
this.idx = -1;
this.url = null;
this.title = null;
this.image = null;
this.element = null;
this.service = null;
this.screen = "home";
this.summary = null;
this.content = null;
this.buttonText = null;
this.frag = null;
this.onhover = true;
this.attachButton = function(b) {
this.element = b;
if (this.onhover == true) {
b.onmouseover = this.mouseOn;
b.onmouseout = function() {
clearInterval(stWidget.mouseOnTimer)
}
} else {
b.onclick = this.popup
}
};
this.init = function() {
stWidget.merge(this, a);
stWidget.shareables.push(this);
if (a.element !== null) {
this.attachButton(a.element)
}
};
return this
}
var stWidget = new function() {
this.shareables = [];
this.entries = 0;
this.widgetOpen = false;
this.mouseOnTimer = null;
this.mouseOutTimer = null;
this.frameReady = false;
this.frameUrl = (("https:" == document.location.protocol) ? "https://ws.sharethis.com/secure/index.html"
: "http://edge.sharethis.com/share4x/index.html");
this.secure = false;
try {
this.mainstframe = document
.createElement('');
this.mainstframe.onreadystatechange = function() {
if (stWidget.mainstframe.readyState === "complete") {
stWidget.frameReady = true
}
}
} catch (a) {
this.mainstframe = document.createElement("iframe");
this.mainstframe.allowTransparency = "true";
this.mainstframe.setAttribute("allowTransparency", "true");
this.mainstframe.onload = function() {
stWidget.frameReady = true
}
}
this.mainstframe.id = "stLframe";
this.mainstframe.className = "stLframe";
this.mainstframe.name = "stLframe";
this.mainstframe.frameBorder = "0";
this.mainstframe.scrolling = "no";
this.mainstframe.width = "345px";
this.mainstframe.height = "450px";
this.mainstframe.style.top = "0px";
this.mainstframe.style.left = "0px";
this.mainstframe.src = "";
this.wrapper = document.createElement("div");
this.wrapper.id = "stwrapper";
this.wrapper.className = "stwrapper";
this.wrapper.style.visibility = "hidden";
this.wrapper.style.top = "-999px";
this.wrapper.style.left = "-999px";
this.closewrapper = document.createElement("div");
this.closewrapper.className = "stclose";
this.closewrapper.onclick = function() {
stWidget.closeWidget()
};
this.wrapper.appendChild(this.closewrapper);
this.wrapper.appendChild(this.mainstframe);
this.ogtitle = null;
this.ogdesc = null;
this.ogurl = null;
this.ogimg = null;
this.ogtype = null;
this.initFire = false;
this.merge = function(d, c) {
for ( var b in c) {
if (d.hasOwnProperty(b) && c[b] !== null) {
d[b] = c[b]
}
}
};
this.oldScroll = 0;
this.init = function() {
if (stWidget.initFire == false) {
stWidget.initFire = true;
window.frames.stLframe.location.replace(stWidget.frameUrl
+ stWidget.createFrag(null, "init"))
}
}
};
stWidget.options = new function() {
this.fpc = stLight.fpc;
this.sessionID = null;
this.publisher = null;
this.tracking = null;
this.send_services = null;
this.exclusive_service = null;
this.headerTitle = null;
this.headerfg = null;
this.headerbg = null;
this.offsetLeft = null;
this.offsetTop = null;
this.onhover = true;
this.autoclose = true;
this.autoPosition = true;
this.embeds = false;
this.doneScreen = true
};
stWidget.addEntry = function(a) {
if (!a.element) {
return false
}
if (a && (a.service != "email" && a.service != "sharethis")) {
if (a.type !== "custom") {
a.element.appendChild(stButtons.makeButton(a))
} else {
stButtons.makeButton(a)
}
return true
} else {
if (a.type != "custom") {
a.element.appendChild(stButtons.makeButton(a))
}
var b = new Shareable(a);
b.idx = stWidget.entries;
stWidget.entries++;
b.publisher = stLight.publisher;
b.sessionID = stLight.sessionID;
b.fpc = stLight.fpc;
if (stWidget.ogimg != null) {
b.image = stWidget.ogimg
}
if (stWidget.ogdesc != null) {
b.summary = stWidget.ogdesc
}
stWidget.merge(b, stWidget.options);
b.mouseOn = function() {
stWidget.mouseOnTimer = setTimeout(b.popup, 150)
};
b.popup = function() {
if (stWidget.widgetOpen == false) {
stLight.log("widget");
window.frames.stLframe.location.replace(stWidget.frameUrl
+ stWidget.createFrag(b));
stWidget.positionWidget(b);
if (stWidget.options.embeds == false) {
stWidget.hideEmbeds()
}
setTimeout(function() {
stWidget.widgetOpen = true;
st_showing = true
}, 200)
} else {
if (stWidget.widgetOpen == true
&& stWidget.options.onhover == false) {
}
}
return false
};
b.init();
return b
}
};
stWidget.createFrag = function(c, b) {
var f = "#light";
if (b == "init") {
f = "#init";
for ( var e in stWidget.options) {
if (stWidget.options.hasOwnProperty(e) == true
&& stWidget.options[e] !== null
&& typeof (stWidget.options[e]) != "function"
&& typeof (stWidget.options[e]) != "object") {
var a = stWidget.options[e];
try {
a = decodeURIComponent(a);
a = decodeURIComponent(a)
} catch (d) {
}
f = f + "/" + e + "=" + encodeURIComponent(a)
}
}
f = f
+ "/pUrl="
+ encodeURIComponent(encodeURIComponent(document.location.href))
+ ((document.title != "") ? "/title="
+ encodeURIComponent(encodeURIComponent(document.title))
: "") + "/stLight=true"
} else {
for ( var e in c) {
if (c.hasOwnProperty(e) == true && c[e] !== null
&& typeof (c[e]) != "function" && typeof (c[e]) != "object"
&& e !== "idx") {
f = f + "/" + e + "-=-"
+ encodeURIComponent(encodeURIComponent(c[e]))
}
}
if (c.service == "email") {
f = f + "/page-=-send"
}
}
return f
};
stWidget.positionWidget = function(o) {
if (!o) {
return false
}
shareel = o.element;
var curleft = curtop = 0;
if (shareel.offsetParent) {
curleft = shareel.offsetLeft;
curtop = shareel.offsetTop;
while (shareel = shareel.offsetParent) {
curleft += shareel.offsetLeft;
curtop += shareel.offsetTop
}
}
shareel = o.element;
var eltop = 0;
var elleft = 0;
var topVal = 0;
var leftVal = 0;
var elemH = 0;
var elemW = 0;
eltop = curtop + shareel.offsetHeight + 5;
elleft = curleft + 5;
topVal = (eltop + (stWidget.options.offsetTop ? stWidget.options.offsetTop
: 0));
topVal = eval(topVal);
elemH = topVal;
topVal += "px";
leftVal = (elleft + (stWidget.options.offsetLeft ? stWidget.options.offsetLeft
: 0));
leftVal = eval(leftVal);
elemW = leftVal;
leftVal += "px";
stWidget.wrapper.style.top = topVal;
stWidget.wrapper.style.left = leftVal;
if (stWidget.options.autoPosition == true) {
stWidget.oldScroll = document.body.scrollTop;
var pginfo = stWidget.pageSize();
var effectiveH = pginfo.height + pginfo.scrY;
var effectiveW = pginfo.width + pginfo.scrX;
var widgetH = 180;
var widgetW = 355;
var needH = widgetH + elemH;
var needW = widgetW + elemW;
var diffH = needH - effectiveH;
var diffW = needW - effectiveW;
var newH = elemH - diffH;
var newW = elemW - diffW;
function getHW(elem) {
var retH = 0;
var retW = 0;
while (elem != null) {
retH += elem.offsetTop;
retW += elem.offsetLeft;
elem = elem.offsetParent
}
return {
height : retH,
width : retW
}
}
var buttonPos = getHW(shareel);
var leftA, rightA, topA, bottomA = false;
if (diffH > 0) {
bottomA = false;
topA = true;
if ((buttonPos.height - widgetH) > 0) {
newH = buttonPos.height - widgetH
}
stWidget.wrapper.style.top = newH + "px"
}
if (diffW > 0) {
leftA = false;
rightA = true;
if ((buttonPos.width - widgetW) > 0) {
newW = buttonPos.width - widgetW
}
stWidget.wrapper.style.left = newW + "px"
}
}
stWidget.wrapper.style.visibility = "visible";
stWidget.mainstframe.style.visibility = "visible"
}, stWidget.hideWidget = function() {
if (stWidget.wrapper.style.visibility !== "hidden") {
stWidget.wrapper.style.visibility = "hidden"
}
if (stWidget.mainstframe.style.visibility !== "hidden") {
stWidget.mainstframe.style.visibility = "hidden"
}
};
stWidget.pageSize = function() {
var e = [ 0, 0, 0, 0 ];
var b = 0;
var a = 0;
var d = 0;
var c = 0;
if (typeof (window.pageYOffset) == "number") {
b = window.pageXOffset;
a = window.pageYOffset
} else {
if (document.body
&& (document.body.scrollLeft || document.body.scrollTop)) {
b = document.body.scrollLeft;
a = document.body.scrollTop
} else {
if (document.documentElement
&& (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
b = document.documentElement.scrollLeft;
a = document.documentElement.scrollTop
}
}
}
if (window.innerWidth) {
d = window.innerWidth;
c = window.innerHeight
} else {
if (document.documentElement.offsetWidth) {
d = document.documentElement.offsetWidth;
c = document.documentElement.offsetHeight
}
}
e = {
scrX : b,
scrY : a,
width : d,
height : c
};
return e
};
stWidget.closeWidget = function() {
if (st_showing == false) {
return false
}
st_showing = false;
stWidget.widgetOpen = false;
stWidget.wrapper.style.visibility = "hidden";
stWidget.mainstframe.style.visibility = "hidden";
stWidget.wrapper.style.top = "-999px";
stWidget.wrapper.style.left = "-999px";
stWidget.showEmbeds();
stWidget.sendEvent("screen", "home")
};
stWidget.hideEmbeds = function() {
var b = document.getElementsByTagName("embed");
for ( var a = 0; a < b.length; a++) {
b[a].style.visibility = "hidden"
}
};
stWidget.showEmbeds = function() {
if (stWidget.options.embeds == true) {
return true
}
var b = document.getElementsByTagName("embed");
for ( var a = 0; a < b.length; a++) {
b[a].style.visibility = "visible"
}
};
stWidget.sendEvent = function(a, d) {
var c = "#widget/" + a + "=" + d;
try {
window.frames.stLframe.location.replace(stWidget.frameUrl + c)
} catch (b) {
}
};
stWidget.getOGTags = function() {
var b = document.getElementsByTagName("meta");
for ( var a = 0; a < b.length; a++) {
if (b[a].getAttribute("property") == "og:title") {
stWidget.ogtitle = b[a].getAttribute("content")
} else {
if (b[a].getAttribute("property") == "og:type") {
stWidget.ogtype = b[a].getAttribute("content")
} else {
if (b[a].getAttribute("property") == "og:url") {
stWidget.ogurl = b[a].getAttribute("content")
} else {
if (b[a].getAttribute("property") == "og:image") {
stWidget.ogimg = b[a].getAttribute("content")
} else {
if (b[a].getAttribute("property") == "og:description") {
stWidget.ogdesc = b[a].getAttribute("content")
}
}
}
}
}
}
};
stButtons.onReady = function() {
stWidget.getOGTags();
document.body.appendChild(stWidget.wrapper);
stButtons.makeButtons();
stWidget.init()
};
if (document.readyState == "complete" && stLight.readyRun == false) {
stLight.onReady()
}
stButtons.widget = false;
stButtons.widgetArray = [];
stButtons.queue = [];
stButtons.queuePos = 0;
stButtons.counts = [];
st_showing = false;
if (typeof (window.addEventListener) != "undefined") {
window.addEventListener("click", function() {
stWidget.closeWidget()
}, false)
} else {
if (typeof (document.addEventListener) != "undefined") {
document.addEventListener("click", function() {
stWidget.closeWidget()
}, false)
} else {
if (typeof window.attachEvent != "undefined") {
document.attachEvent("onclick", function() {
stWidget.closeWidget()
})
}
}
};