
if(typeof window._dp_tools_badge_id=='undefined'){_dp_tools_badge_id=1;}else{_dp_tools_badge_id++;}
function DealsPlusShowPlusBadge(){this.plusUrl='http://api.dealspl.us/json/plus/';this.dpUrl='http://dealspl.us/';this.dpXdUrl='http://dealspl.us/xd_api_ext.php';this.apiServicePath='/json/plus/';this.dpImageUrl=this.dpUrl+'images/plus/';this.dpSubmitUrl='add.php';this.plusCSS='div.dpToolsPlusButton{width:44px;height:55px;}a.dpToolsPlusButtonCount{display:block;text-decoration:none;width:44px;height:34px;padding-top:4px;color:#4f6e38;background:url('+this.dpImageUrl+'plus_sprite_09252009.gif) no-repeat 0 0;text-align:center;font:normal 10px Arial, Tahoma;line-height:9px;}a:hover.dpToolsPlusButtonCount{background-position:0 -38px;text-decoration:none;}span.dpToolsPlusButtonCountContainer{display:block;height:16px;}strong.dpToolsPlusButtonNumber{display:block;height:16px;font:bold 14px Arial;color:#4f6e38;text-decoration:none;cursor:pointer;}span.dpToolsPlusButtonText{font:normal 10px Arial;}a.dpToolsPlusButtonLink,span.dpToolsPlusButtonLink,a.dpToolsPlusButtonPlusd,span.dpToolsPlusButtonPlusd{display:block;width:39px;height:14px;margin-top:1px;padding:2px 0 0 5px;background:url('+this.dpImageUrl+'plus_sprite_09252009.gif) no-repeat 0 -76px;text-decoration:none;text-align:left;color:white;font:normal 10px Verdana;}a:hover.dpToolsPlusButtonLink{background-position:0 -92px;text-decoration:none;}a.dpToolsPlusButtonPlusd,span.dpToolsPlusButtonPlusd{padding-left:0;width:44px;text-align:center;background-position:0 -108px;}';if(typeof(_dp_tools_badge_id)!='undefined'){this.badgeId=_dp_tools_badge_id;}else{this.badgeId=1;}
if(typeof(_dp_tools_URL)!='undefined'){this.url=_dp_tools_URL;}else{this.url=window.location.href;}
if(typeof(_dp_tools_TITLE)!='undefined'){this.title=_dp_tools_TITLE;}else{this.title='';}
if(typeof(_dp_tools_IMG_URL)!='undefined'){this.imgUrl=_dp_tools_IMG_URL;}else{this.imgUrl='';}
if(typeof(_dp_tools_DESC)!='undefined'){this.desc=_dp_tools_DESC;}else{this.desc='';}
if(typeof(_dp_tools_LIST_PRICE)!='undefined'){this.listPrice=_dp_tools_LIST_PRICE;}else{this.listPrice='';}
if(typeof(_dp_tools_PRICE)!='undefined'){this.price=_dp_tools_PRICE;}else{this.price='';}
if(typeof(_dp_tools_PRICE_AFTER_REBATE)!='undefined'){this.priceAfterRebate=_dp_tools_PRICE_AFTER_REBATE;}else{this.priceAfterRebate='';}
if(typeof(_dp_tools_SHIP_PRICE)!='undefined'){this.shipPrice=_dp_tools_SHIP_PRICE;}else{this.shipPrice='';}
this.host=this.url.replace(/http:\/\/([^\/:]+).*$/,"$1").split('.').slice(-2).join('.');this.plusObj=null;this.plusLinkTarget='_blank';this.scriptLocation=null;this.createElement=function(tag,attributes){var elem=document.createElement(tag);for(var x in attributes){if(x==='style'){for(var y in attributes[x]){elem.style[y]=attributes[x][y];}}else{if(tag=='style'&&x=='innerHTML'){if(elem.styleSheet){elem.styleSheet.cssText=attributes[x];}else{elem.appendChild(document.createTextNode(attributes[x]));}}else{elem[x]=attributes[x];}}}
return elem;};this.getPlusses=function(){this.scriptLocation=this.getDOMLocation();var s=this.createElement('script',{type:'text/javascript',src:this.plusUrl+'?callback=_dp_showPlusBadge.plusReturned&url='+encodeURIComponent(this.url),charset:'utf-8'});document.getElementsByTagName('head')[0].appendChild(s);};this.updatePlus=function(badgeId,url,action){this.badgeId=badgeId;this.url=url;var s=this.createElement('script',{type:'text/javascript',src:this.dpXdUrl+'?srv='+this.apiServicePath+'&method=post&params='+encodeURIComponent('callback=_dp_showPlusBadge.updatePlusReturned;action='+action+';url='+this.url),charset:'utf-8'});document.getElementsByTagName('head')[0].appendChild(s);};this.updatePlusReturned=function(obj){this.plusObj=obj;this.updatePlusBadge();};this.plusReturned=function(obj){this.plusObj=obj;this.displayPlusBadge();};this.displayPlusBadge=function(){var disp=this.buildPlusBadge();document.getElementsByTagName('head')[0].appendChild(disp.css);this.insertAfter(this.scriptLocation.parent,disp.badge,this.scriptLocation.refNode);};this.getDOMLocation=function(){var d=new Date();var ranId='dp-tools-loc-'+d.getTime();document.write('<span id="'+ranId+'">&nbsp;</span>');var elem=document.getElementById(ranId);var ret={parent:elem.parentNode,refNode:elem.previousSibling};elem.parentNode.removeChild(elem);return ret;};this.insertAfter=function(parent,node,refNode){if(typeof(refNode.nextSibling)=='undefined'){parent.appendChild(node);}else{parent.insertBefore(node,refNode.nextSibling);}};this.updatePlusBadge=function(){var badgeId=this.badgeId;var action='add';var plusses=0;var plusLinkTitle="Plus";var plusTextTitle="plusses";var plusLinkClassName="dpToolsPlusButtonLink";if(this.plusObj&&this.plusObj.plus&&!this.plusObj.error){plusses=this.plusObj.plus;if(this.plusObj.dealUrl){dealLink=this.plusObj.dealUrl;}
if(this.plusObj.hasPlussed){plusLinkTitle="Plus'd";plusLinkClassName="dpToolsPlusButtonPlusd";action='del';}}
if(plusses==1){plusTextTitle="plus";}
var plusLink="javascript:_dp_showPlusBadge.updatePlus("+badgeId+", '"+this.url+"', '"+action+"')";var plusButtonNumber=document.getElementById("dpToolsPlusButtonNumber_"+badgeId);var plusButtonText=document.getElementById("dpToolsPlusButtonText_"+badgeId);var plusButtonLink=document.getElementById("dpToolsPlusButtonLink_"+badgeId);plusButtonNumber.innerHTML=plusses;plusButtonText.innerHTML=plusTextTitle;plusButtonLink.className=plusLinkClassName;plusButtonLink.innerHTML=plusLinkTitle;plusButtonLink.href=plusLink;};this.buildPlusBadge=function(){var plusses=0;var action='add';var redir='&pbtnNw=1';var dealLink='';var addQueryParam='';var plusLinkClassName="dpToolsPlusButtonLink";var plusLinkTitle="Plus";if(this.plusObj&&this.plusObj.plus&&!this.plusObj.error){plusses=this.plusObj.plus;if(this.plusObj.dealUrl){dealLink=this.plusObj.dealUrl;}
if(this.plusObj.hasPlussed){plusLinkClassName="dpToolsPlusButtonPlusd";plusLinkTitle="Plus'd";action='del';}}
if(plusses){this.plusLinkTarget='_top';redir='';}else{addQueryParam='&title='+escape(this.title)+'&imgurl='+encodeURIComponent(this.imgUrl)+'&desc='+escape(this.desc)+'&listprice='+escape(this.listPrice)+'&price='+escape(this.price)+'&priceafterrebate='+escape(this.priceAfterRebate)+'&shipprice='+escape(this.shipPrice);}
var plusLink=this.dpUrl+this.dpSubmitUrl+'?url='+encodeURIComponent(this.url)+'&pbtn=1'+redir+addQueryParam;if(!dealLink){dealLink=plusLink;}
if(!plusses){plusses='0';}else{plusLink="javascript:_dp_showPlusBadge.updatePlus("+this.badgeId+", '"+this.url+"', '"+action+"')";}
var css=this.plusCSS;var D=this.createElement('div',{className:'dpToolsPlusButton'});var s=this.createElement('a',{className:'dpToolsPlusButtonCount',href:dealLink,onclick:this.cancelEvent,target:this.plusLinkTarget,title:''});var z=this.createElement('strong',{className:'dpToolsPlusButtonNumber',id:'dpToolsPlusButtonNumber_'+this.badgeId,innerHTML:plusses});var x=this.createElement('span',{className:'dpToolsPlusButtonText',id:'dpToolsPlusButtonText_'+this.badgeId,innerHTML:'plusses'});var p=this.createElement('a',{className:plusLinkClassName,id:'dpToolsPlusButtonLink_'+this.badgeId,href:plusLink,onclick:this.cancelEvent,target:this.plusLinkTarget,title:'',innerHTML:plusLinkTitle});D.appendChild(s);s.appendChild(z);s.appendChild(x);D.appendChild(p);var S=this.createElement('style',{type:'text/css',innerHTML:css});return{css:S,badge:D};};this.cancelEvent=function(e){e=e||window.event;var t=e.target||e.srcElement;while(t&&t.tagName!=='a'){t=t.parentNode;}
if(!t){return true;}
if(typeof(e.preventDefault)==='function'){e.preventDefault();}
e.returnValue=false;e.cancelBubble=true;e.stopPropagation&&e.stopPropagation();return false;};}
var _dp_showPlusBadge=new DealsPlusShowPlusBadge();_dp_showPlusBadge.getPlusses();
