if(typeof _ow=="undefined"){_ow={};_ow.wwwurl="http://www.onlywire.com";_ow.imagesPath="http://web1.onlywire.com";_ow.token=null;_ow.E=function(a){return document.createElement(a)};_ow.T=function(a){return document.createTextNode(a)};_ow.DOMready=(function(){var a={};a.isReady=false;a.init=function(b){if(!this.isReady){this.bindReady(b)}else{b()}};a.bindReady=function(b){if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){a.isReady=true;a.init(b)},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){a.isReady=true;a.init(b)}})}}};return a})();_ow.getScript=function(a,b,d){this.url=a;this.seperator=(a.match(/\?/))?"&":"?";this.jsonpCallback="jsonp"+(new Date()).getTime();this.jsonp="jsonp="+this.jsonpCallback;this.cache="_="+(new Date()).getTime();this.callback=d||function(){};window[this.jsonpCallback]=function(e){b(e)};var c=this;_ow.DOMready.init(function(){c.makeScriptTag()})};_ow.getScript.prototype={makeScriptTag:function(){var c=document.getElementsByTagName("head")[0];var b=document.createElement("script");b.setAttribute("type","text/javascript");b.src=this.url+this.seperator+this.jsonp+"&"+this.cache;var a=false;var d=this;b.onload=b.onreadystatechange=function(){if(!a&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){a=true;d.callback();c.removeChild(b)}};c.appendChild(b)}};_ow.focusTo=function(b,a){if(typeof a=="undefined"){a=b.value.length}if(b.createTextRange){if(range==0){range=b.createTextRange()}range.moveEnd("character",b.value.length);range.moveStart("character",a);setTimeout("range.select()",10)}else{if(b.setSelectionRange){b.select();b.setSelectionRange(a,b.value.length)}else{b.blur()}}};_ow.class_select=function(b){var a=document.getElementById("tag_"+b);a.style.cursor="pointer";a.style.color="#000";a.style.textDecoration="none";a.className="tag_selected"};_ow.class_deselect=function(b){var a=document.getElementById("tag_"+b);a.style.color="#309acc";a.style.textDecoration="underline";a.style.cursor="pointer";a.className="tag_deselected"};_ow.swap=function(a){var g=document.getElementById("tags").value;var e=g.replace(/^\s+|\s+$/g,"");var c=e.split(" "),h=false,d,b=a.toLowerCase();if(c[0].replace(/^\s+|\s+$/g,"")==""){c.splice(0,1)}for(d=0;d1)?f+" ":f;_ow.focusTo(document.getElementById("tags"))};_ow.getTopLeft=function(e){var j=curtop=0;var f=e.clientHeight;var h=e.clientWidth;if(e.offsetParent){do{j+=e.offsetLeft;curtop+=e.offsetTop}while(e=e.offsetParent)}var b=curtop;var d=j;var i=f+b;var c=(document.body.offsetWidth>document.body.scrollWidth)?document.body.offsetWidth:document.body.scrollWidth;var a=(document.body.offsetHeight>document.body.scrollHeight)?document.body.offsetHeight:document.body.scrollHeight;if(d>c/2){d=d-_ow.Popup.popupWidth+h}var g=_ow.Popup.popup.clientHeight||_ow.Popup.getClientHeight();if(b>a/2){i=b-g}return[i,d]};_ow.Dom=(function(){function a(c){while(c.hasChildNodes()){c.removeChild(c.firstChild)}return c}function b(d){var c;return document.getElementById(d)||(c=document.getElementsByName(d)&&c[0])}b.clearChildren=a;return b})();_ow.Event={stop:function(a){if(!a){var a=window.event}a.cancelBubble=true;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}if(a.stopPropagation){a.stopPropagation()}},stopPropagation:function(a){if(!a){var a=window.event}a.cancelBubble=true;if(a.stopPropagation){a.stopPropagation()}}};_ow.Box=function(b){var a=function(){_ow.Dom.clearChildren(_ow.Popup.popup);var c=_ow.E("div");c.appendChild(_ow.Template.genHeader(1));var f=document.createElement("div");f.className="success";f.style.position="relative";f.style.background='url("'+_ow.wwwurl+'/onlywire_button/images/success.png") no-repeat';f.style.width="372px";f.style.height="40px";f.style.margin="10px";var d=document.createElement("span");d.style.color="#65666a";d.style.position="absolute";d.style.top="13px";d.style.left="55px";d.style.fontSize="11px";d.style.fontWeight="bold";if(typeof b=="string"){var e=document.createTextNode(b);d.appendChild(e)}else{d.appendChild(b)}f.appendChild(d);c.appendChild(f);_ow.Popup.popup.appendChild(c)};return{success:a}};_ow.Auth=(function(){var a={};a.authData=null;a.init=function(){var b="url="+encodeURIComponent(window.location.href);if(_ow.token){b+="&token="+encodeURIComponent(_ow.token)}new _ow.getScript(_ow.wwwurl+"/widget/getWidgetData?"+b,function(c){a.authData=c;_ow.Template.init();_ow.Popup.init()})};if(window.addEventListener){a.init()}else{window.attachEvent("onload",function(){a.init()})}a.isLoggedIn=function(){if(a.authData.error){return false}else{return true}};return a})();_ow.Submit=function(a){this.obj=a};_ow.Submit.prototype._analCheck=function(c){if(c.nodeName=="INPUT"){if(c.checked){return c.value}else{return""}}var a="";var d=0;for(var b=0;b0){a+=","}a+=c[b].value;d++}}return a};_ow.Submit.prototype.bookmark=function(d){var a=this;var c=this._analCheck(d);var b=c.split(",").length;if(this.obj.tags.value=="space separated"||this.obj.tags.value==""){this.obj.tags.value="onlywire"}if(this.obj.url.value==""){alert("URL field cant be blank");return}new _ow.getScript(_ow.wwwurl+"/widget/save?title="+encodeURIComponent(this.obj.title.value)+"&url="+encodeURIComponent(this.obj.url.value)+"&tags="+this.obj.tags.value+"&private="+this.obj.priv.checked+"&c="+this.obj.notes.value+"&service="+c+"&token="+(_ow.token?encodeURIComponent(_ow.token):""),function(f){var e=_ow.E("span");e.appendChild(_ow.T("Done! We'll send you an email shortly when your bookmark has been posted."));e.style.display="block";e.style.marginLeft="-4px";e.style.marginTop="-5px";_ow.Box(e).success()})};_ow.Submit.prototype.share=function(){var a=this;var d=encodeURIComponent(_ow.Popup.fieldsToUpdate.title.value);var b=encodeURIComponent(_ow.Popup.fieldsToUpdate.url.value);if(this.obj.from.value==""){alert("From email cant be blank");return}else{var c=/^[^@]+@[^@]+.[a-z]{2,}$/i;if(this.obj.from.value.search(c)==-1){alert("Invalid e-mail address");return}}if(this.obj.to.value=="comma separated"||this.obj.to.value==""){alert("To email cant be blank");return}var e=this.obj.to.value.split(",").length;new _ow.getScript(_ow.wwwurl+"/widget/sendemail?from="+encodeURIComponent(this.obj.from.value)+"&to="+encodeURIComponent(this.obj.to.value)+"&message="+encodeURIComponent(this.obj.message.value)+"&title="+d+"&url="+b,function(f){_ow.Box("Your email has been sent.").success()})};_ow.Submit.prototype.signup=function(){var a=this;new _ow.getScript(_ow.wwwurl+"/widget/signup?subscription=free&cardnumber=&cvv=&mm=-1&yy=-1&zip=&cardname=&cardtype=&username="+this.obj.username.value+"&email="+this.obj.email.value+"&m="+this.obj.password.value+"&captcha_code="+this.obj.captcha_code.value+"&industry=Button",function(b){if(b=="Success"){a.signin({username:{value:a.obj.username.value},password:{value:a.obj.password.value}})}else{alert(b)}})};_ow.Submit.prototype.signin=function(b){var a=this;if(b){this.obj=b}new _ow.getScript(_ow.wwwurl+"/widget/login?username="+this.obj.username.value+"&m="+this.obj.password.value,function(c){if(c.response=="Success"){_ow.token=c.token;_ow.Auth.init()}else{alert(c.response)}})};_ow.Template=(function(){var a={};a.homepage=null;a.bookmark=null;a.share=null;a.init=function(){a.homepage=a.genHomepage();a.bookmark=a.genBookmark();a.share=a.genShare();a.signup=a.genSignup();a.signin=a.genSignin()};a.genTitle=function(b){var c=document.createElement("div");c.style.background='url("'+_ow.wwwurl+'/onlywire_button/images/powered.png") no-repeat right top';c.style.height="22px";c.style.color="#6699cc";c.style.fontSize="13px";c.style.fontWeight="bold";c.style.margin="10px";c.style.cursor="pointer";c.onclick=function(){window.open("http://www.onlywire.com")};c.appendChild(document.createTextNode(b));return c};a.genRound=function(f,d,c){var g=document.createElement("div");g.style.position="relative";g.style.height="21px";g.style.width="394px";g.style.background='url("'+_ow.wwwurl+'/onlywire_button/images/round.png") no-repeat top left';g.style.fontSize="10px";g.style.marginLeft="6px";var e=document.createElement("div");e.style.position="absolute";e.style.left="10px";e.style.top="3px";e.appendChild(document.createTextNode(f));if(d){var b=document.createElement("a");b.style.position="absolute";b.style.top="3px";b.style.right="10px";b.style.color="#309acc";b.href="#";b.onclick=function(){window.open(c);return false};b.appendChild(document.createTextNode(d));g.appendChild(b)}g.appendChild(e);return g};a.genHeader=function(d){var f=document.createElement("ul");f.style.height="31px";f.style.background='url("'+_ow.wwwurl+'/onlywire_button/images/header_bg.png") repeat-x';f.style.padding="0px";f.style.margin="0px";f.style.borderBottom="3px #72afdb solid";var h=2;for(var e=0,b,c,g;e")}catch(e){var j=document.createElement("input")}j.setAttribute("id",b);j.style.verticalAlign="middle";j.style.marginRight="3px";j.type="checkbox";j.value=n.pk_id;j.checked="true";m=document.createElement("img");m.style.verticalAlign="middle";m.style.marginRight="3px";m.src=_ow.imagesPath+"/i/"+n.small_icon;if(_ow.Auth.isLoggedIn()){g.appendChild(j)}d.appendChild(m);if(_ow.Auth.isLoggedIn()){d.appendChild(document.createTextNode(n.name))}else{var l=document.createElement("a");l.style.color="#000";var f=n.post_link;l.href=f;l.setAttribute("post_link",f);if(_ow.Auth.isLoggedIn()){l.setAttribute("title","Auto submission not yet supported, coming soon!")}l.setAttribute("rel","external");l.setAttribute("target","_blank");l.style.textDecoration="underline";l.appendChild(document.createTextNode(n.name));if(!f){d.appendChild(document.createTextNode(n.name))}else{d.appendChild(l)}}g.appendChild(d);c.appendChild(g);o.elements.push(j)}o.list=c;return o};a.genWrapper=function(){var b=document.createElement("div");b.fontSize="10px";b.color="#000";b.style.margin="10px";b.style.textAlign="center";b.style.position="relative";return b};a.genWrapContent=function(){var d=document.createElement("div");d.style.marginTop="10px";d.style.textAlign="center";d.appendChild(document.createTextNode("By signing up, you agree to the "));var c=document.createElement("a");c.style.color="#309acc";c.appendChild(document.createTextNode("Terms of service"));c.href="#";c.onclick=function(){window.open("http://www.onlywire.com/terms");return false};var b=document.createElement("a");b.style.color="#309acc";b.href="#";b.onclick=function(){window.open("http://www.onlywire.com/terms");return false};b.appendChild(document.createTextNode("Privacy Policy."));d.appendChild(c);d.appendChild(document.createTextNode(" and "));d.appendChild(b);return d};a.genInfo=function(d){var e=document.createElement("div");e.style.border="1px solid #ffcc00";e.style.backgroundColor="#FDED8B";e.style.color="#000";e.style.fontWeight="bold";e.style.width="192px";e.style.height="42px";e.style.fontSize="10px";e.style.position="absolute";e.style.top="10px";e.style.right="10px";var c=document.createElement("span");c.style.position="absolute";c.style.top="8px";c.style.left="8px";c.appendChild(document.createTextNode(d));var b=document.createElement("div");b.style.position="absolute";b.style.top="42px !important";b.style.top="40px";b.style.right="10px";b.style.width="8px";b.style.height="15px";b.style.background='url("'+_ow.wwwurl+'/onlywire_button/images/arrow.gif") no-repeat';e.appendChild(b);e.appendChild(c);return e};a.genTags=function(b){var e=document.createElement("div");e.style.cssText="expression(this.scrollHeight > 49? '50px' : 'auto');";e.style.position="relative";e.style.overflow="auto";e.style.background="none";e.style.maxHeight="50px";for(var c=0;cSign In",type:e},{id:"username",left:"Username",value:"",type:"input"},{id:"password",left:"Password",value:"",type:"input_password"},{id:"email",left:"Email",value:"",type:"input"},{id:"0",left:"",value:"",type:b},{id:"captcha_code",left:"Enter Code",value:"",type:"input"}];var d=this.genWrapper();var f=this.genTable(g);d.appendChild(f.table);d.appendChild(this.genWrapContent());i.appendChild(d);var c=this.genButton("Sign Up",function(){var j=new _ow.Submit(f.elements);j.signup()});i.appendChild(this.genFooter(c));return i};a.genSignin=function(){var i=_ow.E("div");i.appendChild(this.genHeader(0));i.appendChild(this.genTitle("Sign In"));i.appendChild(this.genRound("To bookmark content, first sign in"));var e=document.createElement("span");var h=document.createElement("a");h.style.color="#309acc";h.href="#";h.appendChild(document.createTextNode("Sign up"));h.onclick=function(){_ow.Popup.loadSignup();return false};var d=document.createElement("a");d.style.color="#309acc";d.href="#";d.appendChild(document.createTextNode("Forgot password?"));d.onclick=function(){window.open(_ow.wwwurl+"/forgotpassword");return false};e.appendChild(document.createTextNode("New to OnlyWire? "));e.appendChild(h);var g=[{id:"0",left:"",value:"",type:e},{id:"username",left:"Username",value:"",type:"input"},{id:"password",left:"Password",value:"",type:"input_password"},{id:"0",left:"",value:"Forgot password?",type:d}];var c=this.genWrapper();var f=this.genTable(g);c.appendChild(f.table);i.appendChild(c);var b=this.genButton("Sign In",function(){var j=new _ow.Submit(f.elements);j.signin()});i.appendChild(this.genFooter(b));return i};return a})();_ow.Popup=(function(){var a={};a.popup=null;a.currentTag=null;a.fieldsToUpdate={};a.popupHeight=200;a.popupWidth=408;a.init=function(){if(!this.popup){a.popup=a.genPopup();document.body.appendChild(a.popup);document.onclick=function(){_ow.Popup.hide()}}if(_ow.Auth.isLoggedIn()){this.updateFields();this.loadBookmark()}else{this.loadHomepage()}};a.show=function(b){if(!this.popup){return}var c=_ow.getTopLeft(b);this.popup.style.display="block";this.popup.style.top=c[0]+"px";this.popup.style.left=c[1]+"px";this.updateFields()};a.hide=function(b){this.popup.style.display="none"};a.updateFields=function(){if(!this.currentTag){return}var f=this.currentTag.getAttribute("title")||window.document.title;var c=this.currentTag.getAttribute("url")||window.location.href;var b=this.currentTag.getAttribute("tags")||"space separated";this.fieldsToUpdate.title.value=f;this.fieldsToUpdate.url.value=c;this.fieldsToUpdate.tags.value=b;for(var d=0,e;d