var debugMode=false;function initDebug(){debugMode=true;debugDiv=document.createElement("div");debugDiv.style.position="absolute";debugDiv.style.left="400px";debugDiv.style.zIndex=2000;document.body.appendChild(debugDiv);debug("debug info")}function debug(a){if(debugMode){debugDiv.innerHTML+=a;debugDiv.innerHTML+="
"}}function showObjectProperties(c){var a="";for(var b in c){if(b){a+=b+"="+c[b]+"\n"}}alert(a)};if(isIE()){(function(a){window.setInterval=a(window.setInterval)})(function(a){return function(d,c){var b=Array.prototype.slice.call(arguments,2);if(typeof d!="function"){d=new Function(d)}return a(function(){d.apply(this,b)},c)}})}function getWindowSize(){var a;var b;if(isIE()){a=document.documentElement.clientWidth-40;b=document.documentElement.clientHeight-120}else{a=window.innerWidth-40;b=window.innerHeight-120}return{w:a,h:b}}function getStyle(b,a){if(!document.getElementById){return}var c=b.style[toCamelCase(a)];if(!c){if(document.defaultView){c=document.defaultView.getComputedStyle(b,"").getPropertyValue(a)}else{if(b.currentStyle){c=b.currentStyle[toCamelCase(a)]}}}return c}function setStyle(a,b,c){document.getElementById(a).style[b]=c}function toCamelCase(f){var d=f.split("-");if(d.length==1){return d[0]}var b=f.indexOf("-")==0?d[0].charAt(0).toUpperCase()+d[0].substring(1):d[0];for(var c=1,a=d.length;cc)?d:c}function getRadioValue(b){for(var a=0;a15){c>>=4;a=b.substr(c&15,1)+a}return a}function toColor(f,e,a){var h=f*256*256+e*256+a;var d="000000"+d2h(h);return("#"+d.substr(d.length-6,6))}function getColorGradient(d,b,c,a){if(a!=0){return d-parseInt(c*(d-b)/a)}else{return 0}}function objectPan(k,j,e,p){var d=parseInt(getStyle(e,"left"));var b=parseInt(getStyle(e,"top"));var g=k-d;var f=j-b;var c=new Date();e.panStartTime=(e.panStartTime)?e.panStartTime:c.getTime();var h=(e.panTimeout<(c.getTime()-e.panStartTime));if(g||f){var o=parseInt(Math.abs(g)/10)+scrollSpeed;var m=parseInt(Math.abs(f)/10)+scrollSpeed;var n=(k>=d)?1:-1;var l=(j>=b)?1:-1;var a=(e.animate&&!h&&o=0;a--){removeNode(c.childNodes[a],false)}if(!b&&c){if(c.parentNode){c.parentNode.removeChild(c)}}}}function swapNode(c,b){var a=b.nextSibling;c.parentNode.insertBefore(b.parentNode.removeChild(b),c);if(a){a.parentNode.insertBefore(c.parentNode.removeChild(c),a)}else{b.parentNode.appendChild(c.parentNode.removeChild(c))}}function getPostData(b){var a="";for(i=0;i1))?"
":"";var a=getEventData(b);var e=getCreateElement(document.body,"div","editMenuDiv","menu");if(e){e.resultNum=d;e.style.left=a.x+"px";e.style.top=a.y+"px";e.innerHTML="";e.innerHTML+="";e.innerHTML+="";e.innerHTML+="";e.style.visibility="visible"}}function editMenuAction(b,c){var e=document.getElementById("editMenuDiv");if(e){var d=e.resultNum;e.style.visibility="hidden";if(c=="comment"){wpCommentEntry(b,d,wpLensId,0,-75)}else{if(c=="delete"){wpErase(d,wpLensId)}}}var a=document.getElementById("wpSelectMenuDiv");if(a){a.style.visibility="hidden"}}function hideMenuIcon(a){a.style.visibility="hidden"}function keytermsSelectMenu(e,f){var d=getEventData(e);wpSelectDiv.style.left=d.x+"px";wpSelectDiv.style.top=d.y+"px";wpSelectDiv.innerHTML="";if(rdpResults[f]&&rdpResults[f].keyterms){var a=rdpResults[f].keyterms;if(a.length){for(var c=0;c"}wpSelectDiv.style.visibility="visible"}}};var WP_THUMBNAIL_SERVER_NUM=99;var WP_TWEET_TEXT="Hey, check out this middlespot.com mashtab: ";var WP_NO_COOKIE_COMMENT="Please enable your browser cookies to use Mashtabs. Contact support@middlespot.com if you require assistance. ";var browser=getBrowser();var workpadUrl="/workpad.php";var userKey=getCookie("userKey");var wpTabHeight=18;var wpTabWidth=120;var wpList=new Array();var widgetWpKey;var wpZoom=getCookie("wpZoom")||0.25;var wpZoomRate=1.5;var wpImgWidth=120;var wpImgHeight=90;var wpContentHeight=55;var wpActiveNum;var wpTabDivs;var wpDiv;var wpMenuDiv;var wpContentDiv;var wpTabNextDiv;var wpTabPrevDiv;var wpSelectDiv;var wpPopupDiv;var wpResultMenuDiv;var wpResultMenuIconDiv;var wpTabsContainerDiv;var wpMouseX;var wpMouseY;var wpMaxResultImgs=0;var wpTabStartNum=0;var wpEmbedCode;var wpEmbedLayout="728x200";var wpEmbedImageSize=160;var wpEmbedNum=null;var wpMenuHeight;var wpNavSliderDiv;var wpTextHeaderDiv;var homePage=false;var inSuggest=0;var INSUGGEST_URL="/search.php?searchType=suggest&query=";var refresh=0;var wpLensNum=null;var wpMiniUrl=null;function initWorkpads(a,c){wpImgWidth=THUMB_WIDTH;wpImgHeight=THUMB_HEIGHT;if(c){wpTabsContainerDiv=c}if(a){wpDiv=a;wpCreateMenuDiv(wpDiv);wpCreateContentDiv(wpDiv);wpCreateResultMenu(wpContentDiv);wpSelectDiv=getCreateElement(document.body,"div","wpSelectMenuDiv","menu wpSubMenu");wpCreatePopupDiv()}wpGetWorkpadList();var b=document.getElementById("workpadDiv");if(b){b.baseHeight=b.offsetHeight;createWorkpadDivider(b)}}function wpCreateMenuDiv(b){wpMenuDiv=createElement(b,"div","wpMenuDiv","");var f=createElement(wpMenuDiv,"div","wpMenuLeftDiv","");var a=createElement(wpMenuDiv,"div","wpMenuRightDiv","");var h=createElement(wpMenuDiv,"div","wpNavDiv","");var d=createElement(h,"img","navMinusImg","mapnav "+browser);d.src="images/mapnav/minus.gif";var g=createElement(h,"img","navPlusImg","mapnav "+browser);g.src="images/mapnav/plus.gif";var e=createElement(h,"div","navBarDiv","mapnav "+browser);var c=createElement(e,"div","navSliderDiv","mapnav "+browser);c.style.backgroundImage="url('images/mapnav/slider.gif')";c.slideWidth=e.offsetWidth-c.offsetWidth;d.onclick=function(){wpSetZoom(wpZoom/wpZoomRate);setWorkpadZoomSlider(wpZoom)};g.onclick=function(){wpSetZoom(wpZoom*wpZoomRate);setWorkpadZoomSlider(wpZoom)};c.onmousedown=function(j){mouseDown(j,this,"x")};c.mouseMoveFunction=wpZoomSliderMove;c.checkLimitsFunction=wpZoomSliderLimits;wpNavSliderDiv=c;setWorkpadZoomSlider(wpZoom)}function wpCreateContentDiv(a){wpContentDiv=createElement(a,"div","wpContentDiv",null);var b=wpContentHeight;wpMenuHeight=(wpMenuDiv)?parseInt(getStyle(wpMenuDiv,"height")):0;wpContentDiv.style.height=b+"px";wpContentDiv.style.top=wpMenuHeight+"px";a.style.height=parseInt(b+wpMenuHeight)+"px";disableSelection(wpContentDiv)}function wpCreateResultMenu(a){if(!a){return}wpResultMenuDiv=createElement(a,"div","wpResultMenuDiv","");wpResultMenuDiv.onmouseover=function(){this.style.visibility="visible"};wpResultMenuDiv.onmouseout=function(){this.style.visibility="hidden"};wpResultMenuIconDiv=createElement(a,"div","wpResultMenuIconDiv","");wpResultMenuIconDiv.innerHTML="m"}function showWP(){var e=wpImgWidth*wpZoom;var c=wpImgHeight*wpZoom;var d=wpActiveNum;document.getElementById("workpadDragHandle").style.visibility="visible";document.getElementById("wpDividerDiv").style.visibility="visible";if(wpMenuDiv){showWPMenu(d)}wpContentDiv.innerHTML="";wpCreateResultMenu(wpContentDiv);if(!userKey){wpContentDiv.innerHTML=wpNoCookieDiv()}for(i=0;i1){var h=getCreateElement(g,"a","wpMenuDelete"+f,"wpMenuLink");h.href="Javascript: void(0)";h.onclick=function(a){wpDelete(k)};h.title="Delete your current mashtab";h.appendChild(document.createTextNode("delete"))}if(wpList[k].readonly!="1"){var h=getCreateElement(g,"a","wpMenuClear"+f,"wpMenuLink");h.href="Javascript: void(0)";h.onclick=function(a){wpEraseAll(k)};h.title="Clear all items in your mashtab";h.appendChild(document.createTextNode("clear"))}var h=getCreateElement(g,"a","wpMenuEmail"+f,"wpMenuLink");h.href="Javascript: void(0)";h.onclick=function(a){wpEmail(a,k)};h.title="Email current mashtab";h.appendChild(document.createTextNode("email"));var h=getCreateElement(g,"a","wpMenuEmbed"+f,"wpMenuLink");h.href="Javascript: void(0)";h.onclick=function(a){wpEmbed(wpEmbedLayout,null,false,k)};h.title="Embed this mashtab on your website.";h.appendChild(document.createTextNode("embed"));if(wpList[k].owner=="1"){var h=getCreateElement(g,"a","wpMenuCollaborate"+f,"wpMenuLink");h.href="Javascript: void(0)";h.onclick=function(a){wpCollaborate(a,k,0,b)};h.title="make this mashtab collaborative";h.appendChild(document.createTextNode("collaborate"))}var h=getCreateElement(g,"a","wpMenuShortUrl"+f,"wpMenuLink");h.href="Javascript: void(0)";h.onclick=function(a){wpShortUrl(a,k,0,b)};h.title="create a short mashtab URL to share with friends.";h.appendChild(document.createTextNode("short URL"));var h=getCreateElement(g,"a","wpMenuTweet"+f,"wpMenuLink");h.href="http://twitter.com/?status="+escape(WP_TWEET_TEXT+wpGetMiniUrl(k));h.target="_new";h.title="tweet this mashtab.";h.appendChild(document.createTextNode("tweet"));var d=INSUGGEST_URL+wpList[k].key;var h=getCreateElement(g,"a","wpMenuRecommendations"+f,"wpMenuLink");h.href=d;h.title="get recommended websites based on this mashtab collection.";h.appendChild(document.createTextNode("recommendations"));if(wpList[k].readonly!="1"){var e=getCreateElement(g,"i","wpMenuViews"+f,"wpMenuLink");e.title="number of times this mashtab has been viewed by others you've sent it to";e.appendChild(document.createTextNode("views: "+wpList[k].childViews))}var h=getCreateElement(g,"a","wpMenuAddthis"+f,"addthis_button");h.setAttribute("onmouseover","return addthis_open(this, '', '"+wpGetMiniUrl(k)+"', 'middlespot.com mashtab: "+(wpList[k].name).replace(/([\\"'])/g,"\\$1").replace(/\u0000/g,"\\0").replace(/\ \;/g," ")+"')");h.setAttribute("onmouseout","addthis_close()");h.innerHTML='
';if(!c){j.innerHTML+=" ";j.innerHTML+=""}initFancybox()}function wpVisible(){return wpDiv.style.visibility=="visible"}function wpCreateTabs(a){if(!wpTabsContainerDiv||(homePage&&(!wpList||((wpList.length<=1)&&(wpList[0].results.length==0))))){return}wpTabsContainerDiv.style.visibility="hidden";wpTabsContainerDiv.innerHTML=null;for(var b=0;wpTabDivs&&(bmashtabs";wpTabDivs=new Array(a);for(var b=0;b";wpTabPrevDiv.onclick=function(){showWPTabs(c-1)}}else{wpTabPrevDiv.innerHTML="
";wpTabPrevDiv.onclick=function(){return false}}wpTabPrevDiv.style.visibility="visible"}function showWpTabNext(g,e,c){var f=getCreateElement(wpTabsContainerDiv,"div","wpNewDiv","wpTab new");f.style.left=e+"px";f.style.visibility="visible";f.title="Start your mashtab";var b=getCreateElement(f,"a","wpNewDivA","addnew");b.href="mashtabnew.php";b.title="Create a new mashtab";var d=getCreateElement(b,"img","wpNewDivImg","");d.src="images/newmashtab.gif";d.border="0";initFancybox();if(c){wpTabNextDiv.innerHTML="
";wpTabNextDiv.onclick=function(){showWPTabs(g+1)}}else{wpTabNextDiv.innerHTML="
";wpTabNextDiv.onclick=function(){return false}}wpTabNextDiv.style.left=26+e+"px";wpTabNextDiv.style.visibility="visible"}function showWPTabs(f){if(!wpTabsContainerDiv||(homePage&&(!wpList||((wpList.length<=1)&&(wpList[0].results.length==0))))){return}var a=document.getElementById("workpadToolDiv");var e=wpTabsContainerDiv.offsetWidth-26;var c=(wpTabPrevDiv)?wpTabPrevDiv.offsetLeft+wpTabPrevDiv.offsetWidth:0;f=(f==null)?wpTabStartNum:f;wpTabStartNum=f;if(wpTabPrevDiv){showWpTabPrev(f,c-16,(f>0))}var d=f;for(var b=f;b