
(function(options){function widget(){};widget.prototype={scriptLocation:null,randomId:null,getDOMLocation:function(){var d=new Date();this.randomId='dp-tools-widget-'+d.getTime();document.write('<span id="'+this.randomId+'">&nbsp;</span>');var elem=document.getElementById(this.randomId);var ret={parent:elem.parentNode,refNode:elem.previousSibling};elem.parentNode.removeChild(elem);return ret;},insertAfter:function(parent,node,refNode){if(typeof(refNode.nextSibling)=='undefined'){parent.appendChild(node);}else{parent.insertBefore(node,refNode.nextSibling);}},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;},defOpts:{bgColor:'#E8F0F8',fgColor:'#4e76c1',width:300,height:500,numItems:5,version:1,type:'deal',userName:'',category:'',key:''},setOptions:function(opts){this.opts=this.defOpts;if(typeof opts!='object'){return;}
for(var i in opts){if(typeof this.opts[i]!='undefined'){this.opts[i]=opts[i];}}},createIframe:function(){var attr={};var src='ht'+'tp'+':/'+'/d'+'ea'+'ls'+'pl'+'.u'+'s/'+'to'+'ol'+'s/'+'wi'+'dg'+'et'+'.p'+'hp';var paramStr='';var id=this.randomId;for(var i in this.opts){if(paramStr!=''){paramStr+='&';}
paramStr+=i+'='+encodeURIComponent(this.opts[i]);}
src+='?'+paramStr;attr.src=src;attr.id=id;attr.name=id;attr.scrolling='no';attr.frameBorder=0;attr.style={width:this.opts.width+'px',height:this.opts.height+'px',border:'0px',position:'relative',overflow:'hidden'};var iframe=this.createElement('iframe',attr);return iframe;},displayWidget:function(opts){var loc=this.getDOMLocation();this.setOptions(opts);var iframe=this.createIframe();this.insertAfter(loc.parent,iframe,loc.refNode);}};var w=new widget();w.displayWidget(options);})(DP_TOOLS_WIDGET_OPTS);
