/**

OVitaminPro AddThis Wrapper v1.0
Updated July 14, 2009

**/

if ({defVal:42}.defVal==42) {

var OVPAT = { defVal : 42 };

OVPAT.gDone = false;

OVPAT.includeScript = function(url) {

document.write("<scr"+"ipt language='javascript' type='text/javascript' src='"+url+"'></scr"+"ipt>");

};

OVPAT.ale = function(func) { /** from http://www.dustindiaz.com/top-ten-javascript/ **/
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	}
	else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
};

OVPAT.gelc = function(node, nodename, classname) { /** from http://snook.ca/archives/javascript/your_favourite_1 **/
    var a = [];
    var re = new RegExp('\\b' + classname + '\\b');
    var els = node.getElementsByTagName(nodename);
    for(var i=0,j=els.length; i<j; i++)
        if(re.test(els[i].className))a.push(els[i]);
    return a;
};

OVPAT.ge = function(i) { return window.document.getElementById(i); };

OVPAT.findPos = function(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
	do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
	return [curleft,curtop];
}

return null;

};

OVPAT.isItemPage = function() {

var atc = this.gelc(document, "input", "order-button");
if (atc.length>=1) { return true; }
return false;

};

OVPAT.addthis = function() {

if (this.gDone==false) { alert("The 'Share This Item' function is temporarily unavailable. Please try again momentarily."); return; }
addthis_sendto();
window.focus();

};

OVPAT.doInit = function() {
var t = this;
if (t.gDone==true) { return false; }

if (t.isItemPage()==false) { return; }

var img = document.createElement("img");
img.setAttribute("src", "http://site.ovitaminpro.com/msb/ovp_addthis_button_2.png");
img.setAttribute("border", "0");
img.setAttribute("width", "123");//"150"/**"97"**/);
img.setAttribute("height", "17");//"20"/**"15"**/);
img.setAttribute("alt", "Share This Item");
img.setAttribute("title", "Share This Item");
img.style.margin = "0";

var btn = t.ge("product-info-table").getElementsByTagName("a").item(0);

btn.removeChild(btn.getElementsByTagName("img").item(0));
btn.appendChild(img);
btn.setAttribute("href", "http://www.addthis.com/bookmark.php?v=20");
btn.onclick = function() { return addthis_sendto(); };
btn.onmouseover = function() { return addthis_open(btn, '', window.location.href, window.document.title); };
btn.onmouseout = function() { addthis_close(); };
btn.setAttribute("title", "Share This Item");
btn.style.display = "inline";

t.gDone = true;

};

if ((!window.OVPAT)||(window.OVPAT!=OVPAT)) { window.OVPAT = OVPAT; }

window.addthis_pub = "ovitaminpro";
window.addthis_options = "email, google, facebook, myspace, twitter, digg, stumbleupon, delicious, live, more";
window.addthis_exclude = "favorites, print";
window.addthis_localize = { defVal : 42, more : "<b>More&hellip;</b></span><span style='display: none;'>" };

window.OVPAT.includeScript("http://s7.addthis.com/js/200/addthis_widget.js");
window.OVPAT.ale(function() { window.OVPAT.doInit(); });

window.sendToFriend = function(a,b,c,d) { window.OVPAT.addthis(); }

}