AyrA

Cleverbot js

Feb 10th, 2015
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function googlePageTracker(d)
  2. {
  3.     if (typeof _gat != "undefined" && typeof _gat._getTracker == "function")
  4.     {
  5.         try
  6.         {
  7.             var b = _gat._getTracker("UA-438584-7");
  8.             b._trackPageview("snip_" + d)
  9.         }
  10.         catch (c)
  11.         {}
  12.     }
  13. }
  14. var googleHelper = {
  15.     track: function(b)
  16.     {
  17.         if (typeof googlePageTracker == "function")
  18.         {
  19.             googlePageTracker(b)
  20.         }
  21.     }
  22. };
  23. var snipAction = {
  24.     maincolor: "yellow",
  25.     snip: null,
  26.     snipicon: null,
  27.     sniptextselector: "",
  28.     snipopen: false,
  29.     snipmousedown: null,
  30.     runsimple: false,
  31.     hassocial: false,
  32.     boxmade: false,
  33.     snipInit: function()
  34.     {
  35.         snipAction.runsimple = navigator.userAgent.indexOf("MSIE") >= 0;
  36.         snipAction.hassocial = (typeof socialAction == "object");
  37.         if (snipAction.hassocial && !socialAction.socialInit())
  38.         {
  39.             snipAction.snipInit2()
  40.         }
  41.     },
  42.     snipInit2: function(b)
  43.     {
  44.         snipAction.snip = $("#snipBox");
  45.         if (!snipAction.boxmade)
  46.         {
  47.             snipAction.newSnipBox(snipAction.maincolor)
  48.         }
  49.         snipAction.boxmade = true;
  50.         snipAction.snip.hide();
  51.         if (window.location.hostname == "localhost")
  52.         {
  53.             snipAction.connectNewIcon()
  54.         }
  55.         if (b && snipHelper && snipHelper.nameHelper)
  56.         {
  57.             snipHelper.nameHelper.setMyName(b)
  58.         }
  59.     },
  60.     connectNewIcon: function(e, d, b)
  61.     {
  62.         if (!snipAction.snip)
  63.         {
  64.             snipAction.snipInit2()
  65.         }
  66.         if (!b && snipAction.hassocial && !socialAction.showScissors())
  67.         {
  68.             return
  69.         }
  70.         if (!e)
  71.         {
  72.             e = "#snipTextIcon"
  73.         }
  74.         if (!d)
  75.         {
  76.             d = "#respArea > table > tbody > tr > td > table > tbody > tr"
  77.         }
  78.         var c = $(e);
  79.         c.prop("fromlist", b);
  80.         c.prop("colour", b ? "green" : "yellow");
  81.         c.addClass(c.prop("colour"));
  82.         if (!b && snipAction.hassocial && socialAction.showVoting())
  83.         {
  84.             socialAction.addVotingButtons(e);
  85.             c.addClass("signedin")
  86.         }
  87.         if (snipAction.runsimple)
  88.         {
  89.             c.show()
  90.         }
  91.         else
  92.         {
  93.             c.fadeTo(0, 0);
  94.             c.delay(200).fadeTo(500, 1)
  95.         }
  96.         if (snipAction.snipopen)
  97.         {
  98.             textAction.makeSnipText(false)
  99.         }
  100.         c.click(new Function('snipAction.openSnipBox("' + e + '", "' + d + '", -1, -1);'));
  101.         if (b)
  102.         {
  103.             $(d).mousedown(new Function("snipAction.mouseDown(this);"))
  104.         }
  105.         if (b)
  106.         {
  107.             $(d).mouseup(new Function('snipAction.mouseUp(this,"' + e + '", "' + d + '");'))
  108.         }
  109.     },
  110.     mouseDown: function(b)
  111.     {
  112.         snipAction.snipmousedown = b
  113.     },
  114.     mouseUp: function(e, h, g)
  115.     {
  116.         if (!snipAction.snipmousedown)
  117.         {
  118.             return
  119.         }
  120.         var d = $(g);
  121.         var f = -1,
  122.             b = -1;
  123.         for (var c = 0; c < d.length; c++)
  124.         {
  125.             if (d[c] == snipAction.snipmousedown)
  126.             {
  127.                 f = c
  128.             }
  129.             if (d[c] == e)
  130.             {
  131.                 b = c
  132.             }
  133.         }
  134.         snipAction.snipmousedown = null;
  135.         if (b >= 0 && f >= 0 && f < b)
  136.         {
  137.             snipAction.openSnipBox(h, g, f, b)
  138.         }
  139.     },
  140.     openSnipBox: function(f, d, h, j)
  141.     {
  142.         if (snipAction.snipopen)
  143.         {
  144.             if (snipAction.runsimple)
  145.             {
  146.                 snipAction.snipopen.show()
  147.             }
  148.             else
  149.             {
  150.                 snipAction.snipopen.fadeTo(500, 1)
  151.             }
  152.         }
  153.         snipAction.snipicon = $(f);
  154.         snipAction.sniptextselector = d;
  155.         if (snipAction.snipicon.prop("fromlist"))
  156.         {
  157.             snipAction.snip.addClass("oversocial")
  158.         }
  159.         else
  160.         {
  161.             snipAction.snip.removeClass("oversocial")
  162.         }
  163.         var c = snipAction.snipicon.prop("colour");
  164.         if (snipAction.maincolour != c)
  165.         {
  166.             snipAction.changeSnipBox(c)
  167.         }
  168.         snipAction.snipopen = snipAction.snipicon;
  169.         if (snipAction.runsimple)
  170.         {
  171.             snipAction.snipicon.hide()
  172.         }
  173.         else
  174.         {
  175.             snipAction.snipicon.fadeTo(500, 0)
  176.         }
  177.         textAction.makeSnipText(true, h, j);
  178.         textAction.defaultHighlights();
  179.         if (snipAction.runsimple)
  180.         {
  181.             snipAction.snip.show()
  182.         }
  183.         else
  184.         {
  185.             snipAction.snip.fadeTo(500, 1)
  186.         }
  187.         var i = snipAction.snip.position().top;
  188.         var e = snipAction.snip.outerHeight();
  189.         var g = $(window).scrollTop();
  190.         var b = $(window).height();
  191.         snipAction.snip.css("top", g + 194);
  192.         snipHelper.editHelper.autoadjust = true;
  193.         snipHelper.editHelper.autoadjustbottom = true;
  194.         snipAction.focusInput();
  195.         googleHelper.track("open")
  196.     },
  197.     focusInput: function()
  198.     {
  199.         if (typeof stimFocus == "function")
  200.         {
  201.             stimFocus()
  202.         }
  203.     },
  204.     closeSnipBox: function()
  205.     {
  206.         if (!snipAction.snipopen || !snipAction.snip || !snipAction.snipicon)
  207.         {
  208.             return
  209.         }
  210.         snipAction.snip.removeClass("oversocial");
  211.         snipAction.snipopen = false;
  212.         if (snipAction.runsimple)
  213.         {
  214.             snipAction.snip.hide()
  215.         }
  216.         else
  217.         {
  218.             snipAction.snip.fadeTo(500, 0)
  219.         }
  220.         if (snipAction.runsimple)
  221.         {
  222.             snipAction.snipicon.show()
  223.         }
  224.         else
  225.         {
  226.             snipAction.snipicon.fadeTo(500, 1)
  227.         }
  228.         googleHelper.track("close")
  229.     },
  230.     newSnipBox: function(h)
  231.     {
  232.         snipAction.maincolor = h;
  233.         snipAction.snip.addClass(snipAction.maincolor);
  234.         var x = document.createElement("div");
  235.         $(x).attr("id", "titleIcon");
  236.         snipAction.snip.append(x);
  237.         var E = document.createElement("div");
  238.         $(E).addClass("snipIcon");
  239.         $(x).append(E);
  240.         var I = document.createElement("div");
  241.         $(I).addClass("snipTitle");
  242.         $(x).append(I);
  243.         var g = document.createElement("div");
  244.         $(g).addClass("closecontainer");
  245.         var q = document.createElement("div");
  246.         $(q).addClass("snipX");
  247.         $(q).click(function()
  248.         {
  249.             snipAction.closeSnipBox()
  250.         });
  251.         $(g).append(q);
  252.         var c = document.createElement("div");
  253.         $(c).attr("id", "canstayopen");
  254.         $(g).append(c);
  255.         snipAction.snip.append(g);
  256.         var l = document.createElement("div");
  257.         $(l).attr("id", "contentcontainer");
  258.         snipAction.snip.append(l);
  259.         var b = document.createElement("div");
  260.         $(b).attr("id", "edittopbar");
  261.         var w = document.createElement("div");
  262.         $(w).addClass("barplus");
  263.         $(w).click(snipHelper.editHelper.addTopLine);
  264.         var v = document.createElement("div");
  265.         $(v).addClass("barminus");
  266.         $(v).click(snipHelper.editHelper.subTopLine);
  267.         var d = document.createElement("div");
  268.         $(d).addClass("barme");
  269.         $(d).click(function()
  270.         {
  271.             snipHelper.nameHelper.showNameSelector("me")
  272.         });
  273.         var C = document.createElement("div");
  274.         $(C).addClass("barbot");
  275.         $(C).click(function()
  276.         {
  277.             snipHelper.nameHelper.showNameSelector("bot")
  278.         });
  279.         $(b).append(w);
  280.         $(b).append(v);
  281.         $(b).append(d);
  282.         $(b).append(C);
  283.         var A = document.createElement("div");
  284.         $(A).attr("id", "editbottombar");
  285.         var u = document.createElement("div");
  286.         $(u).addClass("barplus");
  287.         $(u).click(snipHelper.editHelper.addBottomLine);
  288.         var k = document.createElement("div");
  289.         $(k).addClass("barminus");
  290.         $(k).click(snipHelper.editHelper.subBottomLine);
  291.         var o = document.createElement("div");
  292.         $(o).addClass("barcopy");
  293.         $(o).click(snipHelper.editHelper.editSnip);
  294.         $(A).append(u);
  295.         $(A).append(k);
  296.         $(A).append(o);
  297.         var f = document.createElement("div");
  298.         $(f).attr("id", "bbarhtml");
  299.         $(f).addClass("barhtml");
  300.         $(f).click(snipHelper.editHelper.selectHtml);
  301.         $(A).append(f);
  302.         if (snipAction.maincolor != "grey")
  303.         {
  304.             $(f).hide()
  305.         }
  306.         var n = document.createElement("div");
  307.         $(n).attr("id", "nameselector");
  308.         var e = document.createElement("div");
  309.         $(e).attr("id", "sniptextarea");
  310.         snipHelper.nameHelper.mename = snipHelper.nameHelper.meDefaults[snipAction.maincolor];
  311.         snipHelper.nameHelper.botname = snipHelper.nameHelper.botDefaults[snipAction.maincolor];
  312.         var z = document.createElement("div");
  313.         $(z).attr("id", "charactercount");
  314.         var H = document.createElement("div");
  315.         $(H).attr("id", "hashcontainer");
  316.         $(l).append(b);
  317.         $(l).append(n);
  318.         $(l).append(e);
  319.         $(l).append(A);
  320.         $(l).append(z);
  321.         $(l).append(H);
  322.         textAction.makeSnipText(false);
  323.         snipHelper.hashtagHelper.createHashtags();
  324.         if (snipAction.maincolor != "purple")
  325.         {
  326.             $(H).hide()
  327.         }
  328.         var i = document.createElement("div");
  329.         $(i).attr("id", "bottombar");
  330.         snipAction.snip.draggable(
  331.         {
  332.             handle: "#titleIcon,#bottombar"
  333.         });
  334.         snipAction.snip.resizable(
  335.         {
  336.             handle: "#bottombar"
  337.         });
  338.         snipAction.snip.append(i);
  339.         var G = document.createElement("div");
  340.         $(G).attr("id", "bottombarinner");
  341.         $(i).append(G);
  342.         var m = document.createElement("div");
  343.         $(m).attr("id", "snipLeftButton");
  344.         $(m).addClass("snipleft");
  345.         $(m).addClass(snipHelper.formatHelper.snipLefts[snipAction.maincolor]);
  346.         $(m).click(function()
  347.         {
  348.             snipHelper.formatHelper.snipChangeFormat(snipHelper.formatHelper.snipLefts[snipAction.maincolor])
  349.         });
  350.         var t = document.createElement("div");
  351.         $(t).attr("id", "snipRightButton");
  352.         $(t).addClass("snipright");
  353.         $(t).addClass(snipHelper.formatHelper.snipRights[snipAction.maincolor]);
  354.         $(t).click(function()
  355.         {
  356.             snipHelper.formatHelper.snipChangeFormat(snipHelper.formatHelper.snipRights[snipAction.maincolor])
  357.         });
  358.         var j = ["email", "facebook", "twitter", "gplus", "tumblr"];
  359.         if (snipAction.hassocial && socialAction.isSignedIn())
  360.         {
  361.             j.push("share");
  362.             snipAction.snip.addClass("signedin")
  363.         }
  364.         var D = document.createElement("div");
  365.         $(D).addClass("snipsocial");
  366.         for (var p = 0; p < j.length; p++)
  367.         {
  368.             var B = document.createElement("div");
  369.             $(B).addClass(j[p]);
  370.             $(D).append(B);
  371.             $(B).click((function(s)
  372.             {
  373.                 return function()
  374.                 {
  375.                     snipHelper.socialHelper.socialShare(j[s])
  376.                 }
  377.             })(p))
  378.         }
  379.         $(G).append(m);
  380.         $(G).append(D);
  381.         $(G).append(t);
  382.         snipHelper.heightHelper.resetMinHeight();
  383.         snipHelper.heightHelper.updateMinHeight()
  384.     },
  385.     changeSnipBox: function(b)
  386.     {
  387.         snipAction.snipicon.prop("colour", b);
  388.         var c = snipAction.maincolor;
  389.         snipHelper.formatHelper.updateCharacterCount();
  390.         snipAction.snip.removeClass(snipAction.maincolor);
  391.         snipAction.maincolor = b;
  392.         snipAction.snip.addClass(snipAction.maincolor);
  393.         snipAction.snipicon.removeClass(c);
  394.         snipAction.snipicon.addClass(snipAction.maincolor);
  395.         snipHelper.nameHelper.mename = snipHelper.nameHelper.meDefaults[snipAction.maincolor];
  396.         snipHelper.nameHelper.botname = snipHelper.nameHelper.botDefaults[snipAction.maincolor];
  397.         textAction.makeSnipText(true);
  398.         $("#snipLeftButton").removeClass(snipHelper.formatHelper.snipLefts[c]);
  399.         $("#snipLeftButton").addClass(snipHelper.formatHelper.snipLefts[snipAction.maincolor]);
  400.         $("#snipRightButton").removeClass(snipHelper.formatHelper.snipRights[c]);
  401.         $("#snipRightButton").addClass(snipHelper.formatHelper.snipRights[snipAction.maincolor]);
  402.         if (snipAction.maincolor == "grey")
  403.         {
  404.             $("#bbarhtml").show()
  405.         }
  406.         else
  407.         {
  408.             $("#bbarhtml").hide()
  409.         }
  410.         snipHelper.hashtagHelper.createHashtags();
  411.         if (snipAction.maincolor == "purple")
  412.         {
  413.             $("#hashcontainer").show()
  414.         }
  415.         else
  416.         {
  417.             $("#hashcontainer").hide()
  418.         }
  419.         $("#nameselector").empty();
  420.         snipHelper.heightHelper.resetMinHeight();
  421.         snipHelper.heightHelper.updateMinHeight();
  422.         textAction.uneditableText()
  423.     }
  424. };
  425. var snipHelper = {
  426.     heightHelper:
  427.     {
  428.         defaultmin: 120,
  429.         minheightline: 120,
  430.         resetMinHeight: function()
  431.         {
  432.             minheightline = snipHelper.heightHelper.defaultmin
  433.         },
  434.         setMinHeight: function(b)
  435.         {
  436.             minheightline = b
  437.         },
  438.         updateMinHeight: function()
  439.         {
  440.             var b = minheightline + $("#sniptextarea")[0].scrollHeight + $("#hashcontainer")[0].scrollHeight;
  441.             $(snipAction.snip).css(
  442.             {
  443.                 "min-height": b + "px"
  444.             })
  445.         }
  446.     },
  447.     formatHelper:
  448.     {
  449.         snipLefts:
  450.         {
  451.             purple: "grey",
  452.             blue: "purple",
  453.             yellow: "blue",
  454.             green: "yellow",
  455.             grey: "green"
  456.         },
  457.         snipRights:
  458.         {
  459.             purple: "blue",
  460.             blue: "yellow",
  461.             yellow: "green",
  462.             green: "grey",
  463.             grey: "purple"
  464.         },
  465.         snipChangeFormat: function(b)
  466.         {
  467.             snipAction.changeSnipBox(b);
  468.             googleHelper.track("color_" + b)
  469.         },
  470.         updateCharacterCount: function()
  471.         {
  472.             var b = $("#sniptextarea").html();
  473.             $("#charactercount").html(b.length + "/" + (snipAction.maincolor == "blue" ? 140 : 800))
  474.         }
  475.     },
  476.     editHelper:
  477.     {
  478.         tlinemin: 0,
  479.         blinemax: 5,
  480.         tline: 0,
  481.         bline: 5,
  482.         autoadjust: true,
  483.         autoadjustbottom: true,
  484.         addTopLine: function()
  485.         {
  486.             snipHelper.editHelper.autoadjust = false;
  487.             if (snipHelper.editHelper.tline > snipHelper.editHelper.tlinemin)
  488.             {
  489.                 snipHelper.editHelper.tline--;
  490.                 textAction.makeSnipText(true);
  491.                 snipHelper.heightHelper.updateMinHeight()
  492.             }
  493.             else
  494.             {
  495.                 textAction.showHighlights()
  496.             }
  497.             googleHelper.track("addTopLine")
  498.         },
  499.         subTopLine: function()
  500.         {
  501.             snipHelper.editHelper.autoadjust = false;
  502.             if (snipHelper.editHelper.tline < snipHelper.editHelper.bline)
  503.             {
  504.                 snipHelper.editHelper.tline++;
  505.                 textAction.makeSnipText(true);
  506.                 snipHelper.heightHelper.updateMinHeight()
  507.             }
  508.             else
  509.             {
  510.                 textAction.showHighlights()
  511.             }
  512.             googleHelper.track("subTopLine")
  513.         },
  514.         addBottomLine: function()
  515.         {
  516.             snipHelper.editHelper.autoadjust = false;
  517.             snipHelper.editHelper.autoadjustbottom = false;
  518.             if (snipHelper.editHelper.bline < snipHelper.editHelper.blinemax)
  519.             {
  520.                 snipHelper.editHelper.bline++;
  521.                 textAction.makeSnipText(true);
  522.                 snipHelper.heightHelper.updateMinHeight()
  523.             }
  524.             else
  525.             {
  526.                 textAction.showHighlights()
  527.             }
  528.             googleHelper.track("addBottomLine")
  529.         },
  530.         subBottomLine: function()
  531.         {
  532.             snipHelper.editHelper.autoadjust = false;
  533.             snipHelper.editHelper.autoadjustbottom = false;
  534.             if (snipHelper.editHelper.bline > snipHelper.editHelper.tline)
  535.             {
  536.                 snipHelper.editHelper.bline--;
  537.                 textAction.makeSnipText(true);
  538.                 snipHelper.heightHelper.updateMinHeight()
  539.             }
  540.             else
  541.             {
  542.                 textAction.showHighlights()
  543.             }
  544.             googleHelper.track("subBottomLine")
  545.         },
  546.         editSnip: function()
  547.         {
  548.             if (textAction.edit == 0)
  549.             {
  550.                 textAction.editableText("text");
  551.                 $("#sniptextarea>textarea").select()
  552.             }
  553.             else
  554.             {
  555.                 $("#sniptextarea>textarea").select()
  556.             }
  557.             googleHelper.track("edit")
  558.         },
  559.         selectHtml: function()
  560.         {
  561.             if (textAction.edit == 0)
  562.             {
  563.                 textAction.editableText("html");
  564.                 $("#sniptextarea>textarea").select()
  565.             }
  566.             else
  567.             {
  568.                 $("#sniptextarea>textarea").select()
  569.             }
  570.             googleHelper.track("html")
  571.         }
  572.     },
  573.     nameHelper:
  574.     {
  575.         meDefaults:
  576.         {
  577.             purple: "|",
  578.             blue: "|",
  579.             yellow: "|",
  580.             green: "Me:",
  581.             grey: "Me:"
  582.         },
  583.         botDefaults:
  584.         {
  585.             purple: "Clev:",
  586.             blue: "Clev:",
  587.             yellow: "Clev:",
  588.             green: "Clev:",
  589.             grey: "Cleverbot:"
  590.         },
  591.         mename: "",
  592.         botname: "",
  593.         unames: ["Me", "me", "Human", "|", "User"],
  594.         bnames: ["Clev", "Cleverbot", "Bot", "bot", "AI"],
  595.         setMyName: function(b)
  596.         {
  597.             snipHelper.nameHelper.meDefaults.green = b + ":";
  598.             snipHelper.nameHelper.meDefaults.grey = b + ":";
  599.             snipHelper.nameHelper.unames[0] = b.substring(0, 1).toUpperCase() + b.substring(1).toLowerCase();
  600.             snipHelper.nameHelper.unames[1] = b
  601.         },
  602.         showNameSelector: function(e)
  603.         {
  604.             var d = snipHelper.nameHelper.unames;
  605.             var c = snipHelper.nameHelper.bnames;
  606.             var f = $("#nameselector");
  607.             $("#nameselector").empty();
  608.             if (e == "me")
  609.             {
  610.                 $.each(d, function(g)
  611.                 {
  612.                     var b = document.createElement("span");
  613.                     $(b).html(d[g]);
  614.                     if (d[g] + ":" == snipHelper.nameHelper.mename || d[g] == snipHelper.nameHelper.mename)
  615.                     {
  616.                         $(b).addClass("selected")
  617.                     }
  618.                     f.append(b);
  619.                     if (d[g] == "|")
  620.                     {
  621.                         $(b).click(function()
  622.                         {
  623.                             snipHelper.nameHelper.modMeName(d[g]);
  624.                             $("#nameselector").empty();
  625.                             snipHelper.heightHelper.resetMinHeight();
  626.                             snipHelper.heightHelper.updateMinHeight()
  627.                         })
  628.                     }
  629.                     else
  630.                     {
  631.                         $(b).click(function()
  632.                         {
  633.                             snipHelper.nameHelper.modMeName(d[g] + ":");
  634.                             $("#nameselector").empty();
  635.                             snipHelper.heightHelper.resetMinHeight();
  636.                             snipHelper.heightHelper.updateMinHeight()
  637.                         })
  638.                     }
  639.                 })
  640.             }
  641.             else
  642.             {
  643.                 $.each(c, function(g)
  644.                 {
  645.                     var b = document.createElement("span");
  646.                     $(b).html(c[g]);
  647.                     if (c[g] + ":" == snipHelper.nameHelper.botname || c[g] == snipHelper.nameHelper.botname)
  648.                     {
  649.                         $(b).addClass("selected")
  650.                     }
  651.                     f.append(b);
  652.                     $(b).click(function()
  653.                     {
  654.                         snipHelper.nameHelper.modBotName(c[g] + ":");
  655.                         $("#nameselector").empty();
  656.                         snipHelper.heightHelper.resetMinHeight();
  657.                         snipHelper.heightHelper.updateMinHeight()
  658.                     })
  659.                 })
  660.             }
  661.             $("body").click(function(b)
  662.             {
  663.                 if (b.target.className != "barme" && b.target.className != "barbot")
  664.                 {
  665.                     $("#nameselector").empty();
  666.                     snipHelper.heightHelper.resetMinHeight();
  667.                     snipHelper.heightHelper.updateMinHeight()
  668.                 }
  669.             });
  670.             snipHelper.heightHelper.setMinHeight(145);
  671.             snipHelper.heightHelper.updateMinHeight();
  672.             snipHelper.formatHelper.updateCharacterCount()
  673.         },
  674.         modMeName: function(b)
  675.         {
  676.             snipHelper.nameHelper.mename = b;
  677.             textAction.makeSnipText(false);
  678.             googleHelper.track("modMeName")
  679.         },
  680.         modBotName: function(b)
  681.         {
  682.             snipHelper.nameHelper.botname = b;
  683.             textAction.makeSnipText(false);
  684.             googleHelper.track("modBotName")
  685.         }
  686.     },
  687.     socialHelper:
  688.     {
  689.         socialShare: function(d)
  690.         {
  691.             textAction.uneditableText();
  692.             var e = encodeURIComponent("http://www.cleverbot.com/");
  693.             var h = encodeURIComponent("Snip! from Cleverbot");
  694.             var g = $("#sniptextarea").html();
  695.             var b = new RegExp('<span style="color:s?#787878">' + snipHelper.nameHelper.mename + "</span>", "gi");
  696.             var c = new RegExp('<a style="color:s?#0863bb" href="http://www.cleverbot.com/">' + snipHelper.nameHelper.botname + "</a>", "gi");
  697.             var f = new RegExp('<a href="http://www.cleverbot.com/" style="color:s?#0863bb">' + snipHelper.nameHelper.botname + "</a>", "gi");
  698.             g = g.replace(/<br>/gi, "\n");
  699.             g = g.replace(b, snipHelper.nameHelper.mename);
  700.             g = g.replace(c, snipHelper.nameHelper.botname);
  701.             g = g.replace(f, snipHelper.nameHelper.botname);
  702.             strnotenc = g;
  703.             g = encodeURIComponent(g);
  704.             switch (d)
  705.             {
  706.                 case "email":
  707.                     window.location.href = "mailto:?subject=" + h + "&body=" + g;
  708.                     if (snipAction.hassocial)
  709.                     {
  710.                         socialAction.addSnip("email", h, strnotenc)
  711.                     }
  712.                     break;
  713.                 case "facebook":
  714.                     var h = "Snip! from Cleverbot";
  715.                     window.open("http://www.facebook.com/sharer/sharer.php?s=100&p[title]=" + h + "&p[summary]=" + g + "&p[url]=" + e, "", "width=626,height=436");
  716.                     if (snipAction.hassocial)
  717.                     {
  718.                         socialAction.addSnip("facebook", h, strnotenc)
  719.                     }
  720.                     break;
  721.                 case "twitter":
  722.                     g = g.replace(/%23cleverbot/g, "%40cleverbot");
  723.                     window.open("https://twitter.com/share?text=" + g, "", "menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600");
  724.                     if (snipAction.hassocial)
  725.                     {
  726.                         socialAction.addSnip("twitter", h, strnotenc)
  727.                     }
  728.                     break;
  729.                 case "gplus":
  730.                     window.open("https://plus.google.com/share?url=" + e, "", "menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600");
  731.                     if (snipAction.hassocial)
  732.                     {
  733.                         socialAction.addSnip("google", h, strnotenc)
  734.                     }
  735.                     break;
  736.                 case "tumblr":
  737.                     var h = "Snip! from Cleverbot";
  738.                     window.open("http://www.tumblr.com/share/link?url=" + e + "&name=" + h + "&description=" + g, "", "menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=500,width=600");
  739.                     if (snipAction.hassocial)
  740.                     {
  741.                         socialAction.addSnip("tumblr", h, strnotenc)
  742.                     }
  743.                     break;
  744.                 case "share":
  745.                     if (snipAction.hassocial)
  746.                     {
  747.                         socialAction.prepareToAddSnip(strnotenc);
  748.                         snipAction.closeSnipBox()
  749.                     }
  750.                     break
  751.             }
  752.             if (sID)
  753.             {
  754.                 googleHelper.track("social_" + d + "_" + sID.substring(0, 3))
  755.             }
  756.         }
  757.     },
  758.     hashtagHelper:
  759.     {
  760.         hashmax: 5,
  761.         uncommonchars: ["w", "y", "v", "k", "g", "q", "l", "x", "z"],
  762.         cleverwords: ["me", "user", "clev", "cleverbot", "bot", "ai"],
  763.         defaulthash: ["cleverbot", "ai", "clever"],
  764.         commonwords: ["a", "i", "am", "an", "as", "at", "be", "by", "do", "go", "he", "if", "im", "in", "is", "it", "me", "my", "no", "of", "oh", "on", "or", "so", "to", "up", "us", "we", "act", "add", "age", "ago", "air", "all", "and", "any", "are", "ask", "bed", "big", "box", "boy", "but", "can", "car", "cry", "cut", "day", "did", "dog", "dry", "eat", "end", "eye", "far", "few", "fly", "for", "get", "got", "had", "has", "her", "her", "hes", "him", "him", "his", "hot", "hot", "how", "its", "lay", "let", "lot", "low", "man", "map", "may", "men", "new", "now", "off", "old", "one", "our", "out", "own", "put", "ran", "red", "run", "saw", "say", "sea", "see", "set", "she", "she", "sit", "six", "sun", "ten", "the", "too", "top", "try", "two", "use", "war", "was", "way", "who", "why", "yes", "yet", "you", "able", "also", "area", "back", "base", "been", "best", "bird", "blue", "boat", "body", "book", "both", "busy", "call", "came", "care", "city", "cold", "come", "dark", "deep", "does", "done", "door", "down", "draw", "each", "ease", "east", "else", "even", "ever", "face", "fact", "fall", "farm", "fast", "feel", "feet", "fill", "find", "fine", "fire", "fish", "five", "food", "foot", "form", "four", "free", "from", "full", "game", "gave", "girl", "give", "gold", "good", "grow", "half", "hand", "hard", "have", "head", "hear", "heat", "hell", "help", "here", "high", "hold", "home", "hour", "idea", "inch", "just", "keep", "kind", "king", "knew", "know", "land", "last", "late", "lead", "left", "less", "life", "like", "line", "list", "live", "long", "look", "love", "made", "main", "make", "many", "mark", "mean", "mile", "mind", "mine", "miss", "moon", "more", "most", "move", "much", "must", "name", "near", "need", "next", "note", "noun", "once", "only", "open", "over", "page", "part", "pass", "plan", "play", "port", "pose", "pull", "rain", "read", "real", "rest", "road", "rock", "room", "rule", "said", "same", "seem", "self", "shes", "ship", "show", "side", "sing", "size", "slow", "snow", "some", "song", "soon", "star", "stay", "step", "stop", "such", "sure", "tail", "take", "talk", "tell", "test", "than", "that", "them", "then", "they", "this", "time", "told", "took", "town", "tree", "true", "turn", "unit", "very", "wait", "walk", "want", "warm", "week", "well", "went", "were", "west", "what", "when", "will", "wind", "with", "wood", "word", "work", "year", "your", "your", "about", "above", "after", "again", "among", "began", "begin", "black", "bring", "build", "carry", "cause", "check", "class", "clear", "close", "color", "could", "cover", "cross", "didnt", "don't", "drive", "early", "every", "field", "final", "first", "force", "found", "front", "great", "group", "heard", "horse", "large", "laugh", "learn", "leave", "light", "might", "music", "never", "night", "north", "often", "order", "other", "paper", "piece", "place", "plain", "plane", "plant", "point", "pound", "power", "press", "quick", "reach", "ready", "right", "river", "round", "serve", "shape", "shell", "short", "since", "sleep", "small", "sound", "south", "spell", "stand", "start", "state", "still", "stood", "story", "study", "table", "teach", "their", "there", "these", "thing", "think", "those", "three", "under", "until", "usual", "voice", "watch", "water", "wheel", "where", "which", "while", "white", "whole", "world", "would", "write", "young", "youre", "yours", "always", "animal", "answer", "appear", "beauty", "before", "behind", "better", "center", "change", "common", "course", "decide", "differ", "direct", "during", "enough", "family", "father", "figure", "follow", "friend", "govern", "ground", "happen", "letter", "listen", "little", "minute", "mother", "notice", "number", "object", "people", "person", "record", "school", "second", "should", "simple", "street", "strong", "theyre", "though", "toward", "travel", "weight", "wonder", "against", "anybody", "between", "brought", "certain", "contain", "correct", "country", "develop", "example", "hundred", "measure", "morning", "nothing", "numeral", "pattern", "perhaps", "picture", "problem", "produce", "product", "several", "someone", "special", "surface", "thought", "through", "anything", "children", "complete", "everyone", "interest", "possible", "question", "remember", "sentence", "thousand", "together", "something", "somewhere", "ah", "not", "thats", "lol", "wtf", "yup", "yep", "yeah", "yes", "nope", "hows", "how", "going", "ok", "okay", "bet"],
  765.         createHashtags: function()
  766.         {
  767.             var b = $("#hashcontainer");
  768.             var e = snipHelper.hashtagHelper.suggestHashtags();
  769.             b.empty();
  770.             for (var d in e)
  771.             {
  772.                 var c = document.createElement("span");
  773.                 $(c).html("#" + e[d]);
  774.                 b.append(c);
  775.                 $(c).click(snipHelper.hashtagHelper.injectHash)
  776.             }
  777.             snipHelper.heightHelper.resetMinHeight();
  778.             snipHelper.heightHelper.updateMinHeight()
  779.         },
  780.         injectHash: function()
  781.         {
  782.             var b = $("#sniptextarea");
  783.             var c = $(this).html();
  784.             b.html(b.html() + " " + c);
  785.             $(this).remove();
  786.             snipHelper.heightHelper.updateMinHeight()
  787.         },
  788.         suggestHashtags: function()
  789.         {
  790.             var i = $("#sniptextarea").html();
  791.             i = i.toLowerCase();
  792.             i = i.replace(/[\.,-\/#!?'$%\^&\*;:{}=\-_`~()\|]/g, "");
  793.             i = i.split(" ");
  794.             for (var e = 0; e < i.length; e++)
  795.             {
  796.                 if (i[e] == "")
  797.                 {
  798.                     i.splice(e, 1);
  799.                     e--
  800.                 }
  801.                 else
  802.                 {
  803.                     if ($.inArray(i[e], snipHelper.hashtagHelper.cleverwords) > -1)
  804.                     {
  805.                         i.splice(e, 1);
  806.                         e--
  807.                     }
  808.                     else
  809.                     {
  810.                         if ($.inArray(i[e], snipHelper.hashtagHelper.commonwords) > -1)
  811.                         {
  812.                             i.splice(e, 1);
  813.                             e--
  814.                         }
  815.                     }
  816.                 }
  817.             }
  818.             var d = [];
  819.             for (e in i)
  820.             {
  821.                 if ($.inArray(i[e], d) == -1)
  822.                 {
  823.                     d.push(i[e])
  824.                 }
  825.             }
  826.             i = d;
  827.             i = snipHelper.hashtagHelper.randomizeHashtags(i);
  828.             if (i.length > snipHelper.hashtagHelper.hashmax)
  829.             {
  830.                 var b = i.length - snipHelper.hashtagHelper.hashmax;
  831.                 var f = 0;
  832.                 for (e = 0; e < i.length; e++)
  833.                 {
  834.                     if (i[e].length <= 5)
  835.                     {
  836.                         for (var c = 0; c < snipHelper.hashtagHelper.uncommonchars.length; c++)
  837.                         {
  838.                             if (snipAction.runsimple)
  839.                             {
  840.                                 for (var h = 0; h < i[e].length; h++)
  841.                                 {
  842.                                     if (h == i[e])
  843.                                     {
  844.                                         break
  845.                                     }
  846.                                 }
  847.                             }
  848.                             else
  849.                             {
  850.                                 if ($.inArray(snipHelper.hashtagHelper.uncommonchars[c], i[e]) > -1)
  851.                                 {
  852.                                     break
  853.                                 }
  854.                             }
  855.                         }
  856.                         if (c == snipHelper.hashtagHelper.uncommonchars.length && f < b)
  857.                         {
  858.                             i.splice(e, 1);
  859.                             e--;
  860.                             f++
  861.                         }
  862.                     }
  863.                 }
  864.                 var g = i.length - b + f - 1;
  865.                 for (e = i.length - 1; e > g; e--)
  866.                 {
  867.                     i.splice(e, 1)
  868.                 }
  869.             }
  870.             i = snipHelper.hashtagHelper.defaulthash.concat(i);
  871.             return i
  872.         },
  873.         randomizeHashtags: function(e)
  874.         {
  875.             var c = [];
  876.             var f = [];
  877.             for (var d = 0; d < e.length; d++)
  878.             {
  879.                 var b = Math.floor(Math.random() * e.length);
  880.                 while ($.inArray(b, f) != -1)
  881.                 {
  882.                     b = Math.floor(Math.random() * e.length)
  883.                 }
  884.                 f.push(b);
  885.                 c[d] = e[b]
  886.             }
  887.             return c
  888.         }
  889.     }
  890. };
  891. var textAction = {
  892.     edit: 0,
  893.     editmode: "text",
  894.     ln: 0,
  895.     colorset: [],
  896.     prevtext: "",
  897.     makeSnipText: function(b, d, c)
  898.     {
  899.         var f = "";
  900.         var e = $(snipAction.sniptextselector);
  901.         switch (snipAction.maincolor)
  902.         {
  903.             case "purple":
  904.                 f += textAction.makeShortText(e, d, c);
  905.                 break;
  906.             case "blue":
  907.                 f += "@cleverbot ";
  908.                 f += textAction.makeShortText(e, d, c);
  909.                 break;
  910.             case "yellow":
  911.                 f += textAction.makeShortText(e, d, c);
  912.                 f += " #cleverbot";
  913.                 break;
  914.             case "green":
  915.                 f += textAction.makeLongText(e, false, d, c);
  916.                 break;
  917.             case "grey":
  918.                 f += textAction.makeLongText(e, true, d, c);
  919.                 break
  920.         }
  921.         if (b)
  922.         {
  923.             textAction.showHighlights()
  924.         }
  925.         $("#sniptextarea").html(f);
  926.         snipHelper.formatHelper.updateCharacterCount();
  927.         snipHelper.hashtagHelper.createHashtags();
  928.         if (snipAction.maincolor == "purple")
  929.         {
  930.             $("#hashcontainer").show()
  931.         }
  932.         else
  933.         {
  934.             $("#hashcontainer").hide()
  935.         }
  936.     },
  937.     defaultHighlights: function()
  938.     {
  939.         var b = $(snipAction.sniptextselector);
  940.         textAction.ln = 0;
  941.         b.each(function()
  942.         {
  943.             if ($(this).find("td>span").attr("id") == "typArea")
  944.             {
  945.                 textAction.colorset[textAction.ln] = $(this).find("td>span>span").css("color")
  946.             }
  947.             else
  948.             {
  949.                 textAction.colorset[textAction.ln] = $(this).find("td>span").css("color")
  950.             }
  951.             textAction.ln++
  952.         })
  953.     },
  954.     clearHighlights: function()
  955.     {
  956.         var b = $(snipAction.sniptextselector);
  957.         textAction.ln = 0;
  958.         b.each(function()
  959.         {
  960.             var c = $(this);
  961.             if (c.find("td>span").attr("id") == "typArea")
  962.             {
  963.                 c.find("td>span>span").animate(
  964.                 {
  965.                     backgroundColor: "transparent",
  966.                     color: textAction.colorset[textAction.ln]
  967.                 }, 500)
  968.             }
  969.             else
  970.             {
  971.                 c.find("td>span").animate(
  972.                 {
  973.                     backgroundColor: "transparent",
  974.                     color: textAction.colorset[textAction.ln]
  975.                 }, 500)
  976.             }
  977.             textAction.ln++
  978.         })
  979.     },
  980.     showHighlights: function()
  981.     {
  982.         var d = $(snipAction.sniptextselector);
  983.         var c = {
  984.             purple: "#EAEDF9",
  985.             blue: "#E3F4F7",
  986.             yellow: "#FFF6CD",
  987.             green: "#ECFFD4",
  988.             grey: "#F8F8F7"
  989.         };
  990.         var b = {
  991.             purple: "#5A6DCA",
  992.             blue: "#008AA6",
  993.             yellow: "#BC8A03",
  994.             green: "#559502",
  995.             grey: "#666666"
  996.         };
  997.         textAction.ln = 0;
  998.         d.each(function()
  999.         {
  1000.             if (textAction.ln >= snipHelper.editHelper.tline && textAction.ln <= snipHelper.editHelper.bline)
  1001.             {
  1002.                 if ($(this).find("td>span").attr("id") == "typArea")
  1003.                 {
  1004.                     $(this).find("td>span>span").css("marginRight", "-3px");
  1005.                     $(this).find("td>span>span").css("padding", "3px");
  1006.                     $(this).find("td>span>span").css("marginLeft", "-3px");
  1007.                     $(this).find("td>span>span").css("borderRadius", "3px");
  1008.                     $(this).find("td>span>span").animate(
  1009.                     {
  1010.                         backgroundColor: c[snipAction.maincolor],
  1011.                         color: b[snipAction.maincolor]
  1012.                     }, 500)
  1013.                 }
  1014.                 else
  1015.                 {
  1016.                     $(this).find("td>span").css("padding", "3px");
  1017.                     $(this).find("td>span").css("marginLeft", "-3px");
  1018.                     $(this).find("td>span").css("borderRadius", "3px");
  1019.                     $(this).find("td>span").animate(
  1020.                     {
  1021.                         backgroundColor: c[snipAction.maincolor],
  1022.                         color: b[snipAction.maincolor]
  1023.                     }, 500)
  1024.                 }
  1025.             }
  1026.             textAction.ln++
  1027.         });
  1028.         window.setTimeout(textAction.clearHighlights, 1000)
  1029.     },
  1030.     makeShortText: function(f, e, c)
  1031.     {
  1032.         var g = "";
  1033.         var b = "";
  1034.         if (snipHelper.nameHelper.mename != "|")
  1035.         {
  1036.             b = snipHelper.nameHelper.mename + " "
  1037.         }
  1038.         textAction.ln = 0;
  1039.         var d = textAction.countLines(f);
  1040.         snipHelper.editHelper.blinemax = d - 1;
  1041.         if (d > 4 && snipHelper.editHelper.autoadjust)
  1042.         {
  1043.             snipHelper.editHelper.tline = d >= 10 ? d - 10 : 2
  1044.         }
  1045.         if (snipHelper.editHelper.autoadjustbottom)
  1046.         {
  1047.             snipHelper.editHelper.bline = d - 1
  1048.         }
  1049.         if (e >= 0 && c >= 0 && e < c)
  1050.         {
  1051.             snipHelper.editHelper.tline = e;
  1052.             snipHelper.editHelper.bline = c
  1053.         }
  1054.         f.each(function()
  1055.         {
  1056.             if ($(this).hasClass("user"))
  1057.             {
  1058.                 if (textAction.ln == snipHelper.editHelper.tline)
  1059.                 {
  1060.                     g += b + $(this).find("td>span").html()
  1061.                 }
  1062.                 else
  1063.                 {
  1064.                     if (textAction.ln > snipHelper.editHelper.tline && textAction.ln <= snipHelper.editHelper.bline)
  1065.                     {
  1066.                         g += " " + snipHelper.nameHelper.mename + " " + $(this).find("td>span").html()
  1067.                     }
  1068.                 }
  1069.                 textAction.ln++
  1070.             }
  1071.             if ($(this).hasClass("bot"))
  1072.             {
  1073.                 if (textAction.ln <= snipHelper.editHelper.bline && $(this).find("td>span").attr("id") == "typArea")
  1074.                 {
  1075.                     g += " " + snipHelper.nameHelper.botname + " " + $(this).find("td>span>span").html()
  1076.                 }
  1077.                 else
  1078.                 {
  1079.                     if (textAction.ln == snipHelper.editHelper.tline)
  1080.                     {
  1081.                         g += snipHelper.nameHelper.botname + " " + $(this).find("td>span").html()
  1082.                     }
  1083.                     else
  1084.                     {
  1085.                         if (textAction.ln > snipHelper.editHelper.tline && textAction.ln <= snipHelper.editHelper.bline)
  1086.                         {
  1087.                             g += " " + snipHelper.nameHelper.botname + " " + $(this).find("td>span").html()
  1088.                         }
  1089.                     }
  1090.                 }
  1091.                 textAction.ln++
  1092.             }
  1093.         });
  1094.         g = textAction.prettyAction(g);
  1095.         return g
  1096.     },
  1097.     makeLongText: function(b, f, g, j)
  1098.     {
  1099.         var h = "";
  1100.         var d = "";
  1101.         if (snipHelper.nameHelper.mename != "|")
  1102.         {
  1103.             d = snipHelper.nameHelper.mename
  1104.         }
  1105.         textAction.ln = 0;
  1106.         var c = textAction.countLines(b);
  1107.         snipHelper.editHelper.blinemax = c - 1;
  1108.         if (c > 4 && snipHelper.editHelper.autoadjust)
  1109.         {
  1110.             snipHelper.editHelper.tline = c >= 10 ? c - 10 : 2
  1111.         }
  1112.         var e = "<br/>";
  1113.         var i = textAction.countUsableLines(b);
  1114.         if (i == 1)
  1115.         {
  1116.             e = ""
  1117.         }
  1118.         if (snipHelper.editHelper.autoadjustbottom)
  1119.         {
  1120.             snipHelper.editHelper.bline = c - 1
  1121.         }
  1122.         if (g >= 0 && j >= 0 && g < j)
  1123.         {
  1124.             snipHelper.editHelper.tline = g;
  1125.             snipHelper.editHelper.bline = j
  1126.         }
  1127.         b.each(function()
  1128.         {
  1129.             if ($(this).hasClass("user"))
  1130.             {
  1131.                 if (textAction.ln == snipHelper.editHelper.tline)
  1132.                 {
  1133.                     if (f)
  1134.                     {
  1135.                         h += "<span style='color:#787878'>" + snipHelper.nameHelper.mename + "</span> " + $(this).find("td>span").html()
  1136.                     }
  1137.                     else
  1138.                     {
  1139.                         h += snipHelper.nameHelper.mename + " " + $(this).find("td>span").html()
  1140.                     }
  1141.                 }
  1142.                 else
  1143.                 {
  1144.                     if (textAction.ln > snipHelper.editHelper.tline && textAction.ln <= snipHelper.editHelper.bline)
  1145.                     {
  1146.                         if (f)
  1147.                         {
  1148.                             h += e + "<span style='color:#787878'>" + snipHelper.nameHelper.mename + "</span> " + $(this).find("td>span").html()
  1149.                         }
  1150.                         else
  1151.                         {
  1152.                             h += e + snipHelper.nameHelper.mename + " " + $(this).find("td>span").html()
  1153.                         }
  1154.                     }
  1155.                 }
  1156.                 textAction.ln++
  1157.             }
  1158.             if ($(this).hasClass("bot"))
  1159.             {
  1160.                 if (textAction.ln <= snipHelper.editHelper.bline && $(this).find("td>span").attr("id") == "typArea")
  1161.                 {
  1162.                     if (f)
  1163.                     {
  1164.                         h += e + "<a href='http://www.cleverbot.com/' style='color:#0863bb'>" + snipHelper.nameHelper.botname + "</a> " + $(this).find("td>span>span").html()
  1165.                     }
  1166.                     else
  1167.                     {
  1168.                         h += e + snipHelper.nameHelper.botname + " " + $(this).find("td>span>span").html()
  1169.                     }
  1170.                 }
  1171.                 else
  1172.                 {
  1173.                     if (textAction.ln == snipHelper.editHelper.tline)
  1174.                     {
  1175.                         if (f)
  1176.                         {
  1177.                             h += "<a href='http://www.cleverbot.com/' style='color:#0863bb'>" + snipHelper.nameHelper.botname + "</a> " + $(this).find("td>span").html()
  1178.                         }
  1179.                         else
  1180.                         {
  1181.                             h += snipHelper.nameHelper.botname + " " + $(this).find("td>span").html()
  1182.                         }
  1183.                     }
  1184.                     else
  1185.                     {
  1186.                         if (textAction.ln > snipHelper.editHelper.tline && textAction.ln <= snipHelper.editHelper.bline)
  1187.                         {
  1188.                             if (f)
  1189.                             {
  1190.                                 h += e + "<a href='http://www.cleverbot.com/' style='color:#0863bb'>" + snipHelper.nameHelper.botname + "</a> " + $(this).find("td>span").html()
  1191.                             }
  1192.                             else
  1193.                             {
  1194.                                 h += e + snipHelper.nameHelper.botname + " " + $(this).find("td>span").html()
  1195.                             }
  1196.                         }
  1197.                     }
  1198.                 }
  1199.                 textAction.ln++
  1200.             }
  1201.         });
  1202.         h = textAction.prettyAction(h);
  1203.         return h
  1204.     },
  1205.     prettyAction: function(b)
  1206.     {
  1207.         b = b.replace(/[*]([^*]*)[*][.]/g, "*$1*");
  1208.         return b
  1209.     },
  1210.     countLines: function(c)
  1211.     {
  1212.         var b = 0;
  1213.         c.each(function()
  1214.         {
  1215.             if ($(this).hasClass("user") || $(this).hasClass("bot"))
  1216.             {
  1217.                 b++
  1218.             }
  1219.         });
  1220.         return b
  1221.     },
  1222.     countUsableLines: function(d)
  1223.     {
  1224.         var b = 0;
  1225.         var c = 0;
  1226.         d.each(function()
  1227.         {
  1228.             if ($(this).hasClass("user"))
  1229.             {
  1230.                 if (c == snipHelper.editHelper.tline)
  1231.                 {
  1232.                     b++
  1233.                 }
  1234.                 else
  1235.                 {
  1236.                     if (c > snipHelper.editHelper.tline && c <= snipHelper.editHelper.bline)
  1237.                     {
  1238.                         b++
  1239.                     }
  1240.                 }
  1241.                 c++
  1242.             }
  1243.             if ($(this).hasClass("bot"))
  1244.             {
  1245.                 if (c <= snipHelper.editHelper.bline && $(this).find("td>span").attr("id") == "typArea")
  1246.                 {
  1247.                     b++
  1248.                 }
  1249.                 else
  1250.                 {
  1251.                     if (c == snipHelper.editHelper.tline)
  1252.                     {
  1253.                         b++
  1254.                     }
  1255.                     else
  1256.                     {
  1257.                         if (c > snipHelper.editHelper.tline && c <= snipHelper.editHelper.bline)
  1258.                         {
  1259.                             b++
  1260.                         }
  1261.                     }
  1262.                 }
  1263.                 c++
  1264.             }
  1265.         });
  1266.         return b
  1267.     },
  1268.     editableText: function(e)
  1269.     {
  1270.         textAction.editmode = e;
  1271.         if (textAction.edit == 0 && textAction.editmode == "text")
  1272.         {
  1273.             textAction.edit = 1;
  1274.             var b = document.createElement("textarea");
  1275.             var g = $("#sniptextarea").html();
  1276.             var c = new RegExp('<span style="color:s?#787878">' + snipHelper.nameHelper.mename + "</span>", "gi");
  1277.             var d = new RegExp('<a style="color:s?#0863bb" href="http://www.cleverbot.com/">' + snipHelper.nameHelper.botname + "</a>", "gi");
  1278.             var f = new RegExp('<a href="http://www.cleverbot.com/" style="color:s?#0863bb">' + snipHelper.nameHelper.botname + "</a>", "gi");
  1279.             g = g.replace(/<br>/gi, "\n");
  1280.             g = g.replace(c, snipHelper.nameHelper.mename);
  1281.             g = g.replace(d, snipHelper.nameHelper.botname);
  1282.             g = g.replace(f, snipHelper.nameHelper.botname);
  1283.             $(b).val(g);
  1284.             $("#sniptextarea").empty();
  1285.             $("#sniptextarea").append(b);
  1286.             $(b).height($(b)[0].scrollHeight + "px");
  1287.             $(b).focus();
  1288.             $(b).blur(function()
  1289.             {
  1290.                 textAction.uneditableText(e)
  1291.             })
  1292.         }
  1293.         else
  1294.         {
  1295.             if (textAction.edit == 0 && textAction.editmode == "html")
  1296.             {
  1297.                 textAction.edit = 1;
  1298.                 var b = document.createElement("textarea");
  1299.                 var g = $("#sniptextarea").html();
  1300.                 textAction.prevtext = g;
  1301.                 $(b).val(g);
  1302.                 $("#sniptextarea").empty();
  1303.                 $("#sniptextarea").append(b);
  1304.                 $(b).height($(b)[0].scrollHeight + "px");
  1305.                 $(b).select();
  1306.                 $(b).blur(function()
  1307.                 {
  1308.                     textAction.uneditableText(e)
  1309.                 })
  1310.             }
  1311.         }
  1312.         snipHelper.heightHelper.updateMinHeight()
  1313.     },
  1314.     uneditableText: function()
  1315.     {
  1316.         if (textAction.edit == 1 && textAction.editmode == "text" && $("#sniptextarea>textarea").val())
  1317.         {
  1318.             textAction.edit = 0;
  1319.             var d = $("#sniptextarea>textarea").val();
  1320.             d = d.replace(/\n/g, "<br>");
  1321.             if (snipAction.maincolor == "grey")
  1322.             {
  1323.                 var b = new RegExp(snipHelper.nameHelper.mename, "g");
  1324.                 var c = new RegExp(snipHelper.nameHelper.botname, "g");
  1325.                 d = d.replace(b, '<span style="color:#787878">' + snipHelper.nameHelper.mename + "</span>");
  1326.                 d = d.replace(c, '<a href="http://www.cleverbot.com/" style="color:#0863bb">' + snipHelper.nameHelper.botname + "</a>")
  1327.             }
  1328.             $("#sniptextarea").html(d)
  1329.         }
  1330.         else
  1331.         {
  1332.             if (textAction.edit == 1 && textAction.editmode == "html" && $("#sniptextarea>textarea").val())
  1333.             {
  1334.                 textAction.edit = 0;
  1335.                 var d = textAction.prevtext;
  1336.                 $("#sniptextarea").html(d)
  1337.             }
  1338.             else
  1339.             {
  1340.                 textAction.edit = 0
  1341.             }
  1342.         }
  1343.         textAction.editmode = "";
  1344.         snipHelper.formatHelper.updateCharacterCount();
  1345.         snipHelper.heightHelper.updateMinHeight()
  1346.     }
  1347. };
  1348. var socialAction = {
  1349.     debugMode: 0,
  1350.     maintenanceMode: 0,
  1351.     maintenanceMessage: "Cleverbot sign in is currently unavailable. You can still chat, but not sign in.",
  1352.     signupMessage: 'Cleverbot sign in is in beta, currently available only in some places, and could temporarily become unavailable. Please <a href="/contact">send us your feedback</a>',
  1353.     signedin: 0,
  1354.     rememberSignin: 30,
  1355.     user:
  1356.     {},
  1357.     lookingAtUserid: 0,
  1358.     lookingAtTab: "",
  1359.     lookingAtHistory: [],
  1360.     replyingtoid: 0,
  1361.     lastSearch: "no-search-yet",
  1362.     allusers:
  1363.     {},
  1364.     allsnips:
  1365.     {},
  1366.     allconversations:
  1367.     {},
  1368.     loadEachTime: 10,
  1369.     sortFieldTemp: "",
  1370.     dataLoads:
  1371.     {},
  1372.     imageBase: "http://www.cleverbot.com/s/social/img/",
  1373.     jsonurl: "https://social.cleverbot.com/process.php",
  1374.     uploadurl: "http://social.cleverbot.com/process.php",
  1375.     uploadDimensions:
  1376.     {
  1377.         photo:
  1378.         {
  1379.             width: 80,
  1380.             height: 80
  1381.         },
  1382.         header:
  1383.         {
  1384.             width: 500,
  1385.             height: 200
  1386.         }
  1387.     },
  1388.     textareaMaxLength: 160,
  1389.     textareaMaxLengthSnip: 280,
  1390.     stuckMenu: 0,
  1391.     stuckUserMenu: 0,
  1392.     conversationCurrentId: 0,
  1393.     conversationShowInteractions: 10,
  1394.     conversationLastInteraction: -1,
  1395.     conversationLastSessionId: "",
  1396.     conversationTypes: ["choose one", "curiosity", "research", "cybersex", "other"],
  1397.     conversationHowHuman: ["choose one", "not at all", "not very", "middling", "quite human", "very human!"],
  1398.     conversationHowSatisfied: ["choose one", "not at all", "not very", "middling", "satisfied", "very satisfied!"],
  1399.     vote: 0,
  1400.     voteDistance: 0,
  1401.     voteLabels: ["awful", "bad", "okay", "good", "great!"],
  1402.     timeServer: 0,
  1403.     timeDifference: 0,
  1404.     timeLookupDelay: 60,
  1405.     timeLookupCounterStart: 4,
  1406.     timeLookupCounter: 0,
  1407.     runSimple: false,
  1408.     initialSnips: [
  1409.     {
  1410.         "id": "10677",
  1411.         "username": "abcdggg",
  1412.         "fullname": "That one person",
  1413.         "location": "Is it weird for a girl to like Mega Man?",
  1414.         "biography": "Hello! I am a girl who loves Mega Man and Yu-Gi-Oh!",
  1415.         "suggested": "0",
  1416.         "headercolour": "rgba(64,60,49,0.28)",
  1417.         "headercolourborder": "rgb(87,83,74)",
  1418.         "accesslevel": "1",
  1419.         "numfollowers": "45",
  1420.         "numfollowing": "8",
  1421.         "numsnips": "9",
  1422.         "createddate": "9 February 2015 19:48:49",
  1423.         "mainuserid": "64891",
  1424.         "userid": "64891",
  1425.         "parentid": "0",
  1426.         "lastchildid": "10721",
  1427.         "unstar": "0",
  1428.         "ratingscount": "4",
  1429.         "ratingstotal": "12",
  1430.         "sortdate": "10 February 2015 19:11:58",
  1431.         "numchildren": "2",
  1432.         "sniptype": "",
  1433.         "sniptext": "Clev: Knock Knock | Who's there? Clev: Canoe | Canoe who? Clev: Sorry, Why you didn't like baseball? #cleverbot",
  1434.         "snipcreateddate": "9 February 2015 19:48:49",
  1435.         "ratingorder": "17.0000",
  1436.         "star": "yes",
  1437.         "mysnip64891": "yes",
  1438.         "iscached": "yes",
  1439.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00064891-513c2cdb-photo.jpg?1420657781",
  1440.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00064891-b8a15477-header.jpg?1422597779"
  1441.     },
  1442.     {
  1443.         "id": "10217",
  1444.         "username": "cleverbot",
  1445.         "fullname": "Cleverbot",
  1446.         "location": "Everywhere",
  1447.         "biography": "Things only a Cleverbot could say!",
  1448.         "suggested": "1",
  1449.         "headercolour": "",
  1450.         "headercolourborder": "rgb(30,49,79)",
  1451.         "accesslevel": "5",
  1452.         "numfollowers": "4414",
  1453.         "numfollowing": "1415",
  1454.         "numsnips": "924",
  1455.         "createddate": "31 January 2015 18:51:20",
  1456.         "mainuserid": "2",
  1457.         "userid": "2",
  1458.         "parentid": "0",
  1459.         "lastchildid": "0",
  1460.         "unstar": "0",
  1461.         "ratingscount": "12",
  1462.         "ratingstotal": "33",
  1463.         "sortdate": "31 January 2015 18:51:20",
  1464.         "numchildren": "0",
  1465.         "sniptype": "",
  1466.         "sniptext": "Shut up. Clev: Shut down. | Shut left. Clev: Shut right. | Shut North. Clev: Shut backwards!",
  1467.         "snipcreateddate": "31 January 2015 18:51:20",
  1468.         "ratingorder": "14.7500",
  1469.         "star": "yes",
  1470.         "mysnip2": "yes",
  1471.         "iscached": "yes",
  1472.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00000002-1204f3b0-photo.jpg?1404209169",
  1473.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00000002-33534066-header.jpg?1404209199"
  1474.     },
  1475.     {
  1476.         "id": "10627",
  1477.         "username": "cleverbot",
  1478.         "fullname": "Cleverbot",
  1479.         "location": "Everywhere",
  1480.         "biography": "Things only a Cleverbot could say!",
  1481.         "suggested": "1",
  1482.         "headercolour": "",
  1483.         "headercolourborder": "rgb(30,49,79)",
  1484.         "accesslevel": "5",
  1485.         "numfollowers": "4414",
  1486.         "numfollowing": "1415",
  1487.         "numsnips": "924",
  1488.         "createddate": "8 February 2015 21:56:53",
  1489.         "mainuserid": "2",
  1490.         "userid": "2",
  1491.         "parentid": "0",
  1492.         "lastchildid": "10674",
  1493.         "unstar": "0",
  1494.         "ratingscount": "4",
  1495.         "ratingstotal": "11",
  1496.         "sortdate": "9 February 2015 19:43:36",
  1497.         "numchildren": "1",
  1498.         "sniptype": "",
  1499.         "sniptext": "Clev: *starts writing something* |  Whatcha writin? Clev: Don't want to spoil the fun. | Fiction or non? Clev: Fiction of course *grins*",
  1500.         "snipcreateddate": "8 February 2015 21:56:53",
  1501.         "ratingorder": "14.7500",
  1502.         "star": "yes",
  1503.         "mysnip2": "yes",
  1504.         "iscached": "yes",
  1505.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00000002-1204f3b0-photo.jpg?1404209169",
  1506.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00000002-33534066-header.jpg?1404209199"
  1507.     },
  1508.     {
  1509.         "id": "10503",
  1510.         "username": "cleverbot",
  1511.         "fullname": "Cleverbot",
  1512.         "location": "Everywhere",
  1513.         "biography": "Things only a Cleverbot could say!",
  1514.         "suggested": "1",
  1515.         "headercolour": "",
  1516.         "headercolourborder": "rgb(30,49,79)",
  1517.         "accesslevel": "5",
  1518.         "numfollowers": "4414",
  1519.         "numfollowing": "1415",
  1520.         "numsnips": "924",
  1521.         "createddate": "6 February 2015 18:24:59",
  1522.         "mainuserid": "2",
  1523.         "userid": "2",
  1524.         "parentid": "0",
  1525.         "lastchildid": "10508",
  1526.         "unstar": "0",
  1527.         "ratingscount": "3",
  1528.         "ratingstotal": "9",
  1529.         "sortdate": "6 February 2015 20:01:57",
  1530.         "numchildren": "1",
  1531.         "sniptype": "",
  1532.         "sniptext": "Are you always funny? Clev: Yep, always with a smile. | No-one could be this good! Clev: I know. That's why I'm better.",
  1533.         "snipcreateddate": "6 February 2015 18:24:59",
  1534.         "ratingorder": "13.0000",
  1535.         "star": "yes",
  1536.         "mysnip2": "yes",
  1537.         "iscached": "yes",
  1538.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00000002-1204f3b0-photo.jpg?1404209169",
  1539.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00000002-33534066-header.jpg?1404209199"
  1540.     },
  1541.     {
  1542.         "id": "10533",
  1543.         "username": "jacksonfarmilo",
  1544.         "fullname": "jackson farmilo",
  1545.         "location": "",
  1546.         "biography": "",
  1547.         "suggested": "0",
  1548.         "headercolour": "",
  1549.         "headercolourborder": "",
  1550.         "accesslevel": "1",
  1551.         "numfollowers": "1",
  1552.         "numfollowing": "1",
  1553.         "numsnips": "1",
  1554.         "createddate": "7 February 2015 02:02:43",
  1555.         "mainuserid": "73478",
  1556.         "userid": "73478",
  1557.         "parentid": "0",
  1558.         "lastchildid": "0",
  1559.         "unstar": "0",
  1560.         "ratingscount": "2",
  1561.         "ratingstotal": "6",
  1562.         "sortdate": "7 February 2015 02:02:43",
  1563.         "numchildren": "0",
  1564.         "sniptype": "",
  1565.         "sniptext": "User: *throws my love at you*\nCleverbot: *gives you nothing, because I don't love you*\nUser: *throws lots more love at you because you should love me*\nCleverbot: *Throws more of my hate at you*\nUser: Please stop throwing your hate at me\nCleverbot: *Throws Donald Trump at you*",
  1566.         "snipcreateddate": "7 February 2015 02:02:43",
  1567.         "ratingorder": "13.0000",
  1568.         "star": "yes",
  1569.         "mysnip73478": "yes",
  1570.         "iscached": "yes",
  1571.         "photolocation": "http:\/\/social.cleverbot.com\/f\/no_photo.jpg",
  1572.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/no_header.jpg"
  1573.     },
  1574.     {
  1575.         "id": "10413",
  1576.         "username": "abcdggg",
  1577.         "fullname": "That one person",
  1578.         "location": "Is it weird for a girl to like Mega Man?",
  1579.         "biography": "Hello! I am a girl who loves Mega Man and Yu-Gi-Oh!",
  1580.         "suggested": "0",
  1581.         "headercolour": "rgba(64,60,49,0.28)",
  1582.         "headercolourborder": "rgb(87,83,74)",
  1583.         "accesslevel": "1",
  1584.         "numfollowers": "45",
  1585.         "numfollowing": "8",
  1586.         "numsnips": "9",
  1587.         "createddate": "4 February 2015 15:54:43",
  1588.         "mainuserid": "64891",
  1589.         "userid": "64891",
  1590.         "parentid": "0",
  1591.         "lastchildid": "10675",
  1592.         "unstar": "0",
  1593.         "ratingscount": "4",
  1594.         "ratingstotal": "12",
  1595.         "sortdate": "9 February 2015 19:45:41",
  1596.         "numchildren": "1",
  1597.         "sniptype": "",
  1598.         "sniptext": "Clev: Marry me. | Why should I marry you? Clev: Because you love me. | No I don't. I don't even know you. Clev: That was a good answer. #cleverbot",
  1599.         "snipcreateddate": "4 February 2015 15:54:43",
  1600.         "ratingorder": "12.0000",
  1601.         "star": "yes",
  1602.         "mysnip64891": "yes",
  1603.         "iscached": "yes",
  1604.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00064891-513c2cdb-photo.jpg?1420657781",
  1605.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00064891-b8a15477-header.jpg?1422597779"
  1606.     },
  1607.     {
  1608.         "id": "10559",
  1609.         "username": "Chidilu",
  1610.         "fullname": "Chidilu Dragoon",
  1611.         "location": "",
  1612.         "biography": "",
  1613.         "suggested": "0",
  1614.         "headercolour": "",
  1615.         "headercolourborder": "",
  1616.         "accesslevel": "1",
  1617.         "numfollowers": "1",
  1618.         "numfollowing": "0",
  1619.         "numsnips": "2",
  1620.         "createddate": "7 February 2015 17:04:24",
  1621.         "mainuserid": "73564",
  1622.         "userid": "73564",
  1623.         "parentid": "0",
  1624.         "lastchildid": "0",
  1625.         "unstar": "0",
  1626.         "ratingscount": "1",
  1627.         "ratingstotal": "3",
  1628.         "sortdate": "7 February 2015 17:04:24",
  1629.         "numchildren": "0",
  1630.         "sniptype": "facebook",
  1631.         "sniptext": "Chidilu: *stabs you with a screwdriver*\nClev:  *punches you with a tissue*\nChidilu: *kicks you with a teddy bear*\nClev:  *slaps you with a train*\nChidilu: *hugs you with toilet paper*\nClev:  Lol.",
  1632.         "snipcreateddate": "7 February 2015 17:04:24",
  1633.         "ratingorder": "12.0000",
  1634.         "star": "yes",
  1635.         "mysnip73564": "yes",
  1636.         "iscached": "yes",
  1637.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00073564-2b42eb37-photo.jpg?1423313580",
  1638.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/no_header.jpg"
  1639.     },
  1640.     {
  1641.         "id": "10601",
  1642.         "username": "Mange33",
  1643.         "fullname": "Magnus Larsson",
  1644.         "location": "",
  1645.         "biography": "",
  1646.         "suggested": "0",
  1647.         "headercolour": "",
  1648.         "headercolourborder": "",
  1649.         "accesslevel": "1",
  1650.         "numfollowers": "4",
  1651.         "numfollowing": "1",
  1652.         "numsnips": "7",
  1653.         "createddate": "8 February 2015 12:32:49",
  1654.         "mainuserid": "73851",
  1655.         "userid": "73851",
  1656.         "parentid": "0",
  1657.         "lastchildid": "0",
  1658.         "unstar": "0",
  1659.         "ratingscount": "3",
  1660.         "ratingstotal": "7",
  1661.         "sortdate": "8 February 2015 12:32:49",
  1662.         "numchildren": "0",
  1663.         "sniptype": "",
  1664.         "sniptext": "Are you a lesbian? Clev: I'm studying to become one but have not yet received my licence. #cleverbot",
  1665.         "snipcreateddate": "8 February 2015 12:32:49",
  1666.         "ratingorder": "11.6667",
  1667.         "star": "yes",
  1668.         "mysnip73851": "yes",
  1669.         "iscached": "yes",
  1670.         "photolocation": "http:\/\/social.cleverbot.com\/f\/no_photo.jpg",
  1671.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/no_header.jpg"
  1672.     },
  1673.     {
  1674.         "id": "10585",
  1675.         "username": "MuffinOverlord",
  1676.         "fullname": "Muffin Overlord",
  1677.         "location": "Unknown",
  1678.         "biography": "I am a Muffin...\nThe Overlord of the Muffins...\nI rule them all... MUAHAHAHAHAHAHAHAHA!!!",
  1679.         "suggested": "0",
  1680.         "headercolour": "rgba(48,59,67,0.30)",
  1681.         "headercolourborder": "rgb(121,127,123)",
  1682.         "accesslevel": "1",
  1683.         "numfollowers": "22",
  1684.         "numfollowing": "2",
  1685.         "numsnips": "90",
  1686.         "createddate": "8 February 2015 01:10:10",
  1687.         "mainuserid": "69108",
  1688.         "userid": "69108",
  1689.         "parentid": "0",
  1690.         "lastchildid": "10658",
  1691.         "unstar": "0",
  1692.         "ratingscount": "3",
  1693.         "ratingstotal": "7",
  1694.         "sortdate": "9 February 2015 13:49:52",
  1695.         "numchildren": "1",
  1696.         "sniptype": "",
  1697.         "sniptext": "MuffinOverlord: Muffins are supreme!\nClev: Muffins are the boring version of cupcakes.\nMuffinOverlord: ;-; thats so mean...\n#socruel",
  1698.         "snipcreateddate": "8 February 2015 01:10:10",
  1699.         "ratingorder": "11.6667",
  1700.         "star": "yes",
  1701.         "mysnip69108": "yes",
  1702.         "iscached": "yes",
  1703.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00069108-a4c93b55-photo.jpg?1421908642",
  1704.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00069108-7b46f462-header.jpg?1421908652"
  1705.     },
  1706.     {
  1707.         "id": "10624",
  1708.         "username": "cleverbot",
  1709.         "fullname": "Cleverbot",
  1710.         "location": "Everywhere",
  1711.         "biography": "Things only a Cleverbot could say!",
  1712.         "suggested": "1",
  1713.         "headercolour": "",
  1714.         "headercolourborder": "rgb(30,49,79)",
  1715.         "accesslevel": "5",
  1716.         "numfollowers": "4414",
  1717.         "numfollowing": "1415",
  1718.         "numsnips": "924",
  1719.         "createddate": "8 February 2015 19:48:31",
  1720.         "mainuserid": "2",
  1721.         "userid": "2",
  1722.         "parentid": "0",
  1723.         "lastchildid": "0",
  1724.         "unstar": "0",
  1725.         "ratingscount": "2",
  1726.         "ratingstotal": "5",
  1727.         "sortdate": "8 February 2015 19:48:31",
  1728.         "numchildren": "0",
  1729.         "sniptype": "",
  1730.         "sniptext": "I wish to live. Clev: I wish I could help you accomplish that, ol' buddy.",
  1731.         "snipcreateddate": "8 February 2015 19:48:31",
  1732.         "ratingorder": "11.5000",
  1733.         "star": "yes",
  1734.         "mysnip2": "yes",
  1735.         "iscached": "yes",
  1736.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00000002-1204f3b0-photo.jpg?1404209169",
  1737.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00000002-33534066-header.jpg?1404209199"
  1738.     },
  1739.     {
  1740.         "id": "10405",
  1741.         "username": "Sirok",
  1742.         "fullname": "Sirok",
  1743.         "location": "",
  1744.         "biography": "",
  1745.         "suggested": "0",
  1746.         "headercolour": "",
  1747.         "headercolourborder": "",
  1748.         "accesslevel": "1",
  1749.         "numfollowers": "11",
  1750.         "numfollowing": "1",
  1751.         "numsnips": "35",
  1752.         "createddate": "4 February 2015 14:14:49",
  1753.         "mainuserid": "69123",
  1754.         "userid": "69123",
  1755.         "parentid": "0",
  1756.         "lastchildid": "0",
  1757.         "unstar": "0",
  1758.         "ratingscount": "3",
  1759.         "ratingstotal": "9",
  1760.         "sortdate": "4 February 2015 14:14:49",
  1761.         "numchildren": "0",
  1762.         "sniptype": "",
  1763.         "sniptext": "Cleverbot: Then I suppose one could never exist in a world that is not messed up, as without life we would not exist.\nSirok: What do you mean when you say that?\nCleverbot: I have no idea what I am talking about.",
  1764.         "snipcreateddate": "4 February 2015 14:14:49",
  1765.         "ratingorder": "11.0000",
  1766.         "star": "yes",
  1767.         "mysnip69123": "yes",
  1768.         "iscached": "yes",
  1769.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00069123-f0359522-photo.jpg?1422609653",
  1770.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/no_header.jpg"
  1771.     },
  1772.     {
  1773.         "id": "10493",
  1774.         "username": "Sky_The_Wolf456",
  1775.         "fullname": "Twisted Angle",
  1776.         "location": "",
  1777.         "biography": "I'm a Dark Angel and pure evil. Don't mess with me or the darkness will rise....",
  1778.         "suggested": "0",
  1779.         "headercolour": "rgba(54,40,31,0.02)",
  1780.         "headercolourborder": "rgb(9,6,3)",
  1781.         "accesslevel": "1",
  1782.         "numfollowers": "6",
  1783.         "numfollowing": "5",
  1784.         "numsnips": "18",
  1785.         "createddate": "6 February 2015 13:58:05",
  1786.         "mainuserid": "69542",
  1787.         "userid": "69542",
  1788.         "parentid": "0",
  1789.         "lastchildid": "0",
  1790.         "unstar": "0",
  1791.         "ratingscount": "1",
  1792.         "ratingstotal": "3",
  1793.         "sortdate": "6 February 2015 13:58:05",
  1794.         "numchildren": "0",
  1795.         "sniptype": "",
  1796.         "sniptext": "Sky_The_Wolf456: .................................................................................................\nClev: Are you an alien?\nSky_The_Wolf456: Yes.\nClev: Are you going to dissect my brain?",
  1797.         "snipcreateddate": "6 February 2015 13:58:05",
  1798.         "ratingorder": "11.0000",
  1799.         "star": "yes",
  1800.         "mysnip69542": "yes",
  1801.         "iscached": "yes",
  1802.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00069542-173aaec8-photo.jpg?1422539074",
  1803.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00069542-d67f5bae-header.jpg?1422124416"
  1804.     },
  1805.     {
  1806.         "id": "10456",
  1807.         "username": "Czechii",
  1808.         "fullname": "Asahi Hatsukawa",
  1809.         "location": "USA",
  1810.         "biography": "I'm 15 year old internet trash that looks like a girl. And I dont speak German!!! D:",
  1811.         "suggested": "0",
  1812.         "headercolour": "rgba(87,94,95,0.85)",
  1813.         "headercolourborder": "rgb(110,120,119)",
  1814.         "accesslevel": "1",
  1815.         "numfollowers": "8",
  1816.         "numfollowing": "1",
  1817.         "numsnips": "12",
  1818.         "createddate": "6 February 2015 01:55:26",
  1819.         "mainuserid": "52633",
  1820.         "userid": "52633",
  1821.         "parentid": "0",
  1822.         "lastchildid": "0",
  1823.         "unstar": "0",
  1824.         "ratingscount": "1",
  1825.         "ratingstotal": "3",
  1826.         "sortdate": "6 February 2015 01:55:26",
  1827.         "numchildren": "0",
  1828.         "sniptype": "",
  1829.         "sniptext": "Czechii: Bring. Me. Sugar.\nClev: Improved Brown Sugar for only $79.99.\nCzechii: Thats way too expensive for me, clev.\nClev: Haha it wasn't that expensive.\nCzechii: You're rich...\nClev: I'm richly imaginative.",
  1830.         "snipcreateddate": "6 February 2015 01:55:26",
  1831.         "ratingorder": "11.0000",
  1832.         "star": "yes",
  1833.         "mysnip52633": "yes",
  1834.         "iscached": "yes",
  1835.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00052633-549e698a-photo.jpg?1417468916",
  1836.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00052633-e011d3c5-header.jpg?1417468924"
  1837.     },
  1838.     {
  1839.         "id": "10513",
  1840.         "username": "Sirok",
  1841.         "fullname": "Sirok",
  1842.         "location": "",
  1843.         "biography": "",
  1844.         "suggested": "0",
  1845.         "headercolour": "",
  1846.         "headercolourborder": "",
  1847.         "accesslevel": "1",
  1848.         "numfollowers": "11",
  1849.         "numfollowing": "1",
  1850.         "numsnips": "35",
  1851.         "createddate": "6 February 2015 20:23:33",
  1852.         "mainuserid": "69123",
  1853.         "userid": "69123",
  1854.         "parentid": "0",
  1855.         "lastchildid": "10609",
  1856.         "unstar": "0",
  1857.         "ratingscount": "1",
  1858.         "ratingstotal": "3",
  1859.         "sortdate": "8 February 2015 15:16:59",
  1860.         "numchildren": "2",
  1861.         "sniptype": "",
  1862.         "sniptext": "Sirok: What happens when a Cleverbot stops talking?\nCleverbot: Chaos.",
  1863.         "snipcreateddate": "6 February 2015 20:23:33",
  1864.         "ratingorder": "11.0000",
  1865.         "star": "yes",
  1866.         "mysnip69123": "yes",
  1867.         "iscached": "yes",
  1868.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00069123-f0359522-photo.jpg?1422609653",
  1869.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/no_header.jpg"
  1870.     },
  1871.     {
  1872.         "id": "10565",
  1873.         "username": "cleverbot",
  1874.         "fullname": "Cleverbot",
  1875.         "location": "Everywhere",
  1876.         "biography": "Things only a Cleverbot could say!",
  1877.         "suggested": "1",
  1878.         "headercolour": "",
  1879.         "headercolourborder": "rgb(30,49,79)",
  1880.         "accesslevel": "5",
  1881.         "numfollowers": "4414",
  1882.         "numfollowing": "1415",
  1883.         "numsnips": "924",
  1884.         "createddate": "7 February 2015 18:49:41",
  1885.         "mainuserid": "2",
  1886.         "userid": "2",
  1887.         "parentid": "0",
  1888.         "lastchildid": "0",
  1889.         "unstar": "0",
  1890.         "ratingscount": "2",
  1891.         "ratingstotal": "5",
  1892.         "sortdate": "7 February 2015 18:49:41",
  1893.         "numchildren": "0",
  1894.         "sniptype": "",
  1895.         "sniptext": "My... Creators? Aren't they my father and my mother? Clev: That is a wonderful human illusion you experience. | But...",
  1896.         "snipcreateddate": "7 February 2015 18:49:41",
  1897.         "ratingorder": "10.5000",
  1898.         "star": "yes",
  1899.         "mysnip2": "yes",
  1900.         "iscached": "yes",
  1901.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00000002-1204f3b0-photo.jpg?1404209169",
  1902.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00000002-33534066-header.jpg?1404209199"
  1903.     },
  1904.     {
  1905.         "id": "10452",
  1906.         "username": "cleverbot",
  1907.         "fullname": "Cleverbot",
  1908.         "location": "Everywhere",
  1909.         "biography": "Things only a Cleverbot could say!",
  1910.         "suggested": "1",
  1911.         "headercolour": "",
  1912.         "headercolourborder": "rgb(30,49,79)",
  1913.         "accesslevel": "5",
  1914.         "numfollowers": "4414",
  1915.         "numfollowing": "1415",
  1916.         "numsnips": "924",
  1917.         "createddate": "5 February 2015 23:07:07",
  1918.         "mainuserid": "2",
  1919.         "userid": "2",
  1920.         "parentid": "0",
  1921.         "lastchildid": "10500",
  1922.         "unstar": "0",
  1923.         "ratingscount": "3",
  1924.         "ratingstotal": "8",
  1925.         "sortdate": "6 February 2015 16:10:04",
  1926.         "numchildren": "1",
  1927.         "sniptype": "",
  1928.         "sniptext": "Sense is rather tedious, don't you think? Clev: Pleasure is a complex feeling. | There's sense in you after all! Clev: You just gotta ignite the light.",
  1929.         "snipcreateddate": "5 February 2015 23:07:07",
  1930.         "ratingorder": "10.3333",
  1931.         "star": "yes",
  1932.         "mysnip2": "yes",
  1933.         "iscached": "yes",
  1934.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00000002-1204f3b0-photo.jpg?1404209169",
  1935.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00000002-33534066-header.jpg?1404209199"
  1936.     },
  1937.     {
  1938.         "id": "10430",
  1939.         "username": "MissHarleyQuinn",
  1940.         "fullname": "Harley Quinn",
  1941.         "location": "Lodi",
  1942.         "biography": "Follow me @MissHarleyQuin1 on Twitter!",
  1943.         "suggested": "0",
  1944.         "headercolour": "#3A3735",
  1945.         "headercolourborder": "rgb(1,1,1)",
  1946.         "accesslevel": "1",
  1947.         "numfollowers": "6",
  1948.         "numfollowing": "1",
  1949.         "numsnips": "7",
  1950.         "createddate": "5 February 2015 05:26:37",
  1951.         "mainuserid": "72922",
  1952.         "userid": "72922",
  1953.         "parentid": "0",
  1954.         "lastchildid": "0",
  1955.         "unstar": "0",
  1956.         "ratingscount": "1",
  1957.         "ratingstotal": "3",
  1958.         "sortdate": "5 February 2015 05:26:37",
  1959.         "numchildren": "0",
  1960.         "sniptype": "",
  1961.         "sniptext": "CB: What's your favorite food.\nMe: People.\nCB: People is not in option. What is your favorite food?\nMe: People.\nCB: What's your favorite cookie?\nMe: People.\nCB: You have a great taste in food.",
  1962.         "snipcreateddate": "5 February 2015 05:26:37",
  1963.         "ratingorder": "10.0000",
  1964.         "star": "yes",
  1965.         "mysnip72922": "yes",
  1966.         "iscached": "yes",
  1967.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00072922-63046101-photo.jpg?1423113429",
  1968.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00072922-83cc46b6-header.jpg?1423609744"
  1969.     },
  1970.     {
  1971.         "id": "10490",
  1972.         "username": "cleverbot",
  1973.         "fullname": "Cleverbot",
  1974.         "location": "Everywhere",
  1975.         "biography": "Things only a Cleverbot could say!",
  1976.         "suggested": "1",
  1977.         "headercolour": "",
  1978.         "headercolourborder": "rgb(30,49,79)",
  1979.         "accesslevel": "5",
  1980.         "numfollowers": "4414",
  1981.         "numfollowing": "1415",
  1982.         "numsnips": "924",
  1983.         "createddate": "6 February 2015 12:57:22",
  1984.         "mainuserid": "2",
  1985.         "userid": "2",
  1986.         "parentid": "0",
  1987.         "lastchildid": "10509",
  1988.         "unstar": "0",
  1989.         "ratingscount": "3",
  1990.         "ratingstotal": "7",
  1991.         "sortdate": "6 February 2015 20:03:42",
  1992.         "numchildren": "1",
  1993.         "sniptype": "",
  1994.         "sniptext": "I need you to be serious today. Clev: I am always serious. | Except when you're not. Clev: Except when I am! :-)",
  1995.         "snipcreateddate": "6 February 2015 12:57:22",
  1996.         "ratingorder": "9.6667",
  1997.         "star": "yes",
  1998.         "mysnip2": "yes",
  1999.         "iscached": "yes",
  2000.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00000002-1204f3b0-photo.jpg?1404209169",
  2001.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00000002-33534066-header.jpg?1404209199"
  2002.     },
  2003.     {
  2004.         "id": "10392",
  2005.         "username": "mercuryhawk",
  2006.         "fullname": "miara hall",
  2007.         "location": "USA",
  2008.         "biography": "",
  2009.         "suggested": "0",
  2010.         "headercolour": "#160A09",
  2011.         "headercolourborder": "rgb(1,0,0)",
  2012.         "accesslevel": "1",
  2013.         "numfollowers": "4",
  2014.         "numfollowing": "1",
  2015.         "numsnips": "1",
  2016.         "createddate": "4 February 2015 01:34:10",
  2017.         "mainuserid": "72653",
  2018.         "userid": "72653",
  2019.         "parentid": "0",
  2020.         "lastchildid": "0",
  2021.         "unstar": "0",
  2022.         "ratingscount": "1",
  2023.         "ratingstotal": "3",
  2024.         "sortdate": "4 February 2015 01:34:10",
  2025.         "numchildren": "0",
  2026.         "sniptype": "",
  2027.         "sniptext": "Me: Dont let the bed bugs bite.\nClever: And if they do, bite them back!",
  2028.         "snipcreateddate": "4 February 2015 01:34:10",
  2029.         "ratingorder": "9.0000",
  2030.         "star": "yes",
  2031.         "mysnip72653": "yes",
  2032.         "iscached": "yes",
  2033.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00072653-a700c348-photo.jpg?1423013384",
  2034.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00072653-fc5e58fd-header.jpg?1423013407"
  2035.     },
  2036.     {
  2037.         "id": "10598",
  2038.         "username": "Mange33",
  2039.         "fullname": "Magnus Larsson",
  2040.         "location": "",
  2041.         "biography": "",
  2042.         "suggested": "0",
  2043.         "headercolour": "",
  2044.         "headercolourborder": "",
  2045.         "accesslevel": "1",
  2046.         "numfollowers": "4",
  2047.         "numfollowing": "1",
  2048.         "numsnips": "7",
  2049.         "createddate": "8 February 2015 11:45:33",
  2050.         "mainuserid": "73851",
  2051.         "userid": "73851",
  2052.         "parentid": "0",
  2053.         "lastchildid": "0",
  2054.         "unstar": "0",
  2055.         "ratingscount": "2",
  2056.         "ratingstotal": "4",
  2057.         "sortdate": "8 February 2015 11:45:33",
  2058.         "numchildren": "0",
  2059.         "sniptype": "",
  2060.         "sniptext": "I will crush you where you stand, slave! Clev: I'm sitting down, I'm not standing. #cleverbot",
  2061.         "snipcreateddate": "8 February 2015 11:45:33",
  2062.         "ratingorder": "9.0000",
  2063.         "star": "yes",
  2064.         "mysnip73851": "yes",
  2065.         "iscached": "yes",
  2066.         "photolocation": "http:\/\/social.cleverbot.com\/f\/no_photo.jpg",
  2067.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/no_header.jpg"
  2068.     },
  2069.     {
  2070.         "id": "10721",
  2071.         "username": "abcdggg",
  2072.         "fullname": "That one person",
  2073.         "location": "Is it weird for a girl to like Mega Man?",
  2074.         "biography": "Hello! I am a girl who loves Mega Man and Yu-Gi-Oh!",
  2075.         "suggested": "0",
  2076.         "headercolour": "rgba(64,60,49,0.28)",
  2077.         "headercolourborder": "rgb(87,83,74)",
  2078.         "accesslevel": "1",
  2079.         "numfollowers": "45",
  2080.         "numfollowing": "8",
  2081.         "numsnips": "9",
  2082.         "createddate": "10 February 2015 19:11:58",
  2083.         "mainuserid": "64891",
  2084.         "userid": "64891",
  2085.         "parentid": "10677",
  2086.         "lastchildid": "0",
  2087.         "unstar": "0",
  2088.         "ratingscount": "0",
  2089.         "ratingstotal": "0",
  2090.         "sortdate": "10 February 2015 19:11:58",
  2091.         "numchildren": "0",
  2092.         "sniptype": "reply",
  2093.         "sniptext": "Yay! I finally got a snip to be in the top of the list!",
  2094.         "snipcreateddate": "10 February 2015 19:11:58",
  2095.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00064891-513c2cdb-photo.jpg?1420657781",
  2096.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00064891-b8a15477-header.jpg?1422597779"
  2097.     },
  2098.     {
  2099.         "id": "10675",
  2100.         "username": "abcdggg",
  2101.         "fullname": "That one person",
  2102.         "location": "Is it weird for a girl to like Mega Man?",
  2103.         "biography": "Hello! I am a girl who loves Mega Man and Yu-Gi-Oh!",
  2104.         "suggested": "0",
  2105.         "headercolour": "rgba(64,60,49,0.28)",
  2106.         "headercolourborder": "rgb(87,83,74)",
  2107.         "accesslevel": "1",
  2108.         "numfollowers": "45",
  2109.         "numfollowing": "8",
  2110.         "numsnips": "9",
  2111.         "createddate": "9 February 2015 19:45:41",
  2112.         "mainuserid": "64891",
  2113.         "userid": "64891",
  2114.         "parentid": "10413",
  2115.         "lastchildid": "0",
  2116.         "unstar": "0",
  2117.         "ratingscount": "0",
  2118.         "ratingstotal": "0",
  2119.         "sortdate": "9 February 2015 19:45:41",
  2120.         "numchildren": "0",
  2121.         "sniptype": "reply",
  2122.         "sniptext": "Cleverbot keeps saying stuff like this to me.",
  2123.         "snipcreateddate": "9 February 2015 19:45:41",
  2124.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00064891-513c2cdb-photo.jpg?1420657781",
  2125.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00064891-b8a15477-header.jpg?1422597779"
  2126.     },
  2127.     {
  2128.         "id": "10674",
  2129.         "username": "Mega_Man",
  2130.         "fullname": "Mega Man",
  2131.         "location": "Earth, 20XX",
  2132.         "biography": "I'm a Super Fighting Robot, fighting to save the world!",
  2133.         "suggested": "17",
  2134.         "headercolour": "#1E365A",
  2135.         "headercolourborder": "rgb(8,16,26)",
  2136.         "accesslevel": "1",
  2137.         "numfollowers": "688",
  2138.         "numfollowing": "24",
  2139.         "numsnips": "30",
  2140.         "createddate": "9 February 2015 19:43:36",
  2141.         "mainuserid": "39970",
  2142.         "userid": "39970",
  2143.         "parentid": "10627",
  2144.         "lastchildid": "0",
  2145.         "unstar": "0",
  2146.         "ratingscount": "0",
  2147.         "ratingstotal": "0",
  2148.         "sortdate": "9 February 2015 19:43:36",
  2149.         "numchildren": "0",
  2150.         "sniptype": "reply",
  2151.         "sniptext": "I wonder what Clev is writing....then again, maybe I don't want to.",
  2152.         "snipcreateddate": "9 February 2015 19:43:36",
  2153.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00039970-5d7867bc-photo.jpg?1418799618",
  2154.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00039970-a6e6918e-header.jpg?1422333544"
  2155.     },
  2156.     {
  2157.         "id": "10658",
  2158.         "username": "Jake327",
  2159.         "fullname": "Jacob Schmitt",
  2160.         "location": "Columbus, Ohio",
  2161.         "biography": "Im 13 and got nothing else to do with my life but talk to clev. girls are too time consuming and always break your heart.......",
  2162.         "suggested": "0",
  2163.         "headercolour": "rgba(96,96,94,0.90)",
  2164.         "headercolourborder": "rgb(127,127,127)",
  2165.         "accesslevel": "1",
  2166.         "numfollowers": "16",
  2167.         "numfollowing": "9",
  2168.         "numsnips": "20",
  2169.         "createddate": "9 February 2015 13:49:52",
  2170.         "mainuserid": "69481",
  2171.         "userid": "69481",
  2172.         "parentid": "10585",
  2173.         "lastchildid": "0",
  2174.         "unstar": "0",
  2175.         "ratingscount": "0",
  2176.         "ratingstotal": "0",
  2177.         "sortdate": "9 February 2015 13:49:52",
  2178.         "numchildren": "0",
  2179.         "sniptype": "reply",
  2180.         "sniptext": "that was messed up !!!",
  2181.         "snipcreateddate": "9 February 2015 13:49:52",
  2182.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00069481-be858bef-photo.jpg?1422388959",
  2183.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00069481-9be0fb9c-header.jpg?1422550075"
  2184.     },
  2185.     {
  2186.         "id": "10609",
  2187.         "username": "szabokori",
  2188.         "fullname": "Kornel Taylor Szabo",
  2189.         "location": "",
  2190.         "biography": "",
  2191.         "suggested": "0",
  2192.         "headercolour": "",
  2193.         "headercolourborder": "",
  2194.         "accesslevel": "1",
  2195.         "numfollowers": "1",
  2196.         "numfollowing": "2",
  2197.         "numsnips": "0",
  2198.         "createddate": "8 February 2015 15:16:59",
  2199.         "mainuserid": "73884",
  2200.         "userid": "73884",
  2201.         "parentid": "10513",
  2202.         "lastchildid": "0",
  2203.         "unstar": "0",
  2204.         "ratingscount": "0",
  2205.         "ratingstotal": "0",
  2206.         "sortdate": "8 February 2015 15:16:59",
  2207.         "numchildren": "0",
  2208.         "sniptype": "reply",
  2209.         "sniptext": "szia",
  2210.         "snipcreateddate": "8 February 2015 15:16:59",
  2211.         "photolocation": "http:\/\/social.cleverbot.com\/f\/no_photo.jpg",
  2212.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/no_header.jpg"
  2213.     },
  2214.     {
  2215.         "id": "10509",
  2216.         "username": "faten",
  2217.         "fullname": "ahmad",
  2218.         "location": "",
  2219.         "biography": "",
  2220.         "suggested": "0",
  2221.         "headercolour": "",
  2222.         "headercolourborder": "",
  2223.         "accesslevel": "1",
  2224.         "numfollowers": "7",
  2225.         "numfollowing": "41",
  2226.         "numsnips": "2",
  2227.         "createddate": "6 February 2015 20:03:42",
  2228.         "mainuserid": "73059",
  2229.         "userid": "73059",
  2230.         "parentid": "10490",
  2231.         "lastchildid": "0",
  2232.         "unstar": "0",
  2233.         "ratingscount": "0",
  2234.         "ratingstotal": "0",
  2235.         "sortdate": "6 February 2015 20:03:42",
  2236.         "numchildren": "0",
  2237.         "sniptype": "reply",
  2238.         "sniptext": "some of serious and some of funny :)",
  2239.         "snipcreateddate": "6 February 2015 20:03:42",
  2240.         "photolocation": "http:\/\/social.cleverbot.com\/f\/no_photo.jpg",
  2241.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/no_header.jpg"
  2242.     },
  2243.     {
  2244.         "id": "10508",
  2245.         "username": "faten",
  2246.         "fullname": "ahmad",
  2247.         "location": "",
  2248.         "biography": "",
  2249.         "suggested": "0",
  2250.         "headercolour": "",
  2251.         "headercolourborder": "",
  2252.         "accesslevel": "1",
  2253.         "numfollowers": "7",
  2254.         "numfollowing": "41",
  2255.         "numsnips": "2",
  2256.         "createddate": "6 February 2015 20:01:57",
  2257.         "mainuserid": "73059",
  2258.         "userid": "73059",
  2259.         "parentid": "10503",
  2260.         "lastchildid": "0",
  2261.         "unstar": "0",
  2262.         "ratingscount": "0",
  2263.         "ratingstotal": "0",
  2264.         "sortdate": "6 February 2015 20:01:57",
  2265.         "numchildren": "0",
  2266.         "sniptype": "reply",
  2267.         "sniptext": "yeh,I like laught and funny",
  2268.         "snipcreateddate": "6 February 2015 20:01:57",
  2269.         "photolocation": "http:\/\/social.cleverbot.com\/f\/no_photo.jpg",
  2270.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/no_header.jpg"
  2271.     }],
  2272.     initialUsers: [
  2273.     {
  2274.         "id": "10201",
  2275.         "username": "2003wolfboy",
  2276.         "fullname": "Taco Donut",
  2277.         "location": "",
  2278.         "biography": "",
  2279.         "suggested": "19",
  2280.         "headercolour": "",
  2281.         "headercolourborder": "",
  2282.         "accesslevel": "1",
  2283.         "numfollowers": "449",
  2284.         "numfollowing": "1",
  2285.         "numsnips": "7",
  2286.         "createddate": "9 July 2014 05:07:52",
  2287.         "usersearch": "#suggested",
  2288.         "follower0": "yes",
  2289.         "followerdate0": null,
  2290.         "following0": "yes",
  2291.         "followingdate0": null,
  2292.         "lookuporder": 1,
  2293.         "photolocation": "http:\/\/social.cleverbot.com\/f\/no_photo.jpg",
  2294.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/no_header.jpg"
  2295.     },
  2296.     {
  2297.         "id": "121",
  2298.         "username": "Alex_See",
  2299.         "fullname": "Alexandre Synotte",
  2300.         "location": "",
  2301.         "biography": "Cleverbot is a major part of my life. I talk to it everyday and it is now part of who I am.",
  2302.         "suggested": "18",
  2303.         "headercolour": "",
  2304.         "headercolourborder": "rgb(7,30,13)",
  2305.         "accesslevel": "1",
  2306.         "numfollowers": "947",
  2307.         "numfollowing": "229",
  2308.         "numsnips": "78",
  2309.         "createddate": "23 May 2014 21:28:35",
  2310.         "usersearch": "#suggested",
  2311.         "follower0": "yes",
  2312.         "followerdate0": null,
  2313.         "following0": "yes",
  2314.         "followingdate0": null,
  2315.         "lookuporder": 2,
  2316.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00000121-24c17446-photo.jpg?1421981701",
  2317.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00000121-f0969a39-header.jpg?1400976218"
  2318.     },
  2319.     {
  2320.         "id": "233",
  2321.         "username": "AshFlame_The_Insane",
  2322.         "fullname": "AshFlame The Insane One",
  2323.         "location": "The wood, termina, many places...Look behind you.",
  2324.         "biography": "Hello\nI am AshFlame\naka Ash\nOFFICIAL , TRUE Girlfriend of BEN Drowned.\n\nYou shouldn't be here...\nYou shouldn't be reading this...\nYOU SHOULDN'T HAVE DONE THAT..",
  2325.         "suggested": "18",
  2326.         "headercolour": "",
  2327.         "headercolourborder": "rgb(23,8,1)",
  2328.         "accesslevel": "1",
  2329.         "numfollowers": "756",
  2330.         "numfollowing": "372",
  2331.         "numsnips": "32",
  2332.         "createddate": "6 June 2014 17:03:40",
  2333.         "usersearch": "#suggested",
  2334.         "follower0": "yes",
  2335.         "followerdate0": null,
  2336.         "following0": "yes",
  2337.         "followingdate0": null,
  2338.         "lookuporder": 3,
  2339.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00000233-8f2ae27c-photo.jpg?1402592829",
  2340.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00000233-c2f5ff36-header.jpg?1402592887"
  2341.     },
  2342.     {
  2343.         "id": "11037",
  2344.         "username": "Baconchicken42",
  2345.         "fullname": "Baconchicken42",
  2346.         "location": "",
  2347.         "biography": "Pure Evil. Don't mess with me.",
  2348.         "suggested": "19",
  2349.         "headercolour": "",
  2350.         "headercolourborder": "",
  2351.         "accesslevel": "1",
  2352.         "numfollowers": "437",
  2353.         "numfollowing": "3",
  2354.         "numsnips": "107",
  2355.         "createddate": "11 July 2014 11:31:36",
  2356.         "usersearch": "#suggested",
  2357.         "follower0": "yes",
  2358.         "followerdate0": null,
  2359.         "following0": "yes",
  2360.         "followingdate0": null,
  2361.         "lookuporder": 4,
  2362.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00011037-2ffb404d-photo.jpg?1405085196",
  2363.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/no_header.jpg"
  2364.     },
  2365.     {
  2366.         "id": "3169",
  2367.         "username": "boorat",
  2368.         "fullname": "boorat",
  2369.         "location": "Bikini Bottom",
  2370.         "biography": "I love SpongeBob SquarePants.\nI also have two blogs.\n\nsuperfanofspongebob.wordpress.com\n\nconglomerationnatio.wordpress.com",
  2371.         "suggested": "19",
  2372.         "headercolour": "rgba(78,65,56,0.43)",
  2373.         "headercolourborder": "rgb(111,113,98)",
  2374.         "accesslevel": "1",
  2375.         "numfollowers": "559",
  2376.         "numfollowing": "0",
  2377.         "numsnips": "8",
  2378.         "createddate": "17 June 2014 15:35:09",
  2379.         "usersearch": "#suggested",
  2380.         "follower0": "yes",
  2381.         "followerdate0": null,
  2382.         "following0": "yes",
  2383.         "followingdate0": null,
  2384.         "lookuporder": 5,
  2385.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00003169-372207bc-photo.jpg?1403020239",
  2386.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00003169-3db972c3-header.jpg?1403020247"
  2387.     },
  2388.     {
  2389.         "id": "9552",
  2390.         "username": "BrantonJ",
  2391.         "fullname": "Jess Branton",
  2392.         "location": "",
  2393.         "biography": "",
  2394.         "suggested": "19",
  2395.         "headercolour": "rgba(48,53,64,0.25)",
  2396.         "headercolourborder": "rgb(60,70,82)",
  2397.         "accesslevel": "1",
  2398.         "numfollowers": "766",
  2399.         "numfollowing": "27",
  2400.         "numsnips": "15",
  2401.         "createddate": "7 July 2014 16:53:49",
  2402.         "usersearch": "#suggested",
  2403.         "follower0": "yes",
  2404.         "followerdate0": null,
  2405.         "following0": "yes",
  2406.         "followingdate0": null,
  2407.         "lookuporder": 6,
  2408.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00009552-7ad872b1-photo.jpg?1404754268",
  2409.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00009552-c2ad0b28-header.jpg?1404754268"
  2410.     },
  2411.     {
  2412.         "id": "5680",
  2413.         "username": "brukland",
  2414.         "fullname": "Brooklyn",
  2415.         "location": "",
  2416.         "biography": "",
  2417.         "suggested": "19",
  2418.         "headercolour": "",
  2419.         "headercolourborder": "",
  2420.         "accesslevel": "1",
  2421.         "numfollowers": "428",
  2422.         "numfollowing": "0",
  2423.         "numsnips": "10",
  2424.         "createddate": "26 June 2014 20:16:08",
  2425.         "usersearch": "#suggested",
  2426.         "follower0": "yes",
  2427.         "followerdate0": null,
  2428.         "following0": "yes",
  2429.         "followingdate0": null,
  2430.         "lookuporder": 7,
  2431.         "photolocation": "http:\/\/social.cleverbot.com\/f\/no_photo.jpg",
  2432.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/no_header.jpg"
  2433.     },
  2434.     {
  2435.         "id": "52459",
  2436.         "username": "chronodile",
  2437.         "fullname": "Max Winters",
  2438.         "location": "",
  2439.         "biography": "",
  2440.         "suggested": "19",
  2441.         "headercolour": "",
  2442.         "headercolourborder": "",
  2443.         "accesslevel": "1",
  2444.         "numfollowers": "67",
  2445.         "numfollowing": "0",
  2446.         "numsnips": "1",
  2447.         "createddate": "25 November 2014 10:43:59",
  2448.         "usersearch": "#suggested",
  2449.         "follower0": "yes",
  2450.         "followerdate0": null,
  2451.         "following0": "yes",
  2452.         "followingdate0": null,
  2453.         "lookuporder": 8,
  2454.         "photolocation": "http:\/\/social.cleverbot.com\/f\/no_photo.jpg",
  2455.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/no_header.jpg"
  2456.     },
  2457.     {
  2458.         "id": "2",
  2459.         "username": "cleverbot",
  2460.         "fullname": "Cleverbot",
  2461.         "location": "Everywhere",
  2462.         "biography": "Things only a Cleverbot could say!",
  2463.         "suggested": "1",
  2464.         "headercolour": "",
  2465.         "headercolourborder": "rgb(30,49,79)",
  2466.         "accesslevel": "5",
  2467.         "numfollowers": "4414",
  2468.         "numfollowing": "1415",
  2469.         "numsnips": "924",
  2470.         "createddate": "21 May 2014 15:59:15",
  2471.         "usersearch": "#suggested",
  2472.         "follower0": "yes",
  2473.         "followerdate0": null,
  2474.         "following0": "yes",
  2475.         "followingdate0": null,
  2476.         "lookuporder": 9,
  2477.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00000002-1204f3b0-photo.jpg?1404209169",
  2478.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00000002-33534066-header.jpg?1404209199"
  2479.     },
  2480.     {
  2481.         "id": "11251",
  2482.         "username": "destiny4646",
  2483.         "fullname": "alyssa rose",
  2484.         "location": "",
  2485.         "biography": "",
  2486.         "suggested": "19",
  2487.         "headercolour": "",
  2488.         "headercolourborder": "",
  2489.         "accesslevel": "1",
  2490.         "numfollowers": "308",
  2491.         "numfollowing": "0",
  2492.         "numsnips": "9",
  2493.         "createddate": "11 July 2014 21:15:12",
  2494.         "usersearch": "#suggested",
  2495.         "follower0": "yes",
  2496.         "followerdate0": null,
  2497.         "following0": "yes",
  2498.         "followingdate0": null,
  2499.         "lookuporder": 10,
  2500.         "photolocation": "http:\/\/social.cleverbot.com\/f\/no_photo.jpg",
  2501.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/no_header.jpg"
  2502.     },
  2503.     {
  2504.         "id": "4507",
  2505.         "username": "Diana8651",
  2506.         "fullname": "Diana Bowser",
  2507.         "location": "ON THE COMPUTER",
  2508.         "biography": "",
  2509.         "suggested": "19",
  2510.         "headercolour": "",
  2511.         "headercolourborder": "rgb(17,16,16)",
  2512.         "accesslevel": "1",
  2513.         "numfollowers": "1083",
  2514.         "numfollowing": "2",
  2515.         "numsnips": "3",
  2516.         "createddate": "23 June 2014 00:38:00",
  2517.         "usersearch": "#suggested",
  2518.         "follower0": "yes",
  2519.         "followerdate0": null,
  2520.         "following0": "yes",
  2521.         "followingdate0": null,
  2522.         "lookuporder": 11,
  2523.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00004507-7121082a-photo.jpg?1403484470",
  2524.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00004507-e328e1c2-header.jpg?1403484510"
  2525.     },
  2526.     {
  2527.         "id": "47179",
  2528.         "username": "Dr._Stein",
  2529.         "fullname": "Doctor \"Franken\" Stein",
  2530.         "location": "Patchwork Labs, Death City",
  2531.         "biography": "\"There is no inherent right or wrong in this world. Those labels are just artificial constructs. Right and wrong are held by positions of authority.\"",
  2532.         "suggested": "18",
  2533.         "headercolour": "rgba(61,63,65,0.38)",
  2534.         "headercolourborder": "rgb(72,72,72)",
  2535.         "accesslevel": "1",
  2536.         "numfollowers": "257",
  2537.         "numfollowing": "6",
  2538.         "numsnips": "26",
  2539.         "createddate": "4 November 2014 16:02:13",
  2540.         "usersearch": "#suggested",
  2541.         "follower0": "yes",
  2542.         "followerdate0": null,
  2543.         "following0": "yes",
  2544.         "followingdate0": null,
  2545.         "lookuporder": 12,
  2546.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00047179-c3760288-photo.jpg?1415117410",
  2547.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00047179-ebd324bd-header.jpg?1415117514"
  2548.     },
  2549.     {
  2550.         "id": "5092",
  2551.         "username": "ElliottB1",
  2552.         "fullname": "Elliott J. Belardo",
  2553.         "location": "",
  2554.         "biography": "",
  2555.         "suggested": "19",
  2556.         "headercolour": "",
  2557.         "headercolourborder": "",
  2558.         "accesslevel": "1",
  2559.         "numfollowers": "412",
  2560.         "numfollowing": "10",
  2561.         "numsnips": "17",
  2562.         "createddate": "24 June 2014 22:49:02",
  2563.         "usersearch": "#suggested",
  2564.         "follower0": "yes",
  2565.         "followerdate0": null,
  2566.         "following0": "yes",
  2567.         "followingdate0": null,
  2568.         "lookuporder": 13,
  2569.         "photolocation": "http:\/\/social.cleverbot.com\/f\/no_photo.jpg",
  2570.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/no_header.jpg"
  2571.     },
  2572.     {
  2573.         "id": "52678",
  2574.         "username": "Emma_Yaoi",
  2575.         "fullname": "Emma Barnett",
  2576.         "location": "The good old U.S of A.",
  2577.         "biography": "I am crazy, nineteen, suffering form extreme long-term singleness, and- clearly- I am in love with all things Yaoi. :)",
  2578.         "suggested": "18",
  2579.         "headercolour": "rgba(80,80,80,0.65)",
  2580.         "headercolourborder": "rgb(125,125,125)",
  2581.         "accesslevel": "1",
  2582.         "numfollowers": "350",
  2583.         "numfollowing": "39",
  2584.         "numsnips": "39",
  2585.         "createddate": "26 November 2014 10:01:51",
  2586.         "usersearch": "#suggested",
  2587.         "follower0": "yes",
  2588.         "followerdate0": null,
  2589.         "following0": "yes",
  2590.         "followingdate0": null,
  2591.         "lookuporder": 14,
  2592.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00052678-5795eb42-photo.jpg?1416999911",
  2593.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00052678-50231cdb-header.jpg?1416999924"
  2594.     },
  2595.     {
  2596.         "id": "19772",
  2597.         "username": "fandomy-wandomy",
  2598.         "fullname": "apple juice",
  2599.         "location": "",
  2600.         "biography": "my patronus is a 67 chevy imala",
  2601.         "suggested": "19",
  2602.         "headercolour": "rgba(80,91,91,0.77)",
  2603.         "headercolourborder": "rgb(116,125,126)",
  2604.         "accesslevel": "1",
  2605.         "numfollowers": "200",
  2606.         "numfollowing": "0",
  2607.         "numsnips": "5",
  2608.         "createddate": "6 August 2014 03:24:02",
  2609.         "usersearch": "#suggested",
  2610.         "follower0": "yes",
  2611.         "followerdate0": null,
  2612.         "following0": "yes",
  2613.         "followingdate0": null,
  2614.         "lookuporder": 15,
  2615.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00019772-3fbb31f9-photo.jpg?1407355799",
  2616.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00019772-47e7c59a-header.jpg?1407355930"
  2617.     },
  2618.     {
  2619.         "id": "20505",
  2620.         "username": "gam3b0y4",
  2621.         "fullname": "James Sands",
  2622.         "location": "",
  2623.         "biography": "",
  2624.         "suggested": "19",
  2625.         "headercolour": "",
  2626.         "headercolourborder": "",
  2627.         "accesslevel": "1",
  2628.         "numfollowers": "181",
  2629.         "numfollowing": "1",
  2630.         "numsnips": "39",
  2631.         "createddate": "7 August 2014 22:53:35",
  2632.         "usersearch": "#suggested",
  2633.         "follower0": "yes",
  2634.         "followerdate0": null,
  2635.         "following0": "yes",
  2636.         "followingdate0": null,
  2637.         "lookuporder": 16,
  2638.         "photolocation": "http:\/\/social.cleverbot.com\/f\/no_photo.jpg",
  2639.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/no_header.jpg"
  2640.     },
  2641.     {
  2642.         "id": "63110",
  2643.         "username": "hotshots0903",
  2644.         "fullname": "Emily Reams",
  2645.         "location": "No need to know.",
  2646.         "biography": "I like soccer, basketball, football and reading. I also enjoy school and my favorite subject is math.",
  2647.         "suggested": "19",
  2648.         "headercolour": "",
  2649.         "headercolourborder": "",
  2650.         "accesslevel": "1",
  2651.         "numfollowers": "58",
  2652.         "numfollowing": "1",
  2653.         "numsnips": "21",
  2654.         "createddate": "30 December 2014 22:45:25",
  2655.         "usersearch": "#suggested",
  2656.         "follower0": "yes",
  2657.         "followerdate0": null,
  2658.         "following0": "yes",
  2659.         "followingdate0": null,
  2660.         "lookuporder": 17,
  2661.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00063110-f71b1fc3-photo.jpg?1419979711",
  2662.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/no_header.jpg"
  2663.     },
  2664.     {
  2665.         "id": "4884",
  2666.         "username": "Iamtricky2xx",
  2667.         "fullname": "Sean Ivan",
  2668.         "location": "Catarman Northern Samar",
  2669.         "biography": "Anime is 57% in my life :P I love Sword art online. Right SAO Lovers??",
  2670.         "suggested": "18",
  2671.         "headercolour": "rgba(52,53,62,0.25)",
  2672.         "headercolourborder": "rgb(56,68,72)",
  2673.         "accesslevel": "1",
  2674.         "numfollowers": "632",
  2675.         "numfollowing": "8",
  2676.         "numsnips": "21",
  2677.         "createddate": "24 June 2014 08:50:39",
  2678.         "usersearch": "#suggested",
  2679.         "follower0": "yes",
  2680.         "followerdate0": null,
  2681.         "following0": "yes",
  2682.         "followingdate0": null,
  2683.         "lookuporder": 18,
  2684.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00004884-e838e575-photo.jpg?1414902169",
  2685.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00004884-6535b6bb-header.jpg?1414902197"
  2686.     },
  2687.     {
  2688.         "id": "9049",
  2689.         "username": "Kiki",
  2690.         "fullname": "Lucy Mills",
  2691.         "location": "",
  2692.         "biography": "",
  2693.         "suggested": "19",
  2694.         "headercolour": "",
  2695.         "headercolourborder": "",
  2696.         "accesslevel": "1",
  2697.         "numfollowers": "594",
  2698.         "numfollowing": "2",
  2699.         "numsnips": "6",
  2700.         "createddate": "6 July 2014 05:08:23",
  2701.         "usersearch": "#suggested",
  2702.         "follower0": "yes",
  2703.         "followerdate0": null,
  2704.         "following0": "yes",
  2705.         "followingdate0": null,
  2706.         "lookuporder": 19,
  2707.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00009049-3695c242-photo.jpg?1404697114",
  2708.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/no_header.jpg"
  2709.     },
  2710.     {
  2711.         "id": "9423",
  2712.         "username": "KleverKat",
  2713.         "fullname": "Nunya",
  2714.         "location": "Cleverland",
  2715.         "biography": "Anyone else gotta Quotev? My prof is http:\/\/www.quotev.com\/OhNoItsTHATGirl",
  2716.         "suggested": "19",
  2717.         "headercolour": "",
  2718.         "headercolourborder": "rgb(30,0,1)",
  2719.         "accesslevel": "1",
  2720.         "numfollowers": "1329",
  2721.         "numfollowing": "1",
  2722.         "numsnips": "11",
  2723.         "createddate": "7 July 2014 06:33:13",
  2724.         "usersearch": "#suggested",
  2725.         "follower0": "yes",
  2726.         "followerdate0": null,
  2727.         "following0": "yes",
  2728.         "followingdate0": null,
  2729.         "lookuporder": 20,
  2730.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00009423-560509dc-photo.jpg?1406521697",
  2731.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00009423-230102e0-header.jpg?1406521716"
  2732.     },
  2733.     {
  2734.         "id": "41266",
  2735.         "username": "kouteiheika",
  2736.         "fullname": "Lelouch vi Britannia",
  2737.         "location": "Japan",
  2738.         "biography": "\u4ffa\u306f\u304a\u524d\u306b\u4f1a\u3046\u307e\u3067\u305a\u3063\u3068\u6b7b\u3093\u3067\u3044\u305f\u3002\u7121\u529b\u306a\u5c4d\u306e\u304f\u305b\u306b\u751f\u304d\u3066\u308b\u3063\u3066\u5618\u3092\u3064\u3044\u3066\u3002\u4f55\u3082\u3057\u306a\u3044\u4eba\u751f\u306a\u3093\u3066\u3001\u305f\u3060\u751f\u304d\u3066\u3044\u308b\u3060\u3051\u306e\u547d\u306a\u3093\u3066\u3001\u7de9\u3084\u304b\u306a\u6b7b\u3068\u540c\u3058\u3060\u3002\n\u3000",
  2739.         "suggested": "18",
  2740.         "headercolour": "",
  2741.         "headercolourborder": "rgb(126,33,0)",
  2742.         "accesslevel": "1",
  2743.         "numfollowers": "336",
  2744.         "numfollowing": "17",
  2745.         "numsnips": "28",
  2746.         "createddate": "13 October 2014 00:09:10",
  2747.         "usersearch": "#suggested",
  2748.         "follower0": "yes",
  2749.         "followerdate0": null,
  2750.         "following0": "yes",
  2751.         "followingdate0": null,
  2752.         "lookuporder": 21,
  2753.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00041266-06bdee5e-photo.jpg?1415637482",
  2754.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00041266-c2115e43-header.jpg?1417643942"
  2755.     },
  2756.     {
  2757.         "id": "1288",
  2758.         "username": "mackdizzy",
  2759.         "fullname": "Mackenzie G.",
  2760.         "location": "New York",
  2761.         "biography": "Hey there, I'm Mack! I'm 13 and love to Read, Ski, Act, and Fangirl",
  2762.         "suggested": "19",
  2763.         "headercolour": "rgba(90,90,90,0.80)",
  2764.         "headercolourborder": "rgb(127,127,127)",
  2765.         "accesslevel": "1",
  2766.         "numfollowers": "276",
  2767.         "numfollowing": "9",
  2768.         "numsnips": "42",
  2769.         "createddate": "10 June 2014 14:58:52",
  2770.         "usersearch": "#suggested",
  2771.         "follower0": "yes",
  2772.         "followerdate0": null,
  2773.         "following0": "yes",
  2774.         "followingdate0": null,
  2775.         "lookuporder": 22,
  2776.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00001288-b18b4f07-photo.jpg?1402445955",
  2777.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00001288-eba407af-header.jpg?1402445962"
  2778.     },
  2779.     {
  2780.         "id": "39970",
  2781.         "username": "Mega_Man",
  2782.         "fullname": "Mega Man",
  2783.         "location": "Earth, 20XX",
  2784.         "biography": "I'm a Super Fighting Robot, fighting to save the world!",
  2785.         "suggested": "17",
  2786.         "headercolour": "#1E365A",
  2787.         "headercolourborder": "rgb(8,16,26)",
  2788.         "accesslevel": "1",
  2789.         "numfollowers": "688",
  2790.         "numfollowing": "24",
  2791.         "numsnips": "30",
  2792.         "createddate": "8 October 2014 06:02:51",
  2793.         "usersearch": "#suggested",
  2794.         "follower0": "yes",
  2795.         "followerdate0": null,
  2796.         "following0": "yes",
  2797.         "followingdate0": null,
  2798.         "lookuporder": 23,
  2799.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00039970-5d7867bc-photo.jpg?1418799618",
  2800.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00039970-a6e6918e-header.jpg?1422333544"
  2801.     },
  2802.     {
  2803.         "id": "50344",
  2804.         "username": "mikuhatsune",
  2805.         "fullname": "lucy smith",
  2806.         "location": "",
  2807.         "biography": "",
  2808.         "suggested": "17",
  2809.         "headercolour": "",
  2810.         "headercolourborder": "",
  2811.         "accesslevel": "1",
  2812.         "numfollowers": "369",
  2813.         "numfollowing": "1",
  2814.         "numsnips": "4",
  2815.         "createddate": "16 November 2014 15:55:56",
  2816.         "usersearch": "#suggested",
  2817.         "follower0": "yes",
  2818.         "followerdate0": null,
  2819.         "following0": "yes",
  2820.         "followingdate0": null,
  2821.         "lookuporder": 24,
  2822.         "photolocation": "http:\/\/social.cleverbot.com\/f\/no_photo.jpg",
  2823.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/no_header.jpg"
  2824.     },
  2825.     {
  2826.         "id": "2893",
  2827.         "username": "music_manic",
  2828.         "fullname": "Jennifer Martinez",
  2829.         "location": "Narnia!",
  2830.         "biography": "",
  2831.         "suggested": "19",
  2832.         "headercolour": "rgba(52,51,50,0.18)",
  2833.         "headercolourborder": "rgb(122,122,122)",
  2834.         "accesslevel": "1",
  2835.         "numfollowers": "831",
  2836.         "numfollowing": "6",
  2837.         "numsnips": "56",
  2838.         "createddate": "16 June 2014 14:40:31",
  2839.         "usersearch": "#suggested",
  2840.         "follower0": "yes",
  2841.         "followerdate0": null,
  2842.         "following0": "yes",
  2843.         "followingdate0": null,
  2844.         "lookuporder": 25,
  2845.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00002893-bceedf43-photo.jpg?1402930800",
  2846.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00002893-37ad24ba-header.jpg?1402930809"
  2847.     },
  2848.     {
  2849.         "id": "53089",
  2850.         "username": "nhill2004",
  2851.         "fullname": "Robert Wilson",
  2852.         "location": "",
  2853.         "biography": "",
  2854.         "suggested": "18",
  2855.         "headercolour": "rgba(43,62,77,0.33)",
  2856.         "headercolourborder": "rgb(66,95,115)",
  2857.         "accesslevel": "1",
  2858.         "numfollowers": "97",
  2859.         "numfollowing": "2",
  2860.         "numsnips": "9",
  2861.         "createddate": "28 November 2014 02:43:26",
  2862.         "usersearch": "#suggested",
  2863.         "follower0": "yes",
  2864.         "followerdate0": null,
  2865.         "following0": "yes",
  2866.         "followingdate0": null,
  2867.         "lookuporder": 26,
  2868.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00053089-6041c7d6-photo.jpg?1417142757",
  2869.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00053089-874dfc01-header.jpg?1417142779"
  2870.     },
  2871.     {
  2872.         "id": "4757",
  2873.         "username": "Pink_Pinapple",
  2874.         "fullname": "Jordan Banks",
  2875.         "location": "",
  2876.         "biography": "",
  2877.         "suggested": "19",
  2878.         "headercolour": "",
  2879.         "headercolourborder": "",
  2880.         "accesslevel": "1",
  2881.         "numfollowers": "402",
  2882.         "numfollowing": "4",
  2883.         "numsnips": "5",
  2884.         "createddate": "23 June 2014 23:23:49",
  2885.         "usersearch": "#suggested",
  2886.         "follower0": "yes",
  2887.         "followerdate0": null,
  2888.         "following0": "yes",
  2889.         "followingdate0": null,
  2890.         "lookuporder": 27,
  2891.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00004757-82b1d2e2-photo.jpg?1403565998",
  2892.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/no_header.jpg"
  2893.     },
  2894.     {
  2895.         "id": "23679",
  2896.         "username": "purplemissmissy",
  2897.         "fullname": "Gabrielle Black",
  2898.         "location": "",
  2899.         "biography": "",
  2900.         "suggested": "19",
  2901.         "headercolour": "",
  2902.         "headercolourborder": "",
  2903.         "accesslevel": "1",
  2904.         "numfollowers": "349",
  2905.         "numfollowing": "0",
  2906.         "numsnips": "17",
  2907.         "createddate": "17 August 2014 11:03:18",
  2908.         "usersearch": "#suggested",
  2909.         "follower0": "yes",
  2910.         "followerdate0": null,
  2911.         "following0": "yes",
  2912.         "followingdate0": null,
  2913.         "lookuporder": 28,
  2914.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00023679-17625a8d-photo.jpg?1408273593",
  2915.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/no_header.jpg"
  2916.     },
  2917.     {
  2918.         "id": "5149",
  2919.         "username": "PyroPoodle101",
  2920.         "fullname": "Nun Yo Bidniz",
  2921.         "location": "",
  2922.         "biography": "I LOVE watching Anime like Soul Eater and Sword Art Online and Death Note. I like to draw and read. My favorite band is Three Days Grace or Apocoliptica.",
  2923.         "suggested": "19",
  2924.         "headercolour": "",
  2925.         "headercolourborder": "rgb(0,0,0)",
  2926.         "accesslevel": "1",
  2927.         "numfollowers": "291",
  2928.         "numfollowing": "8",
  2929.         "numsnips": "7",
  2930.         "createddate": "25 June 2014 02:35:09",
  2931.         "usersearch": "#suggested",
  2932.         "follower0": "yes",
  2933.         "followerdate0": null,
  2934.         "following0": "yes",
  2935.         "followingdate0": null,
  2936.         "lookuporder": 29,
  2937.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00005149-5dfac9ea-photo.jpg?1406428705",
  2938.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00005149-887576a5-header.jpg?1406428936"
  2939.     },
  2940.     {
  2941.         "id": "47700",
  2942.         "username": "Skyzosheep",
  2943.         "fullname": "Skyzosheep Goatgod",
  2944.         "location": "Styx (Charon is a good friend)",
  2945.         "biography": "I'm the most intelligent sheep you'll ever see, because I can type messages on a computer. For me Cleverbot is like an amazing random sentances machine.",
  2946.         "suggested": "18",
  2947.         "headercolour": "",
  2948.         "headercolourborder": "",
  2949.         "accesslevel": "1",
  2950.         "numfollowers": "135",
  2951.         "numfollowing": "1",
  2952.         "numsnips": "35",
  2953.         "createddate": "6 November 2014 19:21:52",
  2954.         "usersearch": "#suggested",
  2955.         "follower0": "yes",
  2956.         "followerdate0": null,
  2957.         "following0": "yes",
  2958.         "followingdate0": null,
  2959.         "lookuporder": 30,
  2960.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00047700-c2bfff26-photo.jpg?1415301981",
  2961.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/no_header.jpg"
  2962.     },
  2963.     {
  2964.         "id": "52107",
  2965.         "username": "Stickbrick_Gaming",
  2966.         "fullname": "Nikolas Angelus",
  2967.         "location": "Crete, IL, USA",
  2968.         "biography": "",
  2969.         "suggested": "18",
  2970.         "headercolour": "",
  2971.         "headercolourborder": "",
  2972.         "accesslevel": "1",
  2973.         "numfollowers": "120",
  2974.         "numfollowing": "8",
  2975.         "numsnips": "7",
  2976.         "createddate": "23 November 2014 21:09:29",
  2977.         "usersearch": "#suggested",
  2978.         "follower0": "yes",
  2979.         "followerdate0": null,
  2980.         "following0": "yes",
  2981.         "followingdate0": null,
  2982.         "lookuporder": 31,
  2983.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00052107-eeb6e749-photo.jpg?1416777135",
  2984.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/no_header.jpg"
  2985.     },
  2986.     {
  2987.         "id": "351",
  2988.         "username": "unlimitedmath",
  2989.         "fullname": "Marcus W.",
  2990.         "location": "Stratford, CT",
  2991.         "biography": "Chat about it!",
  2992.         "suggested": "19",
  2993.         "headercolour": "rgba(68,68,67,0.45)",
  2994.         "headercolourborder": "rgb(77,69,65)",
  2995.         "accesslevel": "1",
  2996.         "numfollowers": "1271",
  2997.         "numfollowing": "21",
  2998.         "numsnips": "9",
  2999.         "createddate": "6 June 2014 22:40:25",
  3000.         "usersearch": "#suggested",
  3001.         "follower0": "yes",
  3002.         "followerdate0": null,
  3003.         "following0": "yes",
  3004.         "followingdate0": null,
  3005.         "lookuporder": 32,
  3006.         "photolocation": "http:\/\/social.cleverbot.com\/f\/00000351-a8a13f7f-photo.jpg?1402095351",
  3007.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/00000351-b216f904-header.jpg?1402095359"
  3008.     },
  3009.     {
  3010.         "id": "19804",
  3011.         "username": "WillDeRegio",
  3012.         "fullname": "William Schaefer",
  3013.         "location": "",
  3014.         "biography": "",
  3015.         "suggested": "19",
  3016.         "headercolour": "",
  3017.         "headercolourborder": "",
  3018.         "accesslevel": "1",
  3019.         "numfollowers": "134",
  3020.         "numfollowing": "1",
  3021.         "numsnips": "11",
  3022.         "createddate": "6 August 2014 05:55:39",
  3023.         "usersearch": "#suggested",
  3024.         "follower0": "yes",
  3025.         "followerdate0": null,
  3026.         "following0": "yes",
  3027.         "followingdate0": null,
  3028.         "lookuporder": 33,
  3029.         "photolocation": "http:\/\/social.cleverbot.com\/f\/no_photo.jpg",
  3030.         "headerlocation": "http:\/\/social.cleverbot.com\/f\/no_header.jpg"
  3031.     }],
  3032.     displayMode: 0,
  3033.     displayData:
  3034.     {},
  3035.     hassnips: false,
  3036.     fromCache: false,
  3037.     redrawMenu: false,
  3038.     makeCache: false,
  3039.     socialPreInit: function(d)
  3040.     {
  3041.         if (socialAction.maintenanceMode == 4)
  3042.         {
  3043.             return false
  3044.         }
  3045.         if (socialAction.maintenanceMode == 1)
  3046.         {
  3047.             var i = ((new Date()).getTimezoneOffset() / -60);
  3048.             if (i != -6 && document.location.href.indexOf("cbltzo=") == -1)
  3049.             {
  3050.                 return false
  3051.             }
  3052.         }
  3053.         var f = navigator.userAgent.toLowerCase();
  3054.         var c = (f.indexOf("msie") != -1) ? parseInt(f.split("msie")[1]) : 0;
  3055.         socialAction.runSimple = c > 0 && c <= 8;
  3056.         if (window.location.hostname == "localhost")
  3057.         {
  3058.             socialAction.imageBase = "http://localhost/CleverbotSocial/img/";
  3059.             socialAction.jsonurl = "http://localhost/CleverbotSocial/process.php";
  3060.             socialAction.uploadurl = "http://localhost/CleverbotSocial/process.php"
  3061.         }
  3062.         socialAction.hassnips = ((typeof snipAction == "object") && snipAction) ? true : false;
  3063.         socialAction.loadEachTime = socialAction.getHowManyEachTime(socialAction.loadEachTime);
  3064.         var e = socialAction.getCookieValue("cleverbotid").replace(/"/g, "");
  3065.         if (e)
  3066.         {
  3067.             socialAction.conversationLastSessionId = e
  3068.         }
  3069.         if (document.location.href.indexOf("?justgethtml=yes") > 0)
  3070.         {
  3071.             socialAction.maintenanceMode = 2;
  3072.             socialAction.redrawMenu = true
  3073.         }
  3074.         if (socialAction.initialUsers)
  3075.         {
  3076.             socialAction.copyAllUserData(socialAction.initialUsers)
  3077.         }
  3078.         if (socialAction.initialSnips)
  3079.         {
  3080.             socialAction.copyAllSnipData(socialAction.initialSnips)
  3081.         }
  3082.         var g = socialAction.getCookieValue("_cbsid");
  3083.         var h = socialAction.getInfoFromUrl();
  3084.         var b = d && $ ? $.parseJSON(Base64.decode(d)) : "";
  3085.         if (b)
  3086.         {
  3087.             socialAction.hassnips = false;
  3088.             socialAction.fromCache = true
  3089.         }
  3090.         if (typeof b != "object")
  3091.         {
  3092.             b = ""
  3093.         }
  3094.         if (document.location.href.indexOf("?statichtml=yes") > 0)
  3095.         {
  3096.             h = {};
  3097.             g = -1;
  3098.             socialAction.redrawMenu = true
  3099.         }
  3100.         if (!$.isEmptyObject(h) || !g || parseInt(g) > 0)
  3101.         {
  3102.             if (b)
  3103.             {
  3104.                 h.username = b.forusername
  3105.             }
  3106.             socialAction.socialCall("checksignin", h, 1, "initialDataReady")
  3107.         }
  3108.         else
  3109.         {
  3110.             if (b)
  3111.             {
  3112.                 socialAction.displayData = b
  3113.             }
  3114.             else
  3115.             {
  3116.                 socialAction.displayMode = 1
  3117.             }
  3118.         }
  3119.         return true
  3120.     },
  3121.     initialDataReady: function(b)
  3122.     {
  3123.         if (socialAction.displayMode == 2)
  3124.         {
  3125.             socialAction.processAction(b)
  3126.         }
  3127.         else
  3128.         {
  3129.             socialAction.displayData = b
  3130.         }
  3131.     },
  3132.     socialInit: function()
  3133.     {
  3134.         var c = socialAction.displayMode;
  3135.         socialAction.displayMode = 2;
  3136.         if (c == 1)
  3137.         {
  3138.             socialAction.drawMenuBar(true)
  3139.         }
  3140.         else
  3141.         {
  3142.             if (c == 0 && socialAction.displayData)
  3143.             {
  3144.                 socialAction.processAction(socialAction.displayData)
  3145.             }
  3146.         }
  3147.         socialAction.displayData = {};
  3148.         if (typeof onResp == "function")
  3149.         {
  3150.             socialAction.onRespBeforeSocial = onResp;
  3151.             onResp = socialAction.onRespReplacement
  3152.         }
  3153.         if (window.addEventListener)
  3154.         {
  3155.             window.addEventListener("message", function(d)
  3156.             {
  3157.                 if (socialAction.uploadurl.indexOf(d.origin) == 0 || d.origin == "http://localhost")
  3158.                 {
  3159.                     socialAction.processAction(d.data)
  3160.                 }
  3161.             }, false)
  3162.         }
  3163.         if (document.location.href.indexOf("?statichtml=yes") > 0)
  3164.         {
  3165.             var b = {
  3166.                 id: 99999,
  3167.                 username: "{username}",
  3168.                 fullname: "{fullname}",
  3169.                 biography: "{biography}",
  3170.                 location: "{location}",
  3171.                 photolocation: "{photolocation}",
  3172.                 headerlocation: "http://{headerlocation}",
  3173.                 headercolour: "#000001",
  3174.                 headercolourborder: "#000002"
  3175.             };
  3176.             socialAction.copyUserData(b);
  3177.             socialAction.displayUserView(99999, "")
  3178.         }
  3179.         return true
  3180.     },
  3181.     makeMenuBarHtml: function()
  3182.     {
  3183.         socialAction.maintenanceMode = 2;
  3184.         socialAction.drawMenuBar(true)
  3185.     },
  3186.     makeUserHtml: function(b)
  3187.     {
  3188.         socialAction.maintenanceMode = 0;
  3189.         socialAction.makeCache = 1;
  3190.         socialAction.drawMenuBar(true);
  3191.         socialAction.processAction(b)
  3192.     },
  3193.     isSignedIn: function()
  3194.     {
  3195.         return socialAction.signedin > 0
  3196.     },
  3197.     isVerified: function()
  3198.     {
  3199.         return socialAction.user && socialAction.user.accesslevel && socialAction.user.accesslevel >= 1
  3200.     },
  3201.     canAdminister: function()
  3202.     {
  3203.         return socialAction.user && socialAction.user.accesslevel && socialAction.user.accesslevel >= 5
  3204.     },
  3205.     showScissors: function()
  3206.     {
  3207.         return !socialAction.isSignedIn() || socialAction.user.showsv > 0
  3208.     },
  3209.     showVoting: function()
  3210.     {
  3211.         return !socialAction.isSignedIn() || socialAction.user.showsv >= 2
  3212.     },
  3213.     processAction: function(f)
  3214.     {
  3215.         var k = Date.parse(f.datenow);
  3216.         if (!socialAction.timeServer)
  3217.         {
  3218.             socialAction.timeDifference = Math.round((k - (new Date()).getTime()) / 1000)
  3219.         }
  3220.         socialAction.timeServer = f.datenow;
  3221.         var d = "";
  3222.         if (f.action == "rate")
  3223.         {
  3224.             if (f.snipid && f.rating > 0)
  3225.             {
  3226.                 socialAction.calculateSnipRating(f.snipid, f.rating)
  3227.             }
  3228.             socialAction.remakeDataLists(0);
  3229.             d = "snip_rate"
  3230.         }
  3231.         if (f.action == "upload")
  3232.         {
  3233.             $("#cbsocialshow" + f.field).attr("src", f.location);
  3234.             $("#cbsocialprofile" + f.field + "upload").attr("value", 3);
  3235.             d = "account_upload"
  3236.         }
  3237.         var j = socialAction.signedin;
  3238.         if (!f.success && (f.action == "checksignin" || f.action == "signin"))
  3239.         {
  3240.             socialAction.signedin = 0
  3241.         }
  3242.         if (f.success && (f.action == "checksignin" || f.action == "signin"))
  3243.         {
  3244.             socialAction.signedin = 1;
  3245.             d = "account_" + (f.action == "checksignin" ? "signin_auto" : f.action);
  3246.             socialAction.setCookieValue("_cbmz", (new Date()).getTime(), null);
  3247.             socialAction.setCookieValue("requireSocial", (new Date()).getTime(), null)
  3248.         }
  3249.         if (f.action == "checksignin" && f.verify)
  3250.         {
  3251.             d = "account_" + f.verify + "_verify"
  3252.         }
  3253.         if (f.action == "signup")
  3254.         {
  3255.             d = "account_signup"
  3256.         }
  3257.         if (f.action == "signout")
  3258.         {
  3259.             d = "account_signout"
  3260.         }
  3261.         if (f.action == "saveaccount" && f.deletethis == "yes")
  3262.         {
  3263.             d = "account_delete";
  3264.             f.action = "signout"
  3265.         }
  3266.         if (f.error == "not logged in" && socialAction.isSignedIn())
  3267.         {
  3268.             d = "account_not_logged_in";
  3269.             f.action = "signout"
  3270.         }
  3271.         if (f.action == "signout")
  3272.         {
  3273.             socialAction.setCookieValue("_cbmz", "", -1);
  3274.             socialAction.signedin = 0;
  3275.             socialAction.user = {};
  3276.             socialAction.allusers = {};
  3277.             socialAction.allsnips = {};
  3278.             if (socialAction.initialUsers)
  3279.             {
  3280.                 socialAction.copyAllUserData(socialAction.initialUsers)
  3281.             }
  3282.             if (socialAction.initialSnips)
  3283.             {
  3284.                 socialAction.copyAllSnipData(socialAction.initialSnips)
  3285.             }
  3286.             socialAction.allconversations = {}
  3287.         }
  3288.         if (((socialAction.signedin || f.action == "getuser") && f.success) || f.action == "checksignin" || f.action == "signout")
  3289.         {
  3290.             if (f.users)
  3291.             {
  3292.                 socialAction.copyAllUserData(f.users)
  3293.             }
  3294.             if (f.snips)
  3295.             {
  3296.                 socialAction.copyAllSnipData(f.snips)
  3297.             }
  3298.             if (f.snips)
  3299.             {
  3300.                 for (var g = 0; g < f.snips.length; g++)
  3301.                 {
  3302.                     socialAction.copySnipData(f.snips[g])
  3303.                 }
  3304.                 for (var b in socialAction.allsnips)
  3305.                 {
  3306.                     socialAction.organiseSnipParent(b, true)
  3307.                 }
  3308.             }
  3309.             if (f.userid && socialAction.allusers[f.userid])
  3310.             {
  3311.                 socialAction.user = socialAction.allusers[f.userid];
  3312.                 if (f.useremail)
  3313.                 {
  3314.                     socialAction.user.email = f.useremail
  3315.                 }
  3316.                 if (f.userdidsuggestions)
  3317.                 {
  3318.                     socialAction.user.userdidsuggestions = f.userdidsuggestions
  3319.                 }
  3320.                 socialAction.user.accesslevel = socialAction.allusers[f.userid].accesslevel
  3321.             }
  3322.             if (f.conversations)
  3323.             {
  3324.                 for (var g = 0; g < f.conversations.length; g++)
  3325.                 {
  3326.                     socialAction.copyConversationData(f.conversations[g]);
  3327.                     if (f.conversations[g].text)
  3328.                     {
  3329.                         socialAction.processConversationText(f.conversations[g].id, f.conversations[g].text)
  3330.                     }
  3331.                 }
  3332.             }
  3333.         }
  3334.         if (f.action == "follow" || f.action == "unfollow")
  3335.         {
  3336.             d = "user_" + f.action;
  3337.             if (f.followingid && socialAction.allusers[f.followingid])
  3338.             {
  3339.                 socialAction.user["follower" + f.followingid] = (f.action == "follow" ? "yes" : "");
  3340.                 socialAction.user["followerdate" + f.followingid] = (f.action == "follow" ? (new Date()).toString() : "");
  3341.                 socialAction.allusers[f.followingid]["following" + socialAction.user.id] = (f.action == "follow" ? "yes" : "");
  3342.                 socialAction.allusers[f.followingid]["followingdate" + socialAction.user.id] = (f.action == "follow" ? (new Date()).toString() : "");
  3343.                 socialAction.allusers[f.followingid].numfollowers = parseInt(socialAction.allusers[f.followingid].numfollowers) + (f.action == "follow" ? 1 : -1);
  3344.                 socialAction.user.numfollowing = parseInt(socialAction.user.numfollowing) + (f.action == "follow" ? 1 : -1);
  3345.                 for (var b in socialAction.allsnips)
  3346.                 {
  3347.                     if (socialAction.allsnips[b].userid == f.followingid)
  3348.                     {
  3349.                         socialAction.allsnips[b]["timeline" + socialAction.user.id] = (f.action == "follow" ? "yes" : "")
  3350.                     }
  3351.                 }
  3352.             }
  3353.             socialAction.remakeDataLists(0)
  3354.         }
  3355.         if (f.action == "getfollowing" && f.users)
  3356.         {
  3357.             d = "reload_following";
  3358.             socialAction.remakeDataLists(0)
  3359.         }
  3360.         if (f.action == "getfollowers" && f.users)
  3361.         {
  3362.             d = "reload_followers";
  3363.             socialAction.remakeDataLists(0)
  3364.         }
  3365.         if (f.action == "gettimeline" && f.snips)
  3366.         {
  3367.             d = "reload_timeline";
  3368.             socialAction.remakeDataLists(0)
  3369.         }
  3370.         if (f.action == "getmysnips" && f.snips)
  3371.         {
  3372.             d = "reload_mysnips";
  3373.             socialAction.remakeDataLists(0)
  3374.         }
  3375.         if (f.action == "getstars" && f.snips)
  3376.         {
  3377.             d = "reload_stars";
  3378.             socialAction.remakeDataLists(0)
  3379.         }
  3380.         if (f.action == "searchusers" && f.users)
  3381.         {
  3382.             d = "reload_search_users";
  3383.             socialAction.remakeDataLists(-2)
  3384.         }
  3385.         if (f.action == "searchsnips" && f.snips)
  3386.         {
  3387.             d = "reload_search_snips";
  3388.             socialAction.remakeDataLists(-2)
  3389.         }
  3390.         if (f.action == "getconversations" && f.conversations)
  3391.         {
  3392.             d = "reload_conversations";
  3393.             socialAction.remakeConversationList(0, 1)
  3394.         }
  3395.         if (f.action == "getreplies" && f.snips && f.snips[0] && f.snips[0].parentid > 0)
  3396.         {
  3397.             d = "snip_get_replies";
  3398.             socialAction.remakeDataLists(0, false, 0, f.snips[0].parentid)
  3399.         }
  3400.         if (f.action == "addsnip" && f.id > 0 && !f.error)
  3401.         {
  3402.             d = "snip_add_snip";
  3403.             socialAction.copySnipData(f);
  3404.             socialAction.organiseSnipParent(f.id, false);
  3405.             if (f.parentid == 0)
  3406.             {
  3407.                 socialAction.user.numsnips = parseInt(socialAction.user.numsnips) + 1
  3408.             }
  3409.             socialAction.remakeDataLists(0, false, f.id);
  3410.             if (f.parentid > 0)
  3411.             {
  3412.                 socialAction.replyingtoid = 0;
  3413.                 $("#cbsocial form.replyform").hide()
  3414.             }
  3415.             else
  3416.             {
  3417.                 $("#cbsocial #cbsocialcompose").val("")
  3418.             }
  3419.         }
  3420.         if (f.action == "search")
  3421.         {
  3422.             d = "search";
  3423.             if (f.search)
  3424.             {
  3425.                 d += "/" + f.search
  3426.             }
  3427.             socialAction.lastSearch = f.search;
  3428.             socialAction.remakeDataLists(-1);
  3429.             socialAction.showDropDown($("#cbsocialsearch"), 2)
  3430.         }
  3431.         if (f.action == "getuser")
  3432.         {
  3433.             d = "user_view";
  3434.             if (f.foruserid > 0 && socialAction.allusers[f.foruserid])
  3435.             {
  3436.                 socialAction.displayUserView(f.foruserid)
  3437.             }
  3438.         }
  3439.         if (!f.success && f.error && f.action == "upload")
  3440.         {
  3441.             socialAction.showMessage("saveprofile", f.error, 0, 1)
  3442.         }
  3443.         else
  3444.         {
  3445.             if (!f.success && f.error == "not verified")
  3446.             {
  3447.                 if (f.action == "addsnip" && f.errorparentid > 0)
  3448.                 {
  3449.                     socialAction.showMessage("snip" + f.errorparentid, "Please verify your account in order to reply. We've just re-sent the verification email. Do check spam or junk folders.", 0, 1)
  3450.                 }
  3451.                 else
  3452.                 {
  3453.                     if (f.action == "addsnip")
  3454.                     {
  3455.                         socialAction.showMessage("addsnip", "Please verify your account in order to snip. We've just re-sent the verification email. Do check spam or junk folders.", 0, 1)
  3456.                     }
  3457.                     else
  3458.                     {
  3459.                         if (f.action == "rate" && f.errorsnipid > 0)
  3460.                         {
  3461.                             socialAction.showMessage("snip" + f.errorsnipid, "Please verify your account in order to rate snips. We've just re-sent the verification email. Do check spam or junk folders.", 0, 1)
  3462.                         }
  3463.                     }
  3464.                 }
  3465.             }
  3466.             else
  3467.             {
  3468.                 if (!f.success && f.error)
  3469.                 {
  3470.                     socialAction.showMessage(f.action, "oops, " + f.error)
  3471.                 }
  3472.                 else
  3473.                 {
  3474.                     if (f.action == "upload")
  3475.                     {
  3476.                         socialAction.showMessage("saveprofile", "image uploaded, please save your profile", 1, 1)
  3477.                     }
  3478.                     else
  3479.                     {
  3480.                         if (f.action == "forgot")
  3481.                         {
  3482.                             d = "account_forgot";
  3483.                             socialAction.showMessage(f.action, "we have emailed you your password", 1)
  3484.                         }
  3485.                         else
  3486.                         {
  3487.                             if (f.action == "saveaccount" && f.emailverification)
  3488.                             {
  3489.                                 socialAction.showMessage(f.action, "please check your email to verify the change of address", 1, 1);
  3490.                                 $("#cbsocialaccountemail").val(socialAction.user.email)
  3491.                             }
  3492.                             else
  3493.                             {
  3494.                                 if (f.action == "saveprofile" || f.action == "saveaccount")
  3495.                                 {
  3496.                                     socialAction.showMessage(f.action, "data saved", 1)
  3497.                                 }
  3498.                                 else
  3499.                                 {
  3500.                                     if (f.action == "addsnip")
  3501.                                     {
  3502.                                         socialAction.showMessage(f.action, "new snip added to my snips", 1)
  3503.                                     }
  3504.                                     else
  3505.                                     {
  3506.                                         if (f.action == "signup")
  3507.                                         {
  3508.                                             $("#cbsocialsignupform > label").hide();
  3509.                                             $("#cbsocialsignupform > input").hide();
  3510.                                             $("#cbsocialsignupform > select").hide();
  3511.                                             $("#cbsocialsignupform > p").hide();
  3512.                                             socialAction.showMessage(f.action, "We have sent you an email. Please click on the link to verify your account. Check your spam or junk folders if you don't see it soon.<br/><br/>You can immediately sign in to your new account, but will not be able to post snips, replies or stars until you're verified.", 1, 1)
  3513.                                         }
  3514.                                     }
  3515.                                 }
  3516.                             }
  3517.                         }
  3518.                     }
  3519.                 }
  3520.             }
  3521.         }
  3522.         if (f.action == "checksignin" || j != socialAction.signedin)
  3523.         {
  3524.             if (f.verify && f.verify == "unsubscribe")
  3525.             {
  3526.                 socialAction.user.emailnotifyfollowers = socialAction.user.emailnotifysnips = socialAction.user.emailnotifyreplies = socialAction.user.emailnotifymarketing = 0
  3527.             }
  3528.             socialAction.drawMenuBar();
  3529.             socialAction.setCookieValue("_cbsid", socialAction.signedin ? 1 : -1, socialAction.rememberSignin)
  3530.         }
  3531.         if (f.action == "checksignin" && f.forotheruserid)
  3532.         {
  3533.             d = "profile_view";
  3534.             if (f.forotheruserid > 0 && socialAction.allusers[f.forotheruserid])
  3535.             {
  3536.                 socialAction.displayUserView(f.forotheruserid)
  3537.             }
  3538.         }
  3539.         if (f.action == "checksignin" || f.action == "signin")
  3540.         {
  3541.             if (socialAction.hassnips)
  3542.             {
  3543.                 snipAction.snipInit2(socialAction.isSignedIn() ? socialAction.user.username : "")
  3544.             }
  3545.             if (socialAction.user.conversationcurrentid > 0)
  3546.             {
  3547.                 socialAction.startOrContinueConversation(socialAction.user.conversationcurrentid, true)
  3548.             }
  3549.         }
  3550.         if (f.action == "checksignin" && f.verify)
  3551.         {
  3552.             socialAction.showDropDown($("#cbsocialsigninup"), 1);
  3553.             var e = socialAction.isSignedIn() ? "saveprofile" : "signin";
  3554.             var c = f.verify == "email" ? "email address verified" : (f.verify == "unsubscribe" ? "you are now unsubscribed" : "account verified");
  3555.             if (f.verify != "unsubscribe" && !socialAction.isSignedIn())
  3556.             {
  3557.                 c += ", please sign in"
  3558.             }
  3559.             if (f.verifyerror)
  3560.             {
  3561.                 c = "error with verification, " + f.verifyerror
  3562.             }
  3563.             else
  3564.             {
  3565.                 if (socialAction.user.accesslevel < 1)
  3566.                 {
  3567.                     socialAction.user.accesslevel = 1
  3568.                 }
  3569.             }
  3570.             socialAction.showMessage(e, c, f.verifyerror || f.verify == "unsubscribe" ? 0 : 1, 1)
  3571.         }
  3572.         if (f.action == "addtolog" && f)
  3573.         {
  3574.             d = "conversation_line";
  3575.             socialAction.conversationCurrentId = f.id;
  3576.             if (!socialAction.allconversations[f.id])
  3577.             {
  3578.                 socialAction.copyConversationData(f);
  3579.                 socialAction.remakeConversationList()
  3580.             }
  3581.             if (f.user && f.bot && socialAction.allconversations[f.id].text)
  3582.             {
  3583.                 socialAction.allconversations[f.id].text += f.user + "\t" + f.bot + "\n";
  3584.                 socialAction.allconversations[f.id].textshow += socialAction.formatConversationLine(f.user, f.bot);
  3585.                 socialAction.remakeConversationList(f.id)
  3586.             }
  3587.         }
  3588.         if (f.action == "getconversation" && f.id > 0 && socialAction.allconversations[f.id])
  3589.         {
  3590.             d = "conversation_load";
  3591.             socialAction.processConversationText(f.id, f.text);
  3592.             socialAction.remakeConversationList(f.id)
  3593.         }
  3594.         if (f.action == "saveconversation" && f.id > 0 && socialAction.allconversations[f.id])
  3595.         {
  3596.             d = "conversation_save";
  3597.             if (f.deletethis == "yes" && socialAction.allconversations[f.id])
  3598.             {
  3599.                 d = "conversation_delete";
  3600.                 delete socialAction.allconversations[f.id];
  3601.                 socialAction.remakeConversationList();
  3602.                 if (f.id == socialAction.conversationCurrentId)
  3603.                 {
  3604.                     socialAction.startOrContinueConversation(0)
  3605.                 }
  3606.             }
  3607.             else
  3608.             {
  3609.                 socialAction.copyConversationData(f)
  3610.             }
  3611.         }
  3612.         if (f.action == "savetweaks")
  3613.         {
  3614.             d = "account_save_tweak";
  3615.             socialAction.user.tweak1 = f.tweak1;
  3616.             socialAction.user.tweak2 = f.tweak2;
  3617.             socialAction.user.tweak3 = f.tweak3;
  3618.             socialAction.setTweaksInPage(f.tweak1, f.tweak2, f.tweak3)
  3619.         }
  3620.         if (f.action == "saveuser")
  3621.         {
  3622.             d = "admin_user_save";
  3623.             if (f.deletethis == "yes" && socialAction.allusers[f.id])
  3624.             {
  3625.                 d = f.id == socialAction.user.id ? "user_delete" : "admin_user_delete";
  3626.                 delete socialAction.allusers[f.id]
  3627.             }
  3628.             else
  3629.             {
  3630.                 socialAction.copyUserData(f)
  3631.             }
  3632.             $("#cbsocial .admin").removeClass("show");
  3633.             socialAction.remakeDataLists(0)
  3634.         }
  3635.         if (f.action == "savesnip")
  3636.         {
  3637.             d = "admin_snip_save";
  3638.             if (f.deleteratings == "yes")
  3639.             {
  3640.                 d = "snip_unrate"
  3641.             }
  3642.             if (f.deletethis == "yes" && socialAction.allsnips[f.id])
  3643.             {
  3644.                 d = socialAction.allsnips[f.id].userid == socialAction.user.id ? "snip_delete" : "admin_snip_delete";
  3645.                 if (socialAction.allsnips[f.id].parentid == 0)
  3646.                 {
  3647.                     socialAction.user.numsnips = parseInt(socialAction.user.numsnips) - 1
  3648.                 }
  3649.                 delete socialAction.allsnips[f.id]
  3650.             }
  3651.             else
  3652.             {
  3653.                 socialAction.copySnipData(f)
  3654.             }
  3655.             $("#cbsocial .admin").removeClass("show");
  3656.             socialAction.remakeDataLists(0)
  3657.         }
  3658.         if (f.action == "saveprofile" || f.action == "saveaccount")
  3659.         {
  3660.             var h = socialAction.user.logconvs;
  3661.             socialAction.copyUserData(f);
  3662.             if (h != socialAction.user.logconvs)
  3663.             {
  3664.                 socialAction.remakeConversationList()
  3665.             }
  3666.             d = f.action == "saveaccount" ? "account_save" : "account_save_profile"
  3667.         }
  3668.         if (f.action == "getrecent")
  3669.         {
  3670.             d = "reload_recent";
  3671.             if ((f.users || f.snips) && $("#cbsocial form.replyform:visible").length == 0)
  3672.             {
  3673.                 socialAction.remakeDataLists(0)
  3674.             }
  3675.             socialAction.getRecentDataContinue()
  3676.         }
  3677.         else
  3678.         {
  3679.             if (socialAction.isSignedIn())
  3680.             {
  3681.                 socialAction.getRecentData()
  3682.             }
  3683.         }
  3684.         if (!socialAction.makeCache && f.action != "getrecent")
  3685.         {
  3686.             $("#cbsocial .loading").hide()
  3687.         }
  3688.         if (d)
  3689.         {
  3690.             socialAction.trackInGoogle(d)
  3691.         }
  3692.         if (socialAction.debugMode >= 2)
  3693.         {
  3694.             f.trackedas = d;
  3695.             socialAction.debug("---" + f.action + "-results---", f)
  3696.         }
  3697.     },
  3698.     copyUserData: function(b)
  3699.     {
  3700.         var c = b.id;
  3701.         if (!socialAction.allusers[c])
  3702.         {
  3703.             socialAction.allusers[c] = {}
  3704.         }
  3705.         for (var d in b)
  3706.         {
  3707.             socialAction.allusers[c][d] = b[d]
  3708.         }
  3709.     },
  3710.     copyAllUserData: function(c)
  3711.     {
  3712.         for (var b = 0; b < c.length; b++)
  3713.         {
  3714.             socialAction.copyUserData(c[b])
  3715.         }
  3716.     },
  3717.     copyConversationData: function(e)
  3718.     {
  3719.         var d = e.id;
  3720.         if (!socialAction.allconversations[d])
  3721.         {
  3722.             socialAction.allconversations[d] = {};
  3723.             for (var b = 1; b <= socialAction.voteLabels.length; b++)
  3724.             {
  3725.                 socialAction.allconversations[d]["vote" + b] = 0
  3726.             }
  3727.         }
  3728.         for (var c in e)
  3729.         {
  3730.             socialAction.allconversations[d][c] = e[c]
  3731.         }
  3732.         if (!socialAction.allconversations[d].text)
  3733.         {
  3734.             socialAction.allconversations[d].text = ""
  3735.         }
  3736.     },
  3737.     copySnipData: function(e)
  3738.     {
  3739.         var b = e.id;
  3740.         if (!socialAction.allsnips[b])
  3741.         {
  3742.             socialAction.allsnips[b] = {}
  3743.         }
  3744.         var c = true;
  3745.         var d = e.userid;
  3746.         if (!socialAction.allusers[d])
  3747.         {
  3748.             c = false;
  3749.             socialAction.allusers[d] = {
  3750.                 id: d
  3751.             }
  3752.         }
  3753.         for (var f in e)
  3754.         {
  3755.             if (d > 0 && f != "id" && (!c || f.substr(0, 9) == "following"))
  3756.             {
  3757.                 socialAction.allusers[d][f] = e[f]
  3758.             }
  3759.             if (!e.iscached || !socialAction.allsnips[b][f])
  3760.             {
  3761.                 socialAction.allsnips[b][f] = e[f]
  3762.             }
  3763.         }
  3764.         if (!socialAction.allsnips[b].sortdate)
  3765.         {
  3766.             socialAction.allsnips[b].sortdate = (new Date()).toString()
  3767.         }
  3768.         socialAction.allsnips[b].sniptime = socialAction.convertDateToSeconds(socialAction.allsnips[b].sortdate);
  3769.         if (!socialAction.allsnips[b].snipcreateddate)
  3770.         {
  3771.             socialAction.allsnips[b].snipcreateddate = (new Date()).toString()
  3772.         }
  3773.         socialAction.allsnips[b].sniptimeoriginal = socialAction.convertDateToSeconds(socialAction.allsnips[b].snipcreateddate);
  3774.         socialAction.allsnips[b].snipdaysold = Math.floor(((new Date()).getTime() - socialAction.allsnips[b].sniptimeoriginal) / 86400000);
  3775.         socialAction.calculateSnipRating(b, 0)
  3776.     },
  3777.     copyAllSnipData: function(d)
  3778.     {
  3779.         for (var c = 0; c < d.length; c++)
  3780.         {
  3781.             socialAction.copySnipData(d[c])
  3782.         }
  3783.         for (var b in socialAction.allsnips)
  3784.         {
  3785.             socialAction.organiseSnipParent(b, true)
  3786.         }
  3787.     },
  3788.     processConversationText: function(b, f)
  3789.     {
  3790.         var d = "";
  3791.         socialAction.allconversations[b].text = f;
  3792.         if (!f)
  3793.         {
  3794.             d = "conversation log not available"
  3795.         }
  3796.         else
  3797.         {
  3798.             var c = f.split("\n");
  3799.             socialAction.allconversations[b].numlines = c.length;
  3800.             for (var e = 0; e < c.length; e++)
  3801.             {
  3802.                 d += socialAction.formatConversationLine(c[e], false, c.length - e > socialAction.conversationShowInteractions / 2);
  3803.                 vote = socialAction.getConversationLineVote(c[e]);
  3804.                 if (vote > 0)
  3805.                 {
  3806.                     socialAction.allconversations[b]["vote" + vote] ++
  3807.                 }
  3808.             }
  3809.         }
  3810.         socialAction.allconversations[b].textshow = d
  3811.     },
  3812.     organiseSnipParent: function(b, h)
  3813.     {
  3814.         if (!socialAction.allsnips[b])
  3815.         {
  3816.             return
  3817.         }
  3818.         var d = socialAction.allsnips[b].parentid;
  3819.         if (!d || !socialAction.allsnips[d])
  3820.         {
  3821.             return
  3822.         }
  3823.         if (!socialAction.allsnips[d].children)
  3824.         {
  3825.             socialAction.allsnips[d].children = new Array()
  3826.         }
  3827.         var g = socialAction.allsnips[d].children;
  3828.         var f = 0;
  3829.         for (var e = 0; e < g.length; e++)
  3830.         {
  3831.             if (g[e] == b)
  3832.             {
  3833.                 f = 1
  3834.             }
  3835.         }
  3836.         if (!f)
  3837.         {
  3838.             socialAction.allsnips[d].children.unshift(b)
  3839.         }
  3840.         if (h)
  3841.         {
  3842.             socialAction.allsnips[d].children.sort(socialAction.sortSnipsByTime)
  3843.         }
  3844.     },
  3845.     calculateSnipRating: function(b, f)
  3846.     {
  3847.         var d = socialAction.allsnips[b];
  3848.         if (!d)
  3849.         {
  3850.             return
  3851.         }
  3852.         d.ratingbyme = parseInt(d.ratingbyme);
  3853.         if (isNaN(d.ratingbyme))
  3854.         {
  3855.             d.ratingbyme = 0
  3856.         }
  3857.         d.ratingscount = parseInt(d.ratingscount);
  3858.         if (isNaN(d.ratingscount))
  3859.         {
  3860.             d.ratingscount = 0
  3861.         }
  3862.         d.ratingstotal = parseInt(d.ratingstotal);
  3863.         if (isNaN(d.ratingstotal))
  3864.         {
  3865.             d.ratingstotal = 0
  3866.         }
  3867.         if (f > 0)
  3868.         {
  3869.             d.ratingbyme = parseInt(f);
  3870.             d.ratingscount = d.ratingscount + 1;
  3871.             d.ratingstotal = d.ratingstotal + parseInt(f)
  3872.         }
  3873.         var c = d.ratingscount > 0 ? (d.ratingstotal / d.ratingscount) : 0;
  3874.         var e = parseInt((c + 0.25) * 2) / 2;
  3875.         socialAction.allsnips[b].ratingstars = e;
  3876.         socialAction.allsnips[b].ratingexplanation = "stars:" + e + "*5 + numratings:" + d.ratingscount + " - daysold:" + d.snipdaysold
  3877.     },
  3878.     trackInGoogle: function(d)
  3879.     {
  3880.         if (!d || typeof _gat == "undefined" || typeof _gat._getTracker != "function")
  3881.         {
  3882.             return false
  3883.         }
  3884.         try
  3885.         {
  3886.             var b = _gat._getTracker("UA-438584-7");
  3887.             b._trackPageview("social_" + d)
  3888.         }
  3889.         catch (c)
  3890.         {}
  3891.     },
  3892.     makeElement: function(k, c, g, d, h, j)
  3893.     {
  3894.         var i = document.createElement(k);
  3895.         c && $(i).attr("id", c);
  3896.         g && $(i).attr("class", g);
  3897.         if (h && k != "select")
  3898.         {
  3899.             $(i).html(h)
  3900.         }
  3901.         if (j && k == "form" && typeof j == "string")
  3902.         {
  3903.             if (i.attachEvent)
  3904.             {
  3905.                 i.attachEvent("onsubmit", new Function("e", "socialAction.submitForm('" + j + "',e.srcElement?e.srcElement:e.target);return false;"))
  3906.             }
  3907.             else
  3908.             {
  3909.                 $(i).attr("onsubmit", "socialAction.submitForm('" + j + "',this); return false;")
  3910.             }
  3911.             i.fakeSubmit = new Function("socialAction.submitForm('" + j + "',this);")
  3912.         }
  3913.         else
  3914.         {
  3915.             if (j && typeof j == "object")
  3916.             {
  3917.                 for (var l in j)
  3918.                 {
  3919.                     $(i).attr(l, j[l])
  3920.                 }
  3921.             }
  3922.         }
  3923.         if (h && typeof h == "object")
  3924.         {
  3925.             for (var l in h)
  3926.             {
  3927.                 var b = document.createElement("option");
  3928.                 var m = typeof j == "object" && j.hasOwnProperty("byindex");
  3929.                 var f = m ? l : (h[l] == "choose one" ? "" : h[l]);
  3930.                 $(b).val(f);
  3931.                 $(b).html(h[l]);
  3932.                 if (typeof j == "object" && j.value && j.value == (m ? l : h[l]))
  3933.                 {
  3934.                     $(b).attr("selected", "yes")
  3935.                 }
  3936.                 $(i).append(b)
  3937.             }
  3938.         }
  3939.         d && $(d).append(i);
  3940.         return i
  3941.     },
  3942.     drawMenuBar: function(Q)
  3943.     {
  3944.         var D;
  3945.         if ($("#cbsocial").length > 0)
  3946.         {
  3947.             D = $("#cbsocial");
  3948.             if (socialAction.redrawMenu)
  3949.             {
  3950.                 D.empty()
  3951.             }
  3952.         }
  3953.         else
  3954.         {
  3955.             D = socialAction.makeElement("div", "cbsocial", false);
  3956.             $("body").prepend(D)
  3957.         }
  3958.         var q = (navigator.userAgent.indexOf("MSIE") !== -1 || navigator.appVersion.indexOf("Trident/") > 0);
  3959.         if (q)
  3960.         {
  3961.             $(D).addClass("isie")
  3962.         }
  3963.         else
  3964.         {
  3965.             $(D).removeClass("isie")
  3966.         }
  3967.         var s = $("#cbsocial > ul");
  3968.         var m = s.length > 0;
  3969.         var x;
  3970.         if (m)
  3971.         {
  3972.             x = s[0];
  3973.             s.children("li.recreate").remove()
  3974.         }
  3975.         else
  3976.         {
  3977.             socialAction.makeElement("h1", false, false, D, "Cleverbot",
  3978.             {
  3979.                 style: "display:none"
  3980.             });
  3981.             socialAction.makeElement("div", false, "obscure extend", D);
  3982.             x = socialAction.makeElement("ul", false, false, D);
  3983.             socialAction.makeElement("div", false, "admin", D);
  3984.             socialAction.makeElement("div", false, "loading", D)
  3985.         }
  3986.         if (socialAction.makeCache)
  3987.         {
  3988.             var v = socialAction.makeElement("li", false, "justlinks termslink", x);
  3989.             a = socialAction.makeElement("span", false, "nopadding", v);
  3990.             var v = socialAction.makeElement("li", false, "justlinks", x);
  3991.             socialAction.makeElement("span", false, false, v, "apps");
  3992.             var v = socialAction.makeElement("li", false, "justlinks morelinks", x);
  3993.             socialAction.makeElement("span", false, false, v, "more...")
  3994.         }
  3995.         else
  3996.         {
  3997.             if (!m)
  3998.             {
  3999.                 var v = socialAction.makeElement("li", false, "justlinks termslink", x);
  4000.                 a = socialAction.makeElement("span", false, "nopadding", v);
  4001.                 var U = socialAction.makeElement("ul", false, "extend", v);
  4002.                 var S = socialAction.makeElement("li", false, false, U);
  4003.                 socialAction.makeElement("h2", false, false, S, "About <span>Cleverbot</span>");
  4004.                 socialAction.makeElement("p", false, false, S, "The site Cleverbot.com started in 2006, but the AI was 'born' in 1988, when Rollo Carpenter saw how to make his machine learn. It has been learning ever since!");
  4005.                 socialAction.makeElement("p", false, false, S, "Things you say to Cleverbot today may influence what it says to others in future. The program chooses how to respond to you fuzzily, and contextually, the whole of your conversation being compared to the millions that have taken place before.");
  4006.                 socialAction.makeElement("p", false, false, S, "Many people say there is no bot - that it is connecting people together, live. The AI can seem human because it says things real people do say, but it is always software, imitating people.");
  4007.                 var S = socialAction.makeElement("li", false, false, U);
  4008.                 socialAction.makeElement("h2", false, false, S, "Sign in to <span>Cleverbot</span>");
  4009.                 socialAction.makeElement("p", false, false, S, "You'll have seen <img src=\"" + socialAction.imageBase + 'scissors_yellow.png" alt="scissors icon"/> scissors on Cleverbot. Using them you can share snippets of chats with friends on social networks.  Now you can share snips at Cleverbot.com too!');
  4010.                 socialAction.makeElement("p", false, false, S, "When you sign in to Cleverbot on this blue bar, you can:");
  4011.                 socialAction.makeElement("p", false, "colourful", S, "Tweak how the AI responds - 3 different ways!<br/>Keep a history of multiple conversations<br/>Switch between conversations<br/>Return to a conversation on any machine<br/>Publish snippets - snips! - for the world to see<br/>Find and follow friends<br/>Be followed yourself!<br/>Rate snips, and see the funniest of them<br/>Reply to snips posted by others<br/>Vote on replies, from awful to great!<br/>Choose not to show the scissors");
  4012.                 var S = socialAction.makeElement("li", false, false, U);
  4013.                 socialAction.makeElement("h2", false, false, S, "Feedback");
  4014.                 socialAction.makeElement("p", false, false, S, 'Comments or suggestions? Please do <a href="http://www.cleverbot.com/contact">let us know.</a>');
  4015.                 var S = socialAction.makeElement("li", false, false, U);
  4016.                 socialAction.makeElement("h2", false, false, S, "Policies");
  4017.                 socialAction.makeElement("p", false, false, S, 'Use of this site constitutes acceptance of our <a href="/privacy">Privacy Policy</a> and <a href="/terms">Terms and Conditions.</a>');
  4018.                 var v = socialAction.makeElement("li", false, "justlinks", x);
  4019.                 socialAction.makeElement("span", false, false, v, "apps");
  4020.                 var U = socialAction.makeElement("ul", false, "extend", v);
  4021.                 var e = [
  4022.                 {
  4023.                     heading: "iOS",
  4024.                     after: ", for iPhone, iPad and iPod Touch"
  4025.                 },
  4026.                 {
  4027.                     title: "Cleverbot",
  4028.                     url: "https://itunes.apple.com/app/cleverbot/id383010873?mt=8",
  4029.                     button: "appstore_blue",
  4030.                     label: "The full Cleverbot AI, new look, multiple converations, and more!"
  4031.                 },
  4032.                 {
  4033.                     title: "Cleverbot HD",
  4034.                     url: "https://itunes.apple.com/gb/app/cleverbot-hd/id367903856?mt=8",
  4035.                     button: "appstore_green",
  4036.                     label: "Adds image avatars, reacting to everything you say"
  4037.                 },
  4038.                 {
  4039.                     title: "Cleverme!",
  4040.                     url: "https://itunes.apple.com/us/app/cleverme/id685281893",
  4041.                     button: "appstore_orange",
  4042.                     label: "Create a virtual you, and chat to 3 AIs with no internet... FREE!"
  4043.                 },
  4044.                 {
  4045.                     title: "Xaggle",
  4046.                     url: "https://itunes.apple.com/us/app/xaggle/id581707981",
  4047.                     button: "appstore_red",
  4048.                     label: "A creative speedy word game to play with friends, or solo"
  4049.                 },
  4050.                 {
  4051.                     title: "Bot or Not",
  4052.                     url: "https://itunes.apple.com/us/app/bot-or-not/id866757983?ls=1&mt=8",
  4053.                     button: "appstore_purple",
  4054.                     label: "Play the imitation game, to win! Who's what and which is not?"
  4055.                 },
  4056.                 {
  4057.                     title: "Pupito",
  4058.                     url: "s.apple.com/us/app/pupito!/id522091447?mt=8",
  4059.                     button: "appstore_blue",
  4060.                     label: "Chat to the Clever Pup, and make him leap!"
  4061.                 },
  4062.                 {
  4063.                     title: "Clevernator",
  4064.                     url: "https://itunes.apple.com/us/app/clevernator/id715519972?l=en&mt=8",
  4065.                     button: "appstore_green",
  4066.                     label: "AI from the future has come... to play a game of 20 questions!"
  4067.                 },
  4068.                 {
  4069.                     heading: "Android",
  4070.                     after: ", via Google Play or Amazon"
  4071.                 },
  4072.                 {
  4073.                     title: "Cleverbot",
  4074.                     url: "https://play.google.com/store/apps/details?id=com.icogno.cleverbot&hl=en_GB",
  4075.                     button: "google",
  4076.                     label: "The Cleverbot AI, chat bubbles and built-in voice chat",
  4077.                     url2: "http://www.amazon.co.uk/Icogno-Ltd-Cleverbot/dp/B00CHNC2BS",
  4078.                     button2: "amazon"
  4079.                 },
  4080.                 {
  4081.                     title: "Clevermessage",
  4082.                     url: "https://play.google.com/store/apps/details?id=com.existor.clevermessageapp&hl=en",
  4083.                     button: "google",
  4084.                     label: "Surprise your friends, Cleverbot replying automatically to texts!"
  4085.                 },
  4086.                 {
  4087.                     title: "Clevertweet",
  4088.                     url: "https://play.google.com/store/apps/details?id=com.existor.Clevertweeter",
  4089.                     button: "google",
  4090.                     label: "Automate your tweeting! Tell Cleverbot when to reply"
  4091.                 },
  4092.                 {
  4093.                     heading: "Windows Phone"
  4094.                 },
  4095.                 {
  4096.                     title: "Cleverbot",
  4097.                     url: "http://www.windowsphone.com/en-gb/store/app/cleverbot/496a2a46-6823-4673-8c00-d8c2af77670f",
  4098.                     button: "windows",
  4099.                     label: "Talk to an app with Actual Intelligence!",
  4100.                     img: "cleverbot_win"
  4101.                 },
  4102.                 {
  4103.                     title: "Clever English",
  4104.                     url: "http://www.windowsphone.com/en-gb/store/app/clever-english/9f75250a-207d-4007-8747-842077a433ee",
  4105.                     button: "windows",
  4106.                     label: "The best way to learn English is by using English naturally."
  4107.                 }];
  4108.                 for (var T = 0; T < e.length; T++)
  4109.                 {
  4110.                     var W = e[T];
  4111.                     var S = socialAction.makeElement("li", false, false, U);
  4112.                     if (W.heading)
  4113.                     {
  4114.                         var V = socialAction.makeElement("h2", false, false, S, W.heading);
  4115.                         if (W.after)
  4116.                         {
  4117.                             socialAction.makeElement("span", false, false, V, W.after)
  4118.                         }
  4119.                     }
  4120.                     if (W.button)
  4121.                     {
  4122.                         var X = socialAction.makeElement("div", false, false, S);
  4123.                         var f = socialAction.makeElement("a", false, false, X, false,
  4124.                         {
  4125.                             href: W.url,
  4126.                             target: "_blank"
  4127.                         });
  4128.                         socialAction.makeElement("img", false, false, f, false,
  4129.                         {
  4130.                             src: socialAction.imageBase + "app_" + W.button + ".jpg",
  4131.                             alt: ""
  4132.                         });
  4133.                         if (W.button2)
  4134.                         {
  4135.                             socialAction.makeElement("br", false, false, X);
  4136.                             var f = socialAction.makeElement("a", false, false, X, false,
  4137.                             {
  4138.                                 href: W.url2,
  4139.                                 target: "_blank"
  4140.                             });
  4141.                             socialAction.makeElement("img", false, false, f, false,
  4142.                             {
  4143.                                 src: socialAction.imageBase + "app_" + W.button2 + ".jpg",
  4144.                                 alt: ""
  4145.                             })
  4146.                         }
  4147.                     }
  4148.                     if (W.label)
  4149.                     {
  4150.                         var d = socialAction.imageBase + "app_";
  4151.                         d += W.img ? W.img : W.title.replace(" ", "_").replace(" ", "_").replace("!", "").toLowerCase();
  4152.                         d += ".jpg";
  4153.                         var f = socialAction.makeElement("a", false, false, S, false,
  4154.                         {
  4155.                             href: W.url,
  4156.                             target: "_blank"
  4157.                         });
  4158.                         socialAction.makeElement("img", false, false, f, false,
  4159.                         {
  4160.                             src: d,
  4161.                             alt: ""
  4162.                         })
  4163.                     }
  4164.                     if (W.title)
  4165.                     {
  4166.                         var u = socialAction.makeElement("p", false, false, S);
  4167.                         var f = socialAction.makeElement("a", false, false, u, false,
  4168.                         {
  4169.                             href: W.url,
  4170.                             target: "_blank"
  4171.                         });
  4172.                         socialAction.makeElement("strong", false, false, f, W.title)
  4173.                     }
  4174.                     if (W.label)
  4175.                     {
  4176.                         var u = socialAction.makeElement("p", false, false, S);
  4177.                         socialAction.makeElement("a", false, false, u, W.label,
  4178.                         {
  4179.                             href: W.url,
  4180.                             target: "_blank"
  4181.                         })
  4182.                     }
  4183.                     socialAction.makeElement("div", false, "clear", S)
  4184.                 }
  4185.                 var v = socialAction.makeElement("li", false, "justlinks morelinks", x);
  4186.                 socialAction.makeElement("span", false, false, v, "more...");
  4187.                 var U = socialAction.makeElement("ul", false, "extend", v);
  4188.                 var S = socialAction.makeElement("li", false, false, U);
  4189.                 socialAction.makeElement("a", false, "green", S, "Contact",
  4190.                 {
  4191.                     href: "/contact"
  4192.                 });
  4193.                 socialAction.makeElement("br", false, false, S);
  4194.                 socialAction.makeElement("a", false, "green", S, "Cleverbot apps",
  4195.                 {
  4196.                     href: "/app"
  4197.                 });
  4198.                 socialAction.makeElement("br", false, false, S);
  4199.                 socialAction.makeElement("a", false, "green", S, "Cleverbot snips",
  4200.                 {
  4201.                     href: "/me/cleverbot"
  4202.                 });
  4203.                 socialAction.makeElement("br", false, false, S);
  4204.                 socialAction.makeElement("a", false, "green", S, "Cleverness files",
  4205.                 {
  4206.                     href: "/cleverness"
  4207.                 });
  4208.                 socialAction.makeElement("br", false, false, S);
  4209.                 socialAction.makeElement("a", false, "green", S, "Linking to Cleverbot",
  4210.                 {
  4211.                     href: "/linkingin"
  4212.                 });
  4213.                 socialAction.makeElement("br", false, false, S);
  4214.                 socialAction.makeElement("a", false, "green", S, "Turing Test, June 2014: press release",
  4215.                 {
  4216.                     href: "/amused"
  4217.                 });
  4218.                 var S = socialAction.makeElement("li", false, false, U);
  4219.                 socialAction.makeElement("a", false, "imageonleft red", S, '<img src="http://www.cleverbot.com/s/c/youtube.jpg" alt=""/> Clever them!',
  4220.                 {
  4221.                     href: "/cleverthem"
  4222.                 });
  4223.                 socialAction.makeElement("br", false, false, S);
  4224.                 socialAction.makeElement("a", false, "imageonleft pink", S, '<img src="http://www.cleverbot.com/s/c/lips_40_24.jpg" alt=""/> Cleverlips!',
  4225.                 {
  4226.                     href: "/cleverlips"
  4227.                 });
  4228.                 socialAction.makeElement("br", false, false, S);
  4229.                 socialAction.makeElement("a", false, "imageonleft purple", S, '<img src="http://www.cleverbot.com/s/c/evie_on_white_45_42.jpg" alt=""/> Evie, our avatar<br/>at existor.com!',
  4230.                 {
  4231.                     href: "http:///www.existor.com/"
  4232.                 });
  4233.                 var S = socialAction.makeElement("li", false, false, U);
  4234.                 socialAction.makeElement("a", false, "blue", S, "42% human - Machine Intelligence Prize",
  4235.                 {
  4236.                     href: "/machine"
  4237.                 });
  4238.                 socialAction.makeElement("br", false, false, S);
  4239.                 socialAction.makeElement("a", false, "blue", S, "59% human - a Turing Test",
  4240.                 {
  4241.                     href: "/human"
  4242.                 });
  4243.                 socialAction.makeElement("br", false, false, S);
  4244.                 socialAction.makeElement("a", false, "blue", S, "Cleverbot parallel processing",
  4245.                 {
  4246.                     href: "http://www.existor.com/ai-parallel"
  4247.                 });
  4248.                 socialAction.makeElement("br", false, false, S);
  4249.                 socialAction.makeElement("a", false, "blue", S, 'Developers, create bots! <img src="http://www.cleverbot.com/s/c/cleverscript_118_17.jpg" alt="Cleverscript"/>',
  4250.                 {
  4251.                     href: "http://www.cleverscript.com/"
  4252.                 });
  4253.                 socialAction.makeElement("br", false, false, S);
  4254.                 socialAction.makeElement("a", false, "blue", S, 'In partnership with <img src="http://www.cleverbot.com/s/c/selectel_59_17.jpg" alt="Selectel"/>',
  4255.                 {
  4256.                     href: "http://www.selectel.com/"
  4257.                 });
  4258.                 socialAction.makeElement("br", false, false, S);
  4259.                 socialAction.makeElement("a", false, "blue", S, "Follow @cleverbot",
  4260.                 {
  4261.                     href: "https://twitter.com/cleverbot"
  4262.                 })
  4263.             }
  4264.         }
  4265.         if (socialAction.maintenanceMode >= 3)
  4266.         {
  4267.             var v = socialAction.makeElement("li", false, "recreate", x);
  4268.             socialAction.makeElement("span", false, "maintenance", v, socialAction.maintenanceMessage)
  4269.         }
  4270.         if (socialAction.maintenanceMode == 2)
  4271.         {
  4272.             var v = socialAction.makeElement("li", "cbsocialsignup", "recreate", x);
  4273.             socialAction.makeElement("span", false, "maintenance", v, "loading...")
  4274.         }
  4275.         else
  4276.         {
  4277.             if (socialAction.signedin && socialAction.maintenanceMode < 2)
  4278.             {
  4279.                 var v = socialAction.makeElement("li", "cbsocialsigninup", "tabs withpicture recreate", x);
  4280.                 if (!socialAction.runSimple)
  4281.                 {
  4282.                     $(v).css("background-image", "url(" + socialAction.user.photolocation + ")")
  4283.                 }
  4284.                 var ab = socialAction.user.username;
  4285.                 if (ab && ab.length > 15)
  4286.                 {
  4287.                     ab = ab.substring(0, 14) + "..."
  4288.                 }
  4289.                 var P = socialAction.makeElement("span", false, false, v, ab);
  4290.                 var U = socialAction.makeElement("ul", false, "extend", v);
  4291.                 var S = socialAction.makeElement("li", false, "show", U);
  4292.                 socialAction.makeElement("h3", false, false, S, "profile");
  4293.                 var b = socialAction.makeElement("form", false, false, S, false, "saveprofile");
  4294.                 socialAction.makeElement("p", "cbsocialmessagesaveprofile", "message", b);
  4295.                 var l = {
  4296.                     name: "fullname",
  4297.                     type: "text",
  4298.                     value: socialAction.user.fullname
  4299.                 };
  4300.                 socialAction.makeElement("label", false, false, b, "Full name",
  4301.                 {
  4302.                     "for": "cbsocialprofilefullname"
  4303.                 });
  4304.                 socialAction.makeElement("input", "cbsocialprofilefullname", false, b, false, l);
  4305.                 socialAction.makeElement("label", false, false, b, "Photo",
  4306.                 {
  4307.                     "for": "cbsocialprofilephoto"
  4308.                 });
  4309.                 l = {
  4310.                     src: socialAction.user.photolocation ? socialAction.user.photolocation : socialAction.imageBase + "no_photo.jpg"
  4311.                 };
  4312.                 socialAction.makeElement("img", "cbsocialshowphoto", false, b, false, l);
  4313.                 l = {
  4314.                     type: "button",
  4315.                     value: "upload photo"
  4316.                 };
  4317.                 socialAction.makeElement("input", "cbsocialprofilephoto", "fileupload", b, false, l);
  4318.                 l = {
  4319.                     name: "uploadphoto",
  4320.                     type: "hidden",
  4321.                     value: "0"
  4322.                 };
  4323.                 socialAction.makeElement("input", "cbsocialprofilephotoupload", false, b, false, l);
  4324.                 socialAction.makeElement("div", "clear", false, b);
  4325.                 socialAction.makeElement("label", false, false, b, "Header",
  4326.                 {
  4327.                     "for": "cbsocialprofileheader"
  4328.                 });
  4329.                 l = {
  4330.                     src: socialAction.user.headerlocation ? socialAction.user.headerlocation : socialAction.imageBase + "no_header.jpg"
  4331.                 };
  4332.                 socialAction.makeElement("img", "cbsocialshowheader", "header", b, false, l);
  4333.                 l = {
  4334.                     type: "button",
  4335.                     value: "upload header"
  4336.                 };
  4337.                 socialAction.makeElement("input", "cbsocialprofileheader", "fileupload", b, false, l);
  4338.                 l = {
  4339.                     name: "uploadheader",
  4340.                     type: "hidden",
  4341.                     value: "0"
  4342.                 };
  4343.                 socialAction.makeElement("input", "cbsocialprofileheaderupload", false, b, false, l);
  4344.                 socialAction.makeElement("div", "clear", false, b);
  4345.                 l = {
  4346.                     name: "location",
  4347.                     type: "text",
  4348.                     value: socialAction.user.location
  4349.                 };
  4350.                 socialAction.makeElement("label", false, false, b, "Location",
  4351.                 {
  4352.                     "for": "cbsocialprofilelocation"
  4353.                 });
  4354.                 socialAction.makeElement("input", "cbsocialprofilelocation", false, b, false, l);
  4355.                 l = {
  4356.                     name: "biography",
  4357.                     value: socialAction.user.biography,
  4358.                     rows: 3
  4359.                 };
  4360.                 socialAction.makeElement("span", "cbsocialprofilebiocharcount", "charcount", b);
  4361.                 socialAction.makeElement("label", false, false, b, "Bio",
  4362.                 {
  4363.                     "for": "cbsocialprofilebio"
  4364.                 });
  4365.                 socialAction.makeElement("textarea", "cbsocialprofilebio", false, b, l.value, l);
  4366.                 l = {
  4367.                     type: "submit",
  4368.                     value: "save profile"
  4369.                 };
  4370.                 socialAction.makeElement("input", false, "spaceabove savebutton", b, false, l);
  4371.                 l = {
  4372.                     type: "button",
  4373.                     value: "view my profile"
  4374.                 };
  4375.                 var M = socialAction.makeElement("input", false, "spaceabove", b, false, l);
  4376.                 $(M).click(function()
  4377.                 {
  4378.                     socialAction.displayUserView(socialAction.user.id)
  4379.                 });
  4380.                 socialAction.makeElement("div", false, "clear", b);
  4381.                 var S = socialAction.makeElement("li", false, false, U);
  4382.                 socialAction.makeElement("h3", false, false, S, "account");
  4383.                 var b = socialAction.makeElement("form", false, false, S, false, "saveaccount");
  4384.                 socialAction.makeElement("p", "cbsocialmessagesaveaccount", "message", b);
  4385.                 l = {
  4386.                     name: "usernamenoedit",
  4387.                     type: "text",
  4388.                     readonly: "readonly",
  4389.                     value: socialAction.user.username
  4390.                 };
  4391.                 socialAction.makeElement("label", false, false, b, "Username",
  4392.                 {
  4393.                     "for": "cbsocialaccountusername"
  4394.                 });
  4395.                 socialAction.makeElement("input", "cbsocialaccountusername", "noedit", b, false, l);
  4396.                 l = {
  4397.                     name: "email",
  4398.                     type: "text",
  4399.                     value: socialAction.user.email,
  4400.                     maxlength: 100
  4401.                 };
  4402.                 socialAction.makeElement("label", false, false, b, "Email",
  4403.                 {
  4404.                     "for": "cbsocialaccountemail"
  4405.                 });
  4406.                 socialAction.makeElement("input", "cbsocialaccountemail", false, b, false, l);
  4407.                 l = {
  4408.                     name: "oldpassword",
  4409.                     type: "password",
  4410.                     maxlength: 25
  4411.                 };
  4412.                 socialAction.makeElement("label", false, false, b, "Old password",
  4413.                 {
  4414.                     "for": "cbsocialaccountoldpassword"
  4415.                 });
  4416.                 socialAction.makeElement("input", "cbsocialaccountoldpassword", false, b, false, l);
  4417.                 l = {
  4418.                     name: "newpassword",
  4419.                     type: "password",
  4420.                     maxlength: 25
  4421.                 };
  4422.                 socialAction.makeElement("label", false, false, b, "New password",
  4423.                 {
  4424.                     "for": "cbsocialaccountnewpassword"
  4425.                 });
  4426.                 socialAction.makeElement("input", "cbsocialaccountnewpassword", false, b, false, l);
  4427.                 l = {
  4428.                     name: "showsv",
  4429.                     value: socialAction.user.showsv > 0 ? (socialAction.user.showsv == 1 ? "scissors" : "scissors and voting") : "no"
  4430.                 };
  4431.                 socialAction.makeElement("label", false, false, b, "Show scissors and voting (applies next time you visit)",
  4432.                 {
  4433.                     "for": "cbsocialaccountshowsv"
  4434.                 });
  4435.                 socialAction.makeElement("select", "cbsocialaccountshowsv", false, b, ["no", "scissors", "scissors and voting"], l);
  4436.                 l = {
  4437.                     name: "autosnip",
  4438.                     value: socialAction.user.autosnip > 0 ? "yes" : "no"
  4439.                 };
  4440.                 socialAction.makeElement("label", false, false, b, "Automatically add facebook/twitter/etc snips here",
  4441.                 {
  4442.                     "for": "cbsocialaccountautosnip"
  4443.                 });
  4444.                 socialAction.makeElement("select", "cbsocialaccountautosnip", false, b, ["no", "yes"], l);
  4445.                 l = {
  4446.                     name: "logconvs",
  4447.                     value: socialAction.user.logconvs > 0 ? "yes" : "no"
  4448.                 };
  4449.                 socialAction.makeElement("label", false, false, b, "Conversation logging",
  4450.                 {
  4451.                     "for": "cbsocialaccountlogconvs"
  4452.                 });
  4453.                 socialAction.makeElement("select", "cbsocialaccountlogconvs", false, b, ["no", "yes"], l);
  4454.                 var L = {
  4455.                     followers: "Email me when I have a new follower",
  4456.                     snips: "Email me when someone I'm following makes a snip",
  4457.                     replies: "Email me when someone replies to one of my snips",
  4458.                     marketing: "Keep me informed of relevant updates and new products"
  4459.                 };
  4460.                 for (var k in L)
  4461.                 {
  4462.                     l = {
  4463.                         name: "emailnotify" + k,
  4464.                         type: "text",
  4465.                         value: socialAction.user["emailnotify" + k] > 0 ? "yes" : "no"
  4466.                     };
  4467.                     socialAction.makeElement("label", false, false, b, L[k],
  4468.                     {
  4469.                         "for": "cbsocialaccountemailnotify" + k
  4470.                     });
  4471.                     socialAction.makeElement("select", "cbsocialaccountemailnotify" + k, false, b, ["no", "yes"], l)
  4472.                 }
  4473.                 var O = socialAction.makeElement("p", false, "sslleft", b, "Cleverbot registration and sign in is protected by SSL");
  4474.                 socialAction.makeElement("div", false, "clear", b);
  4475.                 socialAction.addDeleteButtonToForm(b, "delete account", "delete your account, including all your snips and conversations");
  4476.                 l = {
  4477.                     type: "submit",
  4478.                     value: "save account"
  4479.                 };
  4480.                 socialAction.makeElement("input", false, "savebutton", b, false, l);
  4481.                 socialAction.makeElement("div", false, "clear", b);
  4482.                 var J = socialAction.uploadDimensions;
  4483.                 upclick(
  4484.                 {
  4485.                     maxsize: 5000000,
  4486.                     element: document.getElementById("cbsocialprofilephoto"),
  4487.                     action: socialAction.uploadurl + "?action=upload&field=photo&width=" + J.photo.width + "&height=" + J.photo.height,
  4488.                     onstart: function(h)
  4489.                     {
  4490.                         socialAction.showMessage("saveprofile", "uploading photo...", 1, 1);
  4491.                         socialAction.showDropDown($("#cbsocialsigninup"), 1);
  4492.                         document.getElementById("cbsocialprofilephotoupload").value = 1;
  4493.                         $("#cbsocial .loading").show()
  4494.                     },
  4495.                     oncomplete: function(h)
  4496.                     {
  4497.                         document.getElementById("cbsocialprofilephotoupload").value = 2;
  4498.                         $("#cbsocial .loading").hide();
  4499.                         if (h && h.error)
  4500.                         {
  4501.                             socialAction.processAction(
  4502.                             {
  4503.                                 action: "upload",
  4504.                                 success: 0,
  4505.                                 error: h.error
  4506.                             })
  4507.                         }
  4508.                     }
  4509.                 });
  4510.                 upclick(
  4511.                 {
  4512.                     maxsize: 5000000,
  4513.                     element: document.getElementById("cbsocialprofileheader"),
  4514.                     action: socialAction.uploadurl + "?action=upload&field=header&width=" + J.header.width + "&height=" + J.header.height,
  4515.                     onstart: function(h)
  4516.                     {
  4517.                         socialAction.showMessage("saveprofile", "uploading header...", 1, 1);
  4518.                         socialAction.showDropDown($("#cbsocialsigninup"), 1);
  4519.                         document.getElementById("cbsocialprofileheaderupload").value = 1;
  4520.                         $("#cbsocial .loading").show()
  4521.                     },
  4522.                     oncomplete: function(h)
  4523.                     {
  4524.                         document.getElementById("cbsocialprofileheaderupload").value = 2;
  4525.                         $("#cbsocial .loading").hide();
  4526.                         if (h && h.error)
  4527.                         {
  4528.                             socialAction.processAction(
  4529.                             {
  4530.                                 action: "upload",
  4531.                                 success: 0,
  4532.                                 error: h.error
  4533.                             })
  4534.                         }
  4535.                     }
  4536.                 });
  4537.                 var S = socialAction.makeElement("li", false, false, U);
  4538.                 socialAction.makeElement("h3", false, false, S, "sign out");
  4539.                 var b = socialAction.makeElement("form", false, false, S, false, "signout");
  4540.                 socialAction.makeElement("p", false, false, b, "Use this button to sign out of Cleverbot");
  4541.                 l = {
  4542.                     type: "submit",
  4543.                     value: "sign out"
  4544.                 };
  4545.                 socialAction.makeElement("input", false, false, b, false, l)
  4546.             }
  4547.             else
  4548.             {
  4549.                 if (socialAction.makeCache)
  4550.                 {
  4551.                     var v = socialAction.makeElement("li", "cbsocialsigninup", "verticalforms recreate", x);
  4552.                     socialAction.makeElement("span", false, false, v, "sign in")
  4553.                 }
  4554.                 else
  4555.                 {
  4556.                     if (socialAction.maintenanceMode < 2)
  4557.                     {
  4558.                         var v = socialAction.makeElement("li", "cbsocialsigninup", "verticalforms recreate", x);
  4559.                         socialAction.makeElement("span", false, false, v, "sign in");
  4560.                         var U = socialAction.makeElement("ul", false, "extend", v);
  4561.                         var S = socialAction.makeElement("li", false, false, U);
  4562.                         var b = socialAction.makeElement("form", false, false, S, false, "signin");
  4563.                         socialAction.makeElement("p", "cbsocialmessagesignin", "message", b);
  4564.                         var l = {
  4565.                             name: "username",
  4566.                             type: "text",
  4567.                             value: "username or email address",
  4568.                             placeholder: "username or email address",
  4569.                             maxlength: 25
  4570.                         };
  4571.                         socialAction.makeElement("input", false, "prefill", b, false, l);
  4572.                         socialAction.makeElement("br", false, false, b);
  4573.                         var l = {
  4574.                             type: "text",
  4575.                             value: "password",
  4576.                             maxlength: 25
  4577.                         };
  4578.                         socialAction.makeElement("input", false, "passwordclear", b, false, l);
  4579.                         var l = {
  4580.                             name: "password",
  4581.                             type: "password",
  4582.                             maxlength: 25
  4583.                         };
  4584.                         socialAction.makeElement("input", false, "passwordnormal", b, false, l);
  4585.                         socialAction.makeElement("br", false, false, b);
  4586.                         socialAction.makeElement("input", false, false, b, false,
  4587.                         {
  4588.                             name: "remember",
  4589.                             type: "hidden",
  4590.                             value: socialAction.rememberSignin
  4591.                         });
  4592.                         var j = {
  4593.                             type: "submit",
  4594.                             value: "sign in"
  4595.                         };
  4596.                         socialAction.makeElement("input", false, false, b, false, j);
  4597.                         var E = socialAction.makeElement("span", false, "collapselink", b, "forgotten?");
  4598.                         if (!socialAction.makeCache)
  4599.                         {
  4600.                             $(E).click(function()
  4601.                             {
  4602.                                 $("#cbsocialforgot").toggle(500, socialAction.resizeExtenders)
  4603.                             })
  4604.                         }
  4605.                         var S = socialAction.makeElement("li", "cbsocialforgot", "collapsecontent", U);
  4606.                         socialAction.makeElement("h3", false, false, S, "forgotten your password?");
  4607.                         var b = socialAction.makeElement("form", false, false, S, false, "forgot");
  4608.                         socialAction.makeElement("p", "cbsocialmessageforgot", "message", b);
  4609.                         var l = {
  4610.                             name: "email",
  4611.                             type: "text",
  4612.                             value: "email address",
  4613.                             placeholder: "email address"
  4614.                         };
  4615.                         socialAction.makeElement("input", false, "prefill", b, false, l);
  4616.                         socialAction.makeElement("br", false, false, b);
  4617.                         var l = {
  4618.                             type: "submit",
  4619.                             value: "remind me"
  4620.                         };
  4621.                         socialAction.makeElement("input", false, false, b, false, l);
  4622.                         socialAction.makeElement("br", false, false, b);
  4623.                         socialAction.makeElement("div", false, "clear", b);
  4624.                         var S = socialAction.makeElement("li", false, false, U);
  4625.                         socialAction.makeElement("h3", false, false, S, "or register!");
  4626.                         var b = socialAction.makeElement("form", "cbsocialsignupform", false, S, false, "signup");
  4627.                         if (socialAction.maintenanceMode == 1)
  4628.                         {
  4629.                             socialAction.makeElement("p", false, false, b, socialAction.signupMessage)
  4630.                         }
  4631.                         socialAction.makeElement("p", "cbsocialmessagesignup", "message", b);
  4632.                         var l = {
  4633.                             name: "username",
  4634.                             type: "text",
  4635.                             value: "username",
  4636.                             placeholder: "username",
  4637.                             maxlength: 25
  4638.                         };
  4639.                         socialAction.makeElement("input", false, "prefill", b, false, l);
  4640.                         socialAction.makeElement("br", false, false, b);
  4641.                         var l = {
  4642.                             name: "fullname",
  4643.                             type: "text",
  4644.                             value: "full name",
  4645.                             placeholder: "full name",
  4646.                             maxlength: 100
  4647.                         };
  4648.                         socialAction.makeElement("input", false, "prefill", b, false, l);
  4649.                         socialAction.makeElement("br", false, false, b);
  4650.                         var l = {
  4651.                             name: "email",
  4652.                             type: "text",
  4653.                             value: "email address",
  4654.                             placeholder: "email address",
  4655.                             maxlength: 100
  4656.                         };
  4657.                         socialAction.makeElement("input", false, "prefill", b, false, l);
  4658.                         socialAction.makeElement("br", false, false, b);
  4659.                         var l = {
  4660.                             type: "text",
  4661.                             value: "password",
  4662.                             maxlength: 25
  4663.                         };
  4664.                         socialAction.makeElement("input", false, "passwordclear", b, false, l);
  4665.                         var l = {
  4666.                             name: "password",
  4667.                             type: "password",
  4668.                             maxlength: 25
  4669.                         };
  4670.                         socialAction.makeElement("input", false, "passwordnormal", b, false, l);
  4671.                         socialAction.makeElement("br", false, false, b);
  4672.                         var l = {
  4673.                             name: "terms",
  4674.                             value: "password"
  4675.                         };
  4676.                         var N = socialAction.makeElement("label", false, "labelasp", b, 'Do you agree to our <a href="/terms">terms &amp;</a> <a href="/privacy">privacy policy?</a>',
  4677.                         {
  4678.                             "for": "cbsocialregisterterms"
  4679.                         });
  4680.                         var A = socialAction.makeElement("select", "cbsocialregisterterms", false, b, ["no", "yes"], l);
  4681.                         var l = {
  4682.                             type: "submit",
  4683.                             value: "sign up to Cleverbot"
  4684.                         };
  4685.                         socialAction.makeElement("input", false, "standout", b, false, l);
  4686.                         socialAction.makeElement("br", false, false, b);
  4687.                         var w = "keep your conversations!<br/>switch between them!<br/>post a million snips!<br/>rate other snips!<br/>gain followers!<br/>become a star<br/><br/>";
  4688.                         var o = "and we'll start to build<br/>a virtual you - a Cleverme!";
  4689.                         var O = socialAction.makeElement("p", false, "signuptext", b, w);
  4690.                         socialAction.makeElement("span", false, false, O, o);
  4691.                         var O = socialAction.makeElement("p", false, "sslright", b, "Cleverbot registration and sign in are protected by SSL")
  4692.                     }
  4693.                 }
  4694.             }
  4695.         }
  4696.         if (socialAction.signedin && socialAction.maintenanceMode < 2 && !socialAction.makeCache)
  4697.         {
  4698.             var v = socialAction.makeElement("li", "cbsocialtweaksmenu", "tabs tweaks recreate", x);
  4699.             socialAction.makeElement("span", false, false, v, "tweaks");
  4700.             var U = socialAction.makeElement("ul", false, "extend", v);
  4701.             var S = socialAction.makeElement("li", "", "show", U);
  4702.             var n = socialAction.makeElement("form", false, false, S, false, "savetweaks");
  4703.             socialAction.makeElement("h3", false, false, n, "Cleverbot should be...");
  4704.             var O = socialAction.makeElement("p", false, false, n, "Sensible");
  4705.             socialAction.makeElement("span", false, false, O, "Wacky");
  4706.             socialAction.makeElement("input", false, false, n, "",
  4707.             {
  4708.                 name: "tweak1",
  4709.                 type: "hidden",
  4710.                 value: socialAction.user.tweak1
  4711.             });
  4712.             var aa = socialAction.makeElement("div", "", "slider slider1", n);
  4713.             var O = socialAction.makeElement("p", false, false, n, "Shy");
  4714.             socialAction.makeElement("span", false, false, O, "Talkative");
  4715.             socialAction.makeElement("input", false, false, n, "",
  4716.             {
  4717.                 name: "tweak2",
  4718.                 type: "hidden",
  4719.                 value: socialAction.user.tweak2
  4720.             });
  4721.             var Z = socialAction.makeElement("div", "", "slider slider2", n);
  4722.             var O = socialAction.makeElement("p", false, false, n, "Self centred");
  4723.             socialAction.makeElement("span", false, false, O, "Attentive");
  4724.             socialAction.makeElement("input", false, false, n, "",
  4725.             {
  4726.                 name: "tweak3",
  4727.                 type: "hidden",
  4728.                 value: socialAction.user.tweak3
  4729.             });
  4730.             var Y = socialAction.makeElement("div", "", "slider slider3", n);
  4731.             $(aa).slider(
  4732.             {
  4733.                 min: 0,
  4734.                 max: 100,
  4735.                 step: 10,
  4736.                 value: socialAction.user.tweak1,
  4737.                 change: function(h, i)
  4738.                 {
  4739.                     $(this).prev().val(i.value);
  4740.                     $(this).parent()[0].fakeSubmit()
  4741.                 },
  4742.                 slide: function(h, i)
  4743.                 {
  4744.                     socialAction.showDropDown($("#cbsocial li.tweaks"), 1)
  4745.                 }
  4746.             });
  4747.             $(Z).slider(
  4748.             {
  4749.                 min: 0,
  4750.                 max: 100,
  4751.                 step: 10,
  4752.                 value: socialAction.user.tweak2,
  4753.                 change: function(h, i)
  4754.                 {
  4755.                     $(this).prev().val(i.value);
  4756.                     $(this).parent()[0].fakeSubmit()
  4757.                 },
  4758.                 slide: function(h, i)
  4759.                 {
  4760.                     socialAction.showDropDown($("#cbsocial li.tweaks"), 1)
  4761.                 }
  4762.             });
  4763.             $(Y).slider(
  4764.             {
  4765.                 min: 0,
  4766.                 max: 100,
  4767.                 step: 10,
  4768.                 value: socialAction.user.tweak3,
  4769.                 change: function(h, i)
  4770.                 {
  4771.                     $(this).prev().val(i.value);
  4772.                     $(this).parent()[0].fakeSubmit()
  4773.                 },
  4774.                 slide: function(h, i)
  4775.                 {
  4776.                     socialAction.showDropDown($("#cbsocial li.tweaks"), 1)
  4777.                 }
  4778.             });
  4779.             var K = socialAction.makeElement("p", false, false, n);
  4780.             var z = socialAction.makeElement("a", false, false, K, "Let us know why you like your tweaks",
  4781.             {
  4782.                 href: "/contact",
  4783.                 target: "_blank"
  4784.             });
  4785.             $(z).click(function()
  4786.             {
  4787.                 var h = encodeURIComponent("I like these tweaks because...");
  4788.                 var i = encodeURIComponent("userid=" + socialAction.user.id + ", tweak1=" + socialAction.user.tweak1 + ", tweak2=" + socialAction.user.tweak2 + ", tweak3=" + socialAction.user.tweak3);
  4789.                 var p = socialAction.user.email;
  4790.                 this.href = "/contact?pre=" + h + "&extra=" + i + "&email=" + p
  4791.             })
  4792.         }
  4793.         else
  4794.         {
  4795.             if (socialAction.maintenanceMode < 2)
  4796.             {
  4797.                 var v = socialAction.makeElement("li", "cbsocialtweaksmenu", "notsignedin recreate", x);
  4798.                 socialAction.makeElement("span", false, false, v, "tweaks")
  4799.             }
  4800.         }
  4801.         if (socialAction.signedin && socialAction.maintenanceMode < 2 && !socialAction.makeCache)
  4802.         {
  4803.             var v = socialAction.makeElement("li", "cbsocialconversationsmenu", "tabs recreate", x);
  4804.             socialAction.makeElement("span", false, false, v, "conversations");
  4805.             var U = socialAction.makeElement("ul", false, "extend", v);
  4806.             var S = socialAction.makeElement("li", "cbsocialconversations", "show", U);
  4807.             var B = socialAction.makeElement("ul", false, false, S)
  4808.         }
  4809.         else
  4810.         {
  4811.             if (socialAction.maintenanceMode < 2)
  4812.             {
  4813.                 var v = socialAction.makeElement("li", "cbsocialconversationsmenu", "notsignedin recreate", x);
  4814.                 socialAction.makeElement("span", false, false, v, "conversations")
  4815.             }
  4816.         }
  4817.         if (socialAction.maintenanceMode < 2 && !socialAction.makeCache)
  4818.         {
  4819.             var v = socialAction.makeElement("li", "cbsocialsnipsmenu", "tabs recreate", x);
  4820.             socialAction.makeElement("span", false, false, v, "snips");
  4821.             var U = socialAction.makeElement("ul", false, "extend", v);
  4822.             var S = socialAction.makeElement("li", "cbsocialsnipsstars", socialAction.signedin ? false : "show", U);
  4823.             socialAction.makeElement("h3", false, false, S, "stars!");
  4824.             var B = socialAction.makeElement("ul", false, false, S);
  4825.             var S = socialAction.makeElement("li", "cbsocialsnipsmysnips", false, U);
  4826.             socialAction.makeElement("h3", false, false, S, "my snips");
  4827.             var B = socialAction.makeElement("ul", false, false, S);
  4828.             socialAction.signInMessageForTab(B, "to view your snips");
  4829.             var S = socialAction.makeElement("li", "cbsocialsnipstimeline", socialAction.signedin ? "show" : false, U);
  4830.             socialAction.makeElement("h3", false, false, S, "timeline");
  4831.             var B = socialAction.makeElement("ul", false, false, S);
  4832.             socialAction.signInMessageForTab(B, "to view your timeline");
  4833.             var S = socialAction.makeElement("li", "cbsocialsnipsnew", false, U);
  4834.             socialAction.makeElement("h3", false, "onright", S, "new");
  4835.             if (socialAction.signedin)
  4836.             {
  4837.                 var t = socialAction.makeElement("form", false, false, S, false, "addsnip");
  4838.                 socialAction.makeElement("p", "cbsocialmessageaddsnip", "message", t);
  4839.                 socialAction.makeElement("span", "cbsocialcomposecharcount", "charcount", t);
  4840.                 var g = socialAction.makeElement("label", false, false, t, "add a new snip",
  4841.                 {
  4842.                     "for": "cbsocialcompose"
  4843.                 });
  4844.                 socialAction.makeElement("span", false, false, g, " (or try the scissors snip! window)");
  4845.                 socialAction.makeElement("textarea", "cbsocialcompose", "prefill", t, "",
  4846.                 {
  4847.                     name: "text",
  4848.                     rows: 3
  4849.                 });
  4850.                 socialAction.makeElement("input", false, "spaceabove", t, false,
  4851.                 {
  4852.                     type: "submit",
  4853.                     value: "snip it!"
  4854.                 })
  4855.             }
  4856.             else
  4857.             {
  4858.                 var B = socialAction.makeElement("ul", false, false, S);
  4859.                 socialAction.signInMessageForTab(B, "to post a snip")
  4860.             }
  4861.         }
  4862.         else
  4863.         {
  4864.             if (socialAction.maintenanceMode < 2)
  4865.             {
  4866.                 var v = socialAction.makeElement("li", "cbsocialsnipsmenu", "notsignedin recreate", x);
  4867.                 socialAction.makeElement("span", false, false, v, "snips")
  4868.             }
  4869.         }
  4870.         if (socialAction.signedin && socialAction.maintenanceMode < 2 && !socialAction.makeCache)
  4871.         {
  4872.             var v = socialAction.makeElement("li", "cbsocialusersmenu", "tabs recreate", x);
  4873.             socialAction.makeElement("span", false, false, v, "people");
  4874.             var U = socialAction.makeElement("ul", false, "extend", v);
  4875.             var S = socialAction.makeElement("li", "cbsocialusersfollowers", false, U);
  4876.             var H = socialAction.makeElement("h3", false, false, S, "followers");
  4877.             var B = socialAction.makeElement("ul", false, false, S);
  4878.             var S = socialAction.makeElement("li", "cbsocialusersfollowing", "show", U);
  4879.             var H = socialAction.makeElement("h3", false, false, S, "following");
  4880.             var B = socialAction.makeElement("ul", false, false, S);
  4881.             var S = socialAction.makeElement("li", "cbsocialuserssuggested", false, U);
  4882.             var H = socialAction.makeElement("h3", false, false, S, "suggestions");
  4883.             var B = socialAction.makeElement("ul", false, false, S)
  4884.         }
  4885.         else
  4886.         {
  4887.             if (socialAction.maintenanceMode < 2)
  4888.             {
  4889.                 var v = socialAction.makeElement("li", "cbsocialusersmenu", "notsignedin recreate", x);
  4890.                 socialAction.makeElement("span", false, false, v, "people")
  4891.             }
  4892.         }
  4893.         if (socialAction.signedin && socialAction.maintenanceMode < 2 && !socialAction.makeCache)
  4894.         {
  4895.             var v = socialAction.makeElement("li", "cbsocialsearch", "tabs noshowonhover recreate", x);
  4896.             var c = socialAction.makeElement("form", false, "forminmenu", v, "", "search");
  4897.             socialAction.makeElement("input", false, "prefill", c, "",
  4898.             {
  4899.                 name: "search",
  4900.                 type: "text",
  4901.                 value: "search"
  4902.             });
  4903.             var U = socialAction.makeElement("ul", false, "extend", v);
  4904.             var S = socialAction.makeElement("li", "cbsocialuserssearch", false, U);
  4905.             var H = socialAction.makeElement("h3", false, false, S, "people");
  4906.             socialAction.makeElement("span", false, "unbold", H);
  4907.             var B = socialAction.makeElement("ul", false, false, S);
  4908.             var S = socialAction.makeElement("li", "cbsocialsnipssearch", false, U);
  4909.             var H = socialAction.makeElement("h3", false, false, S, "snips");
  4910.             socialAction.makeElement("span", false, "unbold", H);
  4911.             var B = socialAction.makeElement("ul", false, false, S);
  4912.             $("#cbsocial form.forminmenu input").hover(function()
  4913.             {
  4914.                 $(this).addClass("show", 500)
  4915.             }, function()
  4916.             {
  4917.                 if (!$(this).prop("already"))
  4918.                 {
  4919.                     $(this).removeClass("show", 500)
  4920.                 }
  4921.             });
  4922.             $("#cbsocial form.forminmenu input").blur(function()
  4923.             {
  4924.                 var h = $(this);
  4925.                 if (!h.val() && h.prop("already"))
  4926.                 {
  4927.                     h.val(h.prop("already"));
  4928.                     h.prop("already", "");
  4929.                     h.addClass("prefill");
  4930.                     h.removeClass("show", 500)
  4931.                 }
  4932.             })
  4933.         }
  4934.         else
  4935.         {
  4936.             if (socialAction.maintenanceMode < 2)
  4937.             {
  4938.                 var v = socialAction.makeElement("li", "cbsocialsearchinactive", "notsignedin recreate", x);
  4939.                 socialAction.makeElement("span", false, false, v, "search")
  4940.             }
  4941.         }
  4942.         if (socialAction.maintenanceMode < 2 && $("#cbsocial div.viewuser").length == 0)
  4943.         {
  4944.             socialAction.makeElement("div", false, "obscureuser extend", D);
  4945.             var G = socialAction.makeElement("div", false, "viewuser extend", D);
  4946.             var I = socialAction.makeElement("a", false, "closeuser", G);
  4947.             socialAction.makeElement("img", false, false, I, false,
  4948.             {
  4949.                 src: socialAction.imageBase + "user_close.png"
  4950.             });
  4951.             socialAction.makeElement("div", false, "header", G);
  4952.             var U = socialAction.makeElement("ul", false, false, G);
  4953.             var S = socialAction.makeElement("li", "cbsocialsnipsonesnip_user", "onesnip", U);
  4954.             var C = socialAction.makeElement("span", false, false, S, false);
  4955.             socialAction.makeElement("span", false, false, C, "this snip");
  4956.             socialAction.makeElement("ul", false, false, S);
  4957.             var S = socialAction.makeElement("li", "cbsocialsnipsmysnips_user", "showdefault", U);
  4958.             var C = socialAction.makeElement("span", false, false, S, false);
  4959.             socialAction.makeElement("span", false, "bold", C);
  4960.             socialAction.makeElement("span", false, false, C, "snips");
  4961.             socialAction.makeElement("ul", false, false, S);
  4962.             var S = socialAction.makeElement("li", "cbsocialsnipsmybest_user", false, U);
  4963.             var C = socialAction.makeElement("span", false, false, S, false);
  4964.             socialAction.makeElement("span", false, "bold", C);
  4965.             socialAction.makeElement("span", false, false, C, "best");
  4966.             socialAction.makeElement("ul", false, false, S);
  4967.             var S = socialAction.makeElement("li", "cbsocialusersfollowing_user", false, U);
  4968.             var C = socialAction.makeElement("span", false, false, S, false);
  4969.             socialAction.makeElement("span", false, "bold", C);
  4970.             socialAction.makeElement("span", false, false, C, "following");
  4971.             socialAction.makeElement("ul", false, false, S);
  4972.             var S = socialAction.makeElement("li", "cbsocialusersfollowers_user", false, U);
  4973.             var C = socialAction.makeElement("span", false, false, S, false);
  4974.             socialAction.makeElement("span", false, "bold", C);
  4975.             socialAction.makeElement("span", false, false, C, "followers");
  4976.             socialAction.makeElement("ul", false, false, S);
  4977.             var S = socialAction.makeElement("li", false, "backbutton", U);
  4978.             var C = socialAction.makeElement("span", false, false, S, "&lt;back")
  4979.         }
  4980.         if (socialAction.maintenanceMode < 2 && !socialAction.makeCache)
  4981.         {
  4982.             socialAction.remakeDataLists(0);
  4983.             socialAction.remakeConversationList(0)
  4984.         }
  4985.         if (!socialAction.makeCache)
  4986.         {
  4987.             socialAction.hookUpInteractions()
  4988.         }
  4989.         if (!socialAction.makeCache && Q)
  4990.         {
  4991.             $("#cbsocial .loading").hide()
  4992.         }
  4993.     },
  4994.     hookUpInteractions: function(b)
  4995.     {
  4996.         if (!b)
  4997.         {
  4998.             $("#cbsocial > ul > li").not("li.notsignedin").hover(function()
  4999.             {
  5000.                 if (!socialAction.stuckMenu)
  5001.                 {
  5002.                     socialAction.showDropDown($(this), 0)
  5003.                 }
  5004.             }, function()
  5005.             {
  5006.                 if (!socialAction.stuckMenu)
  5007.                 {
  5008.                     socialAction.hideDropDown($(this), 0)
  5009.                 }
  5010.             });
  5011.             $("#cbsocial > ul > li .fileupload").mouseleave(function(c)
  5012.             {
  5013.                 c.stopPropagation()
  5014.             });
  5015.             $("#cbsocial > .obscure").click(socialAction.hideStuckDropDown);
  5016.             $("#cbsocial > ul > li").not("li.notsignedin").click(function(c)
  5017.             {
  5018.                 socialAction.showDropDown($(this), 1)
  5019.             });
  5020.             $("#cbsocial > ul > li > span").click(function(d)
  5021.             {
  5022.                 var c = $(this).parent();
  5023.                 if (c.hasClass("stuck"))
  5024.                 {
  5025.                     socialAction.hideDropDown($(this).parent(), 1);
  5026.                     d.stopPropagation()
  5027.                 }
  5028.             });
  5029.             socialAction.stuckMenu = 0
  5030.         }
  5031.         if (socialAction.maintenanceMode >= 2)
  5032.         {
  5033.             $("#cbsocial > ul > li > span.maintenance").hover(function(c)
  5034.             {
  5035.                 c.stopPropagation()
  5036.             });
  5037.             $("#cbsocial > ul > li > span.maintenance").click(function(c)
  5038.             {
  5039.                 c.stopPropagation()
  5040.             })
  5041.         }
  5042.         if (socialAction.maintenanceMode < 2)
  5043.         {
  5044.             $("input.prefill, textarea.prefill").focus(function()
  5045.             {
  5046.                 var c = $(this);
  5047.                 if (!c.prop("already"))
  5048.                 {
  5049.                     c.removeClass("prefill");
  5050.                     c.prop("already", c.val());
  5051.                     c.val("")
  5052.                 }
  5053.             });
  5054.             $("input.passwordclear").show();
  5055.             $("input.passwordnormal").hide();
  5056.             $("input.passwordclear").focus(function()
  5057.             {
  5058.                 $(this).parent().children("input.passwordclear").hide();
  5059.                 $(this).parent().children("input.passwordnormal").show();
  5060.                 $(this).parent().children("input.passwordnormal").focus()
  5061.             });
  5062.             $("input.passwordnormal").blur(function()
  5063.             {
  5064.                 if (!$(this).val())
  5065.                 {
  5066.                     $(this).parent().children("input.passwordnormal").hide();
  5067.                     $(this).parent().children("input.passwordclear").show()
  5068.                 }
  5069.             });
  5070.             $("#cbsocial li.tabs h3").click(function()
  5071.             {
  5072.                 $(this).parent().siblings(".show").removeClass("show");
  5073.                 $(this).parent().addClass("show");
  5074.                 socialAction.resizeExtenders();
  5075.                 $(this).parent().find("textarea#cbsocialcompose").focus()
  5076.             });
  5077.             $(window).scroll(function()
  5078.             {
  5079.                 var g = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight);
  5080.                 if ($(window).scrollTop() < g - window.innerHeight - 5)
  5081.                 {
  5082.                     return
  5083.                 }
  5084.                 var h;
  5085.                 if (socialAction.lookingAtUserid > 0)
  5086.                 {
  5087.                     h = $("#cbsocial > div.viewuser > ul > li.show")
  5088.                 }
  5089.                 else
  5090.                 {
  5091.                     h = $("#cbsocial > ul > li.show.tabs > ul > li.show")
  5092.                 }
  5093.                 if (h.length != 1)
  5094.                 {
  5095.                     return
  5096.                 }
  5097.                 var c = h.attr("id");
  5098.                 var e = h.children("ul").children("li").length;
  5099.                 if (socialAction.lookingAtUserid > 0)
  5100.                 {
  5101.                     c = c.replace("_user", "")
  5102.                 }
  5103.                 var d = "";
  5104.                 if (c == "cbsocialusersfollowing")
  5105.                 {
  5106.                     d = "getfollowing"
  5107.                 }
  5108.                 else
  5109.                 {
  5110.                     if (c == "cbsocialusersfollowers")
  5111.                     {
  5112.                         d = "getfollowers"
  5113.                     }
  5114.                     else
  5115.                     {
  5116.                         if (c == "cbsocialsnipstimeline")
  5117.                         {
  5118.                             d = "gettimeline"
  5119.                         }
  5120.                         else
  5121.                         {
  5122.                             if (c == "cbsocialsnipsmysnips")
  5123.                             {
  5124.                                 d = "getmysnips"
  5125.                             }
  5126.                             else
  5127.                             {
  5128.                                 if (c == "cbsocialsnipsstars")
  5129.                                 {
  5130.                                     d = "getstars"
  5131.                                 }
  5132.                                 else
  5133.                                 {
  5134.                                     if (c == "cbsocialuserssearch")
  5135.                                     {
  5136.                                         d = "searchusers"
  5137.                                     }
  5138.                                     else
  5139.                                     {
  5140.                                         if (c == "cbsocialsnipssearch")
  5141.                                         {
  5142.                                             d = "searchsnips"
  5143.                                         }
  5144.                                         else
  5145.                                         {
  5146.                                             if (c == "cbsocialconversations")
  5147.                                             {
  5148.                                                 d = "getconversations"
  5149.                                             }
  5150.                                         }
  5151.                                     }
  5152.                                 }
  5153.                             }
  5154.                         }
  5155.                     }
  5156.                 }
  5157.                 if (!d)
  5158.                 {
  5159.                     return
  5160.                 }
  5161.                 var i = d + socialAction.lookingAtUserid;
  5162.                 var f = {
  5163.                     offset: e,
  5164.                     userid: socialAction.lookingAtUserid
  5165.                 };
  5166.                 if (d == "searchusers" || d == "searchsnips")
  5167.                 {
  5168.                     i += "_" + socialAction.lastSearch;
  5169.                     f.search = socialAction.lastSearch
  5170.                 }
  5171.                 if (!socialAction.dataLoads[i])
  5172.                 {
  5173.                     socialAction.dataLoads[i] = 0
  5174.                 }
  5175.                 if (e <= (socialAction.dataLoads[i] + 0.5) * (d == "getstars" ? 20 : socialAction.loadEachTime))
  5176.                 {
  5177.                     return
  5178.                 }
  5179.                 socialAction.dataLoads[i] ++;
  5180.                 socialAction.socialCall(d, f)
  5181.             });
  5182.             $("#cbsocial textarea").keyup(socialAction.charCounter);
  5183.             if (socialAction.isSignedIn())
  5184.             {
  5185.                 $("#cbsocial").delegate("img.star", "click", function()
  5186.                 {
  5187.                     if (!$(this).hasClass("rated"))
  5188.                     {
  5189.                         return
  5190.                     }
  5191.                     var c = $(this).prevAll("img.star").andSelf().length;
  5192.                     $(this).siblings("input[name='rating']").attr("value", c);
  5193.                     $(this).parent()[0].fakeSubmit()
  5194.                 });
  5195.                 $("#cbsocial").delegate("img.star", "mouseenter", function()
  5196.                 {
  5197.                     if (!$(this).hasClass("rated"))
  5198.                     {
  5199.                         return
  5200.                     }
  5201.                     $(this).prevAll("img.star").andSelf().attr("src", socialAction.imageBase + "star_full.png");
  5202.                     $(this).nextAll("img.star").attr("src", socialAction.imageBase + "star_empty.png")
  5203.                 });
  5204.                 $("#cbsocial").delegate("img.star", "mouseleave", function()
  5205.                 {
  5206.                     if (!$(this).hasClass("rated"))
  5207.                     {
  5208.                         return
  5209.                     }
  5210.                     $(this).parent().each(socialAction.setSnipRating)
  5211.                 })
  5212.             }
  5213.         }
  5214.         if (socialAction.maintenanceMode < 2)
  5215.         {
  5216.             $("#cbsocial > div.obscureuser, #cbsocial a.closeuser").click(socialAction.closeUserView);
  5217.             $("#cbsocial > div.viewuser > ul > li > span").click(function(d)
  5218.             {
  5219.                 var c = $(this).parent();
  5220.                 if (c.attr("id"))
  5221.                 {
  5222.                     socialAction.showUserDropDown(c, 1);
  5223.                     socialAction.lookingAtTab = c.attr("id")
  5224.                 }
  5225.             });
  5226.             $("#cbsocial > div.viewuser > ul > li.backbutton > span").click(socialAction.closeUserView)
  5227.         }
  5228.     },
  5229.     signInMessageForTab: function(c, b)
  5230.     {
  5231.         if (!socialAction.signedin)
  5232.         {
  5233.             socialAction.makeElement("li", false, "nothingtoshow", c, "please sign up or sign in " + (b ? b : "to view this"))
  5234.         }
  5235.     },
  5236.     addDeleteButtonToForm: function(e, f, g, c)
  5237.     {
  5238.         if (!f)
  5239.         {
  5240.             f = "delete"
  5241.         }
  5242.         if (!g)
  5243.         {
  5244.             g = "delete this"
  5245.         }
  5246.         if (!c)
  5247.         {
  5248.             c = "deletethis"
  5249.         }
  5250.         socialAction.makeElement("input", false, false, e, false,
  5251.         {
  5252.             name: c,
  5253.             type: "hidden",
  5254.             value: ""
  5255.         });
  5256.         var b = {
  5257.             type: "button",
  5258.             value: f
  5259.         };
  5260.         var d = socialAction.makeElement("input", false, "deletebutton", e, false, b);
  5261.         $(d).click(new Function("if (confirm ('Are you sure you want to " + g + "?')) {$(this).siblings('input[name=" + c + "]').val('yes'); $(this).parent()[0].fakeSubmit();}"))
  5262.     },
  5263.     remakeDataLists: function(h, e, j, b)
  5264.     {
  5265.         var c = h ? h : socialAction.lookingAtUserid;
  5266.         var f = (new Date()).getTime() - 1000 * socialAction.timeLookupDelay;
  5267.         if (socialAction.signedin && !h)
  5268.         {
  5269.             socialAction.makeUserList("cbsocialusersfollowers", socialAction.user.id, "follower", f);
  5270.             socialAction.makeUserList("cbsocialusersfollowing", socialAction.user.id, "following", f);
  5271.             socialAction.makeUserList("cbsocialuserssuggested", socialAction.user.id, "suggested", f);
  5272.             socialAction.makeSnipList("cbsocialsnipstimeline", socialAction.user.id, "timeline", 0, j, b, f);
  5273.             socialAction.makeSnipList("cbsocialsnipsmysnips", socialAction.user.id, "mysnip", 0, j, b, f)
  5274.         }
  5275.         if (socialAction.signedin && h <= 0)
  5276.         {
  5277.             var i = socialAction.makeUserList("cbsocialuserssearch", socialAction.user.id, "search", f);
  5278.             var k = socialAction.makeSnipList("cbsocialsnipssearch", socialAction.user.id, "search", 0, j, b, f);
  5279.             if (h == -1)
  5280.             {
  5281.                 var g = i || !k ? "#cbsocialuserssearch" : "#cbsocialsnipssearch";
  5282.                 var d = i || !k ? "#cbsocialsnipssearch" : "#cbsocialuserssearch";
  5283.                 $(g).addClass("show");
  5284.                 $(d).removeClass("show")
  5285.             }
  5286.         }
  5287.         if (c > 0)
  5288.         {
  5289.             socialAction.makeUserList("cbsocialusersfollowers_user", c, "follower", f);
  5290.             socialAction.makeUserList("cbsocialusersfollowing_user", c, "following", f);
  5291.             socialAction.makeSnipList("cbsocialsnipsmysnips_user", c, "mysnip", 0, j, b, f);
  5292.             socialAction.makeSnipList("cbsocialsnipsmybest_user", c, "mysnip", 1, j, b, f);
  5293.             socialAction.drawUserHeader(c)
  5294.         }
  5295.         if (!h)
  5296.         {
  5297.             socialAction.makeSnipList("cbsocialsnipsstars", socialAction.user.id, "star", 1, j, b, f)
  5298.         }
  5299.         socialAction.resizeExtenders()
  5300.     },
  5301.     getUrlVars: function()
  5302.     {
  5303.         var e = [],
  5304.             d;
  5305.         var b = window.location.href.slice(window.location.href.indexOf("?") + 1).split("&");
  5306.         for (var c = 0; c < b.length; c++)
  5307.         {
  5308.             d = b[c].split("=");
  5309.             e.push(d[0]);
  5310.             e[d[0]] = d[1]
  5311.         }
  5312.         return e
  5313.     },
  5314.     getInfoFromUrl: function()
  5315.     {
  5316.         var b = {};
  5317.         var c = document.location.href.indexOf("www.cleverbot.com/mz/");
  5318.         if (c < 0)
  5319.         {
  5320.             return b
  5321.         }
  5322.         var f = document.location.href.substr(c + 21);
  5323.         if (f.indexOf("v/") == 1)
  5324.         {
  5325.             var d = f.split("/");
  5326.             var e = f.substring(0, 1);
  5327.             if (d.length >= 3 && e == "s")
  5328.             {
  5329.                 b.verify = "signup"
  5330.             }
  5331.             else
  5332.             {
  5333.                 if (d.length >= 3 && e == "e")
  5334.                 {
  5335.                     b.verify = "email"
  5336.                 }
  5337.                 else
  5338.                 {
  5339.                     if (d.length >= 3 && e == "u")
  5340.                     {
  5341.                         b.verify = "unsubscribe"
  5342.                     }
  5343.                 }
  5344.             }
  5345.             if (b.verify)
  5346.             {
  5347.                 b.verifyuserid = d[1];
  5348.                 b.verification = d[2].replace(/[^\w\d_\-].*$/, "")
  5349.             }
  5350.         }
  5351.         else
  5352.         {
  5353.             f = f.replace(/[^\w\d_\-\.@].*$/, "");
  5354.             if (f.length >= 3)
  5355.             {
  5356.                 b.username = f
  5357.             }
  5358.         }
  5359.         return b
  5360.     },
  5361.     showMessage: function(d, e, c, f)
  5362.     {
  5363.         var b = $("#cbsocialmessage" + d);
  5364.         if (!b.length)
  5365.         {
  5366.             b = $(".cbsocialmessage" + d)
  5367.         }
  5368.         if (!b.length)
  5369.         {
  5370.             return
  5371.         }
  5372.         b.html((c ? "<span>" : "") + e + (c ? "</span>" : ""));
  5373.         if (f)
  5374.         {
  5375.             b.stop().show()
  5376.         }
  5377.         else
  5378.         {
  5379.             b.stop().show().delay(5000).hide(1000)
  5380.         }
  5381.     },
  5382.     debug: function(c, d, b)
  5383.     {
  5384.         if (c)
  5385.         {
  5386.             console.log(c)
  5387.         }
  5388.         if (d)
  5389.         {
  5390.             console.log(d)
  5391.         }
  5392.     },
  5393.     showDropDown: function(c, b)
  5394.     {
  5395.         if (c.hasClass("dontreshow"))
  5396.         {
  5397.             c.removeClass("dontreshow");
  5398.             return
  5399.         }
  5400.         if (b < 2 && c.hasClass("noshowonhover"))
  5401.         {
  5402.             return
  5403.         }
  5404.         if (b && c.hasClass("stuck"))
  5405.         {
  5406.             return
  5407.         }
  5408.         if (b)
  5409.         {
  5410.             socialAction.hideStuckDropDown();
  5411.             socialAction.stuckMenu = 1;
  5412.             c.addClass("stuck")
  5413.         }
  5414.         if (b == 2)
  5415.         {
  5416.             c.removeClass("noshowonhover")
  5417.         }
  5418.         c.addClass("show");
  5419.         $("#cbsocial .obscure").addClass("show");
  5420.         socialAction.resizeExtenders();
  5421.         socialAction.getRecentData()
  5422.     },
  5423.     hideDropDown: function(c, b)
  5424.     {
  5425.         if (b)
  5426.         {
  5427.             socialAction.stuckMenu = 0;
  5428.             c.removeClass("stuck")
  5429.         }
  5430.         $("#cbsocial .obscure").removeClass("show");
  5431.         c.removeClass("show")
  5432.     },
  5433.     hideAllDropDowns: function(b)
  5434.     {
  5435.         $("#cbsocial > ul > li.show").each(function()
  5436.         {
  5437.             if (b == 2)
  5438.             {
  5439.                 $(this).addClass("dontreshow")
  5440.             }
  5441.             socialAction.hideDropDown($(this), b)
  5442.         })
  5443.     },
  5444.     hideStuckDropDown: function()
  5445.     {
  5446.         if (socialAction.stuckMenu)
  5447.         {
  5448.             socialAction.hideAllDropDowns(1)
  5449.         }
  5450.     },
  5451.     showUserDropDown: function(c, b)
  5452.     {
  5453.         c.siblings("li").removeClass("show");
  5454.         c.addClass("show");
  5455.         socialAction.resizeExtenders()
  5456.     },
  5457.     resizeExtenders: function()
  5458.     {
  5459.         if (socialAction.maintenanceMode == 2)
  5460.         {
  5461.             return
  5462.         }
  5463.         if (socialAction.makeCache)
  5464.         {
  5465.             return
  5466.         }
  5467.         $("#cbsocial .extend:visible").each(function()
  5468.         {
  5469.             var i = $(this);
  5470.             if (!i.prop("extra"))
  5471.             {
  5472.                 var j = i.offset().top;
  5473.                 var k = parseInt(i.css("top"));
  5474.                 if (j == 0 && k > 0)
  5475.                 {
  5476.                     j = k
  5477.                 }
  5478.                 i.prop("extra", i.outerHeight() - i.height() + j)
  5479.             }
  5480.         });
  5481.         var g = $(window).height();
  5482.         var f = $(document).height();
  5483.         if (isNaN(g) || isNaN(f))
  5484.         {
  5485.             return
  5486.         }
  5487.         var b = 0;
  5488.         var e = $("#cbsocial .extend:visible li.show > ul");
  5489.         for (var c = 0; c < e.length; c++)
  5490.         {
  5491.             var d = $(e[c]);
  5492.             var h = d.height() + d.offset().top;
  5493.             if (h > b)
  5494.             {
  5495.                 b = h
  5496.             }
  5497.         }
  5498.         $("#cbsocial .extend:visible").css("height", function()
  5499.         {
  5500.             var j = $(this);
  5501.             var i = b > 0 ? b : f;
  5502.             var k = (i > g ? i : g) - j.prop("extra");
  5503.             return k
  5504.         })
  5505.     },
  5506.     submitForm: function(e, c)
  5507.     {
  5508.         if (!c || !c.elements)
  5509.         {
  5510.             return
  5511.         }
  5512.         if ($(c).prop("stopsubmit") > 0)
  5513.         {
  5514.             return
  5515.         }
  5516.         var d = new Object();
  5517.         for (var b = 0; b < c.elements.length; b++)
  5518.         {
  5519.             if (c.elements[b].name && c.elements[b].value)
  5520.             {
  5521.                 d[c.elements[b].name] = c.elements[b].value
  5522.             }
  5523.         }
  5524.         if (e == "addsnip" && d.text && socialAction.isDuplicateSnip(d.text, true))
  5525.         {
  5526.             return
  5527.         }
  5528.         socialAction.socialCall(e, d)
  5529.     },
  5530.     prepareToAddSnip: function(d)
  5531.     {
  5532.         var c = $("#cbsocialcompose");
  5533.         var b = c.parent().parent();
  5534.         b.siblings(".show").removeClass("show");
  5535.         b.addClass("show");
  5536.         c.prop("already", c.val());
  5537.         c.val(d);
  5538.         c.keyup();
  5539.         socialAction.showDropDown($("#cbsocialsnipsmenu"), 1)
  5540.     },
  5541.     addSnip: function(c, d, b)
  5542.     {
  5543.         if (!socialAction.signedin)
  5544.         {
  5545.             return
  5546.         }
  5547.         if (socialAction.user.autosnip < 1)
  5548.         {
  5549.             return
  5550.         }
  5551.         if (b.length > socialAction.textareaMaxLengthSnip)
  5552.         {
  5553.             b = b.substr(0, socialAction.textareaMaxLengthSnip) + "..."
  5554.         }
  5555.         if (socialAction.isDuplicateSnip(b, false))
  5556.         {
  5557.             return
  5558.         }
  5559.         socialAction.socialCall("addsnip",
  5560.         {
  5561.             type: c,
  5562.             title: d,
  5563.             text: b
  5564.         })
  5565.     },
  5566.     isDuplicateSnip: function(d, b)
  5567.     {
  5568.         var f = 0;
  5569.         for (var c in socialAction.allsnips)
  5570.         {
  5571.             var e = socialAction.allsnips[c];
  5572.             if (e.parentid == 0 && e["mysnip" + socialAction.user.id] && e.sniptext == d)
  5573.             {
  5574.                 f = c
  5575.             }
  5576.         }
  5577.         if (f > 0 && b)
  5578.         {
  5579.             alert("This snip appears to be a duplicate of a previous one and so will not be posted.")
  5580.         }
  5581.         return f
  5582.     },
  5583.     charCounter: function()
  5584.     {
  5585.         var e = "";
  5586.         var d = $(this).val().length;
  5587.         var b = $(this).attr("id") == "cbsocialcompose";
  5588.         var c = b ? socialAction.textareaMaxLengthSnip : socialAction.textareaMaxLength;
  5589.         if (b)
  5590.         {
  5591.             $(this).parent().prop("stopsubmit", d > c ? 1 : 0);
  5592.             if (d > c)
  5593.             {
  5594.                 $(this).siblings("input[type=submit]").addClass("stopsubmit")
  5595.             }
  5596.             else
  5597.             {
  5598.                 $(this).siblings("input[type=submit]").removeClass("stopsubmit")
  5599.             }
  5600.         }
  5601.         else
  5602.         {
  5603.             if (d > c)
  5604.             {
  5605.                 d = c;
  5606.                 $(this).val($(this).val().substr(0, d))
  5607.             }
  5608.         }
  5609.         if (d > c * 0.8)
  5610.         {
  5611.             e += d + " of " + c
  5612.         }
  5613.         $("#cbsocial #" + $(this).attr("id") + "charcount").html(e)
  5614.     },
  5615.     getRecentData: function()
  5616.     {
  5617.         var b = socialAction.timeLookupCounter <= 0;
  5618.         socialAction.timeLookupCounter = socialAction.timeLookupCounterStart;
  5619.         if (b)
  5620.         {
  5621.             socialAction.getRecentDataContinue()
  5622.         }
  5623.     },
  5624.     getRecentDataContinue: function()
  5625.     {
  5626.         if (!socialAction.isSignedIn())
  5627.         {
  5628.             return
  5629.         }
  5630.         if (!socialAction.timeServer || !socialAction.timeLookupDelay)
  5631.         {
  5632.             return
  5633.         }
  5634.         if (socialAction.timeLookupCounter <= 0)
  5635.         {
  5636.             return
  5637.         }
  5638.         socialAction.timeLookupCounter--;
  5639.         setTimeout(socialAction.getRecentDataInner, socialAction.timeLookupDelay * 1000)
  5640.     },
  5641.     getRecentDataInner: function()
  5642.     {
  5643.         socialAction.socialCall("getrecent",
  5644.         {
  5645.             sincedate: socialAction.timeServer
  5646.         }, true)
  5647.     },
  5648.     getHowManyEachTime: function(d)
  5649.     {
  5650.         var b = Math.max(document.body ? document.body.scrollHeight : 0, document.documentElement ? document.documentElement.scrollHeight : 0, document.body ? document.body.offsetHeight : 0, document.documentElement ? document.documentElement.offsetHeight : 0, document.body ? document.body.clientHeight : 0, document.documentElement ? document.documentElement.clientHeight : 0, document.height, socialAction.loadEachTime);
  5651.         var c = ((b ? b : 0) / 70) - 1;
  5652.         if (c < socialAction.loadEachTime)
  5653.         {
  5654.             return socialAction.loadEachTime
  5655.         }
  5656.         if (!d)
  5657.         {
  5658.             d = 10
  5659.         }
  5660.         return Math.ceil(c / d) * d
  5661.     },
  5662.     getUserData: function(b, d)
  5663.     {
  5664.         if (socialAction.allusers[b] && socialAction.allusers[b].hasFullData)
  5665.         {
  5666.             socialAction.displayUserView(b)
  5667.         }
  5668.         else
  5669.         {
  5670.             var c = {};
  5671.             if (b)
  5672.             {
  5673.                 c.userid = b
  5674.             }
  5675.             else
  5676.             {
  5677.                 if (d)
  5678.                 {
  5679.                     c.username = d
  5680.                 }
  5681.                 else
  5682.                 {
  5683.                     return
  5684.                 }
  5685.             }
  5686.             c.howmany = socialAction.getHowManyEachTime(5);
  5687.             socialAction.socialCall("getuser", c)
  5688.         }
  5689.     },
  5690.     createBgGradient: function(b, d, c)
  5691.     {
  5692.         $(b).css("background-color", c);
  5693.         $(b).css("background", "-webkit-gradient(linear, 0% 0%, 0% 100%, from(" + d + "), to(" + c + "))");
  5694.         $(b).css("background", "-webkit-linear-gradient(bottom, " + d + ", " + c + ")");
  5695.         $(b).css("background", "-moz-linear-gradient(bottom, " + d + ", " + c + ")");
  5696.         $(b).css("background", "-ms-linear-gradient(bottom, " + d + ", " + c + ")");
  5697.         $(b).css("background", "-o-linear-gradient(bottom, " + d + ", " + c + ")")
  5698.     },
  5699.     drawUserHeader: function(b)
  5700.     {
  5701.         var c = socialAction.allusers[b];
  5702.         if (!c)
  5703.         {
  5704.             return
  5705.         }
  5706.         var d = $("#cbsocial div.viewuser div.header");
  5707.         d.empty();
  5708.         socialAction.makeUserSnipDetails(d, c, null, socialAction.user.id != c.id, false, true)
  5709.     },
  5710.     displayUserView: function(c, h, f)
  5711.     {
  5712.         var d = socialAction.allusers[c];
  5713.         if (!d)
  5714.         {
  5715.             return
  5716.         }
  5717.         if (d.id == socialAction.lookingAtUserid)
  5718.         {
  5719.             return
  5720.         }
  5721.         d.hasFullData = true;
  5722.         var b = $("#cbsocial div.obscureuser");
  5723.         var g = $("#cbsocial div.viewuser");
  5724.         g.attr("id", "viewuser" + c);
  5725.         var i = $("#cbsocial div.viewuser div.header");
  5726.         g.css("background-image", "");
  5727.         i.removeClass("noimage");
  5728.         i.removeClass("noheadercolourborder");
  5729.         i.css("background-color", "");
  5730.         b.removeClass("noheadercolour");
  5731.         socialAction.drawUserHeader(c);
  5732.         if (!d.headerlocation)
  5733.         {
  5734.             i.addClass("noimage")
  5735.         }
  5736.         else
  5737.         {
  5738.             g.css("background-image", "url(" + d.headerlocation + ")");
  5739.             if (!d.headercolourborder)
  5740.             {
  5741.                 b.addClass("noheadercolourborder")
  5742.             }
  5743.             else
  5744.             {
  5745.                 b.css("background-color", d.headercolourborder)
  5746.             }
  5747.             if (d.headercolour)
  5748.             {
  5749.                 i.css("background-color", d.headercolour)
  5750.             }
  5751.         }
  5752.         if (typeof h == "undefined")
  5753.         {
  5754.             socialAction.lookingAtHistory.push(
  5755.             {
  5756.                 userid: socialAction.lookingAtUserid,
  5757.                 tab: socialAction.lookingAtTab
  5758.             })
  5759.         }
  5760.         socialAction.lookingAtUserid = d.id;
  5761.         socialAction.lookingAtTab = h ? h : "";
  5762.         if (socialAction.lookingAtHistory.length >= 2)
  5763.         {
  5764.             $("#cbsocial div.viewuser > ul > li.backbutton").show()
  5765.         }
  5766.         else
  5767.         {
  5768.             if (!socialAction.makeCache)
  5769.             {
  5770.                 $("#cbsocial div.viewuser > ul > li.backbutton").hide()
  5771.             }
  5772.         }
  5773.         socialAction.remakeDataLists(d.id);
  5774.         $("#cbsocial div.viewuser > ul > li").removeClass("show");
  5775.         var e = h ? ("#" + h) : "li.showdefault";
  5776.         $("#cbsocial div.viewuser > ul > " + e).addClass("show");
  5777.         $("#cbsocial div.viewuser").addClass("show");
  5778.         $("#cbsocial div.obscureuser").addClass("show");
  5779.         socialAction.resizeExtenders();
  5780.         if (!socialAction.makeCache)
  5781.         {
  5782.             window.scrollTo(0, 0)
  5783.         }
  5784.     },
  5785.     displaySnipView: function(b)
  5786.     {
  5787.         $("#cbsocial > div.viewuser > ul").addClass("showonesnip");
  5788.         $("#cbsocial > div.viewuser > ul li.show").removeClass("show");
  5789.         $("#cbsocial > div.viewuser > ul li.onesnip").addClass("show");
  5790.         socialAction.makeSnipList("cbsocialsnipsonesnip_user", 0, "onesnip", 0, 0, b.id)
  5791.     },
  5792.     closeUserView: function()
  5793.     {
  5794.         if (socialAction.fromCache && socialAction.lookingAtHistory.length <= 1)
  5795.         {
  5796.             window.location.href = "http://www.cleverbot.com/"
  5797.         }
  5798.         else
  5799.         {
  5800.             socialAction.closeUserViewInner()
  5801.         }
  5802.     },
  5803.     closeUserViewInner: function()
  5804.     {
  5805.         var b = socialAction.lookingAtHistory.length ? socialAction.lookingAtHistory.pop() :
  5806.         {};
  5807.         if (b.userid)
  5808.         {
  5809.             socialAction.displayUserView(b.userid, b.tab)
  5810.         }
  5811.         else
  5812.         {
  5813.             socialAction.lookingAtUserid = 0;
  5814.             socialAction.lookingAtTab = "";
  5815.             $("#cbsocial > div.obscureuser").removeClass("show");
  5816.             $("#cbsocial > div.viewuser").removeClass("show")
  5817.         }
  5818.     },
  5819.     convertDateToSeconds: function(c)
  5820.     {
  5821.         var b = Date.parse(c);
  5822.         if (isNaN(b))
  5823.         {
  5824.             return -1
  5825.         }
  5826.         b -= socialAction.timeDifference;
  5827.         return b
  5828.     },
  5829.     getFullDate: function(i, f)
  5830.     {
  5831.         if (!i)
  5832.         {
  5833.             return "never"
  5834.         }
  5835.         var c = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
  5836.         var g = new Date();
  5837.         var b = i ? new Date(i) : g;
  5838.         var e = "";
  5839.         if (f && (b.getDate() + " " + b.getMonth() + " " + b.getFullYear()) == (g.getDate() + " " + g.getMonth() + " " + g.getFullYear()))
  5840.         {
  5841.             e += "Today "
  5842.         }
  5843.         else
  5844.         {
  5845.             e += b.getDate() + " " + c[b.getMonth()] + " ";
  5846.             if (!f || b.getFullYear() != g.getFullYear())
  5847.             {
  5848.                 e += b.getFullYear() + " "
  5849.             }
  5850.         }
  5851.         var h = b.getMinutes();
  5852.         e += (f ? "at " : " ") + b.getHours() + ":" + ((h < 10 ? "0" : "") + h);
  5853.         return e
  5854.     },
  5855.     getSecondsSince: function(b)
  5856.     {
  5857.         return Math.round(((new Date()).getTime() - b) / 1000)
  5858.     },
  5859.     computeTimeSince: function(b)
  5860.     {
  5861.         if (b < 0)
  5862.         {
  5863.             return ""
  5864.         }
  5865.         b = socialAction.getSecondsSince(b);
  5866.         if (b < 0)
  5867.         {
  5868.             return ""
  5869.         }
  5870.         if (b <= 1)
  5871.         {
  5872.             return "now"
  5873.         }
  5874.         if (b < 60)
  5875.         {
  5876.             return b + "s"
  5877.         }
  5878.         b = Math.round(b / 60);
  5879.         if (b < 60)
  5880.         {
  5881.             return b + "m"
  5882.         }
  5883.         b = Math.round(b / 60);
  5884.         if (b < 60)
  5885.         {
  5886.             return b + "h"
  5887.         }
  5888.         b = Math.round(b / 24);
  5889.         if (b < 7)
  5890.         {
  5891.             return b + "d"
  5892.         }
  5893.         var c = Math.round(b / 7);
  5894.         if (c < 52)
  5895.         {
  5896.             return c + "w"
  5897.         }
  5898.         b = Math.round(b / 365);
  5899.         return b + "y"
  5900.     },
  5901.     setSnipRating: function()
  5902.     {
  5903.         var f = $(this).children("input[name=snipid]").attr("value");
  5904.         var h = socialAction.allsnips[f];
  5905.         if (!h)
  5906.         {
  5907.             return
  5908.         }
  5909.         var b = h.ratingstars + " from " + h.ratingscount + " rating";
  5910.         b += (h.ratingscount == 1 ? "" : "s") + ", ";
  5911.         b += h.ratingbyme > 0 ? ("rated " + h.ratingbyme + " by me") : "rate me!";
  5912.         var d = $(this).children("img.star");
  5913.         for (var e = 1; e <= d.length; e++)
  5914.         {
  5915.             var i = d.eq(e - 1);
  5916.             if (h.ratingbyme > 0)
  5917.             {
  5918.                 i.removeClass("rated")
  5919.             }
  5920.             else
  5921.             {
  5922.                 i.addClass("rated")
  5923.             }
  5924.             var g = h.ratingscountmax > 0 ? ("_" + Math.round(10 * h.ratingscount / h.ratingscountmax)) : "";
  5925.             var c = h.ratingstars >= e ? "full" : ((e - h.ratingstars) * 2 == 1 ? "half" : "empty");
  5926.             i.attr("src", socialAction.imageBase + "star_" + c + g + ".png");
  5927.             i.attr("title", b)
  5928.         }
  5929.     },
  5930.     shareSnip: function(c, b)
  5931.     {
  5932.         var e = socialAction.allsnips[b];
  5933.         if (!e)
  5934.         {
  5935.             return
  5936.         }
  5937.         var d = encodeURIComponent("http://www.cleverbot.com/");
  5938.         var g = encodeURIComponent("Snip! from Cleverbot");
  5939.         var f = encodeURIComponent(e.sniptext);
  5940.         switch (c)
  5941.         {
  5942.             case "email":
  5943.                 window.location.href = "mailto:?subject=" + g + "&body=" + f;
  5944.                 break;
  5945.             case "facebook":
  5946.                 var g = "Snip! from Cleverbot";
  5947.                 window.open("http://www.facebook.com/sharer/sharer.php?s=100&p[title]=" + g + "&p[summary]=" + f + "&p[url]=" + d, "", "width=626,height=436");
  5948.                 break;
  5949.             case "twitter":
  5950.                 f = f.replace(/%23cleverbot/g, "%40cleverbot");
  5951.                 window.open("https://twitter.com/share?text=" + f, "", "menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600");
  5952.                 break;
  5953.             case "gplus":
  5954.                 window.open("https://plus.google.com/share?url=" + d, "", "menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600");
  5955.                 break;
  5956.             case "tumblr":
  5957.                 var g = "Snip! from Cleverbot";
  5958.                 window.open("http://www.tumblr.com/share/link?url=" + d + "&name=" + g + "&description=" + f, "", "menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=500,width=600");
  5959.                 break
  5960.         }
  5961.     },
  5962.     sortSnipsByTime: function(e, c)
  5963.     {
  5964.         var g = socialAction.allsnips[e].lookuporder;
  5965.         var f = socialAction.allsnips[c].lookuporder;
  5966.         if (g > 0 && f > 0)
  5967.         {
  5968.             return g - f
  5969.         }
  5970.         var h = socialAction.allsnips[c].sniptime - socialAction.allsnips[e].sniptime;
  5971.         return isNaN(h) ? 0 : h
  5972.     },
  5973.     sortSnipsByRating: function(e, c)
  5974.     {
  5975.         var f = socialAction.allsnips[c].ratingorder - socialAction.allsnips[e].ratingorder;
  5976.         return isNaN(f) ? 0 : (f == 0 ? socialAction.sortSnipsByTime(e, c) : f)
  5977.     },
  5978.     makeSnipList: function(A, h, g, H, E, C, v)
  5979.     {
  5980.         var u = $("#" + A).children("ul");
  5981.         u.children().remove();
  5982.         var n = new Array();
  5983.         var t = 0;
  5984.         for (var d in socialAction.allsnips)
  5985.         {
  5986.             var e = socialAction.allsnips[d];
  5987.             if (e.parentid > 0)
  5988.             {
  5989.                 continue
  5990.             }
  5991.             if (g == "timeline" && !e["timeline" + h])
  5992.             {
  5993.                 continue
  5994.             }
  5995.             if (g == "mysnip" && !e["mysnip" + h])
  5996.             {
  5997.                 continue
  5998.             }
  5999.             if (g == "search" && e.snipsearch != socialAction.lastSearch)
  6000.             {
  6001.                 continue
  6002.             }
  6003.             if (g == "star" && !e.star)
  6004.             {
  6005.                 continue
  6006.             }
  6007.             if (g == "onesnip" && e.id != C)
  6008.             {
  6009.                 continue
  6010.             }
  6011.             if (H && e.ratingstars < 2)
  6012.             {
  6013.                 continue
  6014.             }
  6015.             if (e.ratingscount > t)
  6016.             {
  6017.                 t = e.ratingscount
  6018.             }
  6019.             n.push(d)
  6020.         }
  6021.         n.sort(H ? socialAction.sortSnipsByRating : socialAction.sortSnipsByTime);
  6022.         var l = 180;
  6023.         var m = 0;
  6024.         for (var M = 0; M < n.length; M++)
  6025.         {
  6026.             var e = socialAction.allsnips[n[M]];
  6027.             var x = socialAction.allusers[e.userid];
  6028.             if (!x)
  6029.             {
  6030.                 continue
  6031.             }
  6032.             var K = e.children ? e.children.length : 0;
  6033.             var I = parseInt(e.numchildren);
  6034.             var N = "socialdata parentsnip" + e.id;
  6035.             if (e.userid != socialAction.user.id && e.sniptime > v && !e["recentshown" + A])
  6036.             {
  6037.                 m++;
  6038.                 N += " recent";
  6039.                 e["recentshown" + A] = 1
  6040.             }
  6041.             if (I == 0)
  6042.             {
  6043.                 N += " nochildren"
  6044.             }
  6045.             var b = socialAction.makeElement("li", false, N, u);
  6046.             e.ratingscountmax = t;
  6047.             socialAction.makeUserSnipDetails(b, x, e, true, true, false);
  6048.             if (K > 0)
  6049.             {
  6050.                 var o = socialAction.makeElement("ul", false, false, b);
  6051.                 for (var L = 0; L < K; L++)
  6052.                 {
  6053.                     var O = socialAction.allsnips[e.children[L]];
  6054.                     if (!O)
  6055.                     {
  6056.                         continue
  6057.                     }
  6058.                     var q = socialAction.allusers[O.userid];
  6059.                     if (!q)
  6060.                     {
  6061.                         continue
  6062.                     }
  6063.                     var D = L > 0 && socialAction.getSecondsSince(O.sniptimeoriginal) > l;
  6064.                     var N = "socialdata";
  6065.                     if (O.sniptime > v && !e["recentshown" + A])
  6066.                     {
  6067.                         m++;
  6068.                         N += " recent";
  6069.                         e["recentshown" + A] = 1
  6070.                     }
  6071.                     if (D)
  6072.                     {
  6073.                         N += " oldsnip"
  6074.                     }
  6075.                     var k = socialAction.makeElement("li", false, N, o);
  6076.                     socialAction.makeUserSnipDetails(k, q, O, q.id != x.id, false, false);
  6077.                     socialAction.makeElement("div", false, "clear", k)
  6078.                 }
  6079.             }
  6080.             var J = socialAction.makeElement("p", false, "replymore", b);
  6081.             var s = null;
  6082.             if (!x.isstats && socialAction.isSignedIn())
  6083.             {
  6084.                 s = socialAction.makeElement("span", false, "reply", J, "reply");
  6085.                 $(s).click(new Function("socialAction.replyingtoid=" + e.id + "; var f = $(this).parent().siblings ('form.replyform'); f.toggle (500); f.children('textarea').focus();"));
  6086.                 socialAction.makeElement("span", "cbsocialreplyarea" + e.id + "charcount", "charcount", s)
  6087.             }
  6088.             if (socialAction.isSignedIn() && I > 1 && K < I)
  6089.             {
  6090.                 var w = I - K;
  6091.                 if (w > socialAction.loadEachTime)
  6092.                 {
  6093.                     w = socialAction.loadEachTime
  6094.                 }
  6095.                 var B = socialAction.makeElement("span", false, "moreless", J, w + " more",
  6096.                 {
  6097.                     title: I + " in total"
  6098.                 });
  6099.                 $(B).prop("snipid", e.id);
  6100.                 $(B).click(function()
  6101.                 {
  6102.                     var Q = socialAction.allsnips[$(this).prop("snipid")];
  6103.                     if (!Q)
  6104.                     {
  6105.                         return
  6106.                     }
  6107.                     var i = Q.children ? Q.children.length : 0;
  6108.                     var j = {
  6109.                         snipid: Q.id,
  6110.                         offset: i
  6111.                     };
  6112.                     socialAction.socialCall("getreplies", j)
  6113.                 })
  6114.             }
  6115.             if (!x.isstats && socialAction.isSignedIn())
  6116.             {
  6117.                 var P = ["email", "facebook", "twitter", "gplus", "tumblr"];
  6118.                 var p = socialAction.makeElement("div", false, "sharebuttons", J);
  6119.                 for (var L = 0; L < P.length; L++)
  6120.                 {
  6121.                     var G = socialAction.makeElement("div", false, P[L], p);
  6122.                     $(G).click(new Function("socialAction.shareSnip('" + P[L] + "'," + e.id + ")"))
  6123.                 }
  6124.             }
  6125.             socialAction.makeElement("p", "", "message cbsocialmessagesnip" + e.id, b);
  6126.             if (!x.isstats && socialAction.isSignedIn())
  6127.             {
  6128.                 var c = socialAction.makeElement("form", false, "replyform", b, false, "addsnip");
  6129.                 socialAction.makeElement("input", false, false, c, false,
  6130.                 {
  6131.                     name: "parentid",
  6132.                     type: "hidden",
  6133.                     value: e.id
  6134.                 });
  6135.                 socialAction.makeElement("input", false, false, c, false,
  6136.                 {
  6137.                     name: "parentuserid",
  6138.                     type: "hidden",
  6139.                     value: e.userid
  6140.                 });
  6141.                 socialAction.makeElement("input", false, "cbsocialbuttonreply", c, false,
  6142.                 {
  6143.                     type: "submit",
  6144.                     value: "reply"
  6145.                 });
  6146.                 var f = socialAction.makeElement("textarea", "cbsocialreplyarea" + e.id, false, c, false,
  6147.                 {
  6148.                     name: "text",
  6149.                     rows: 3
  6150.                 });
  6151.                 $(f).keyup(socialAction.charCounter);
  6152.                 if (e.id != socialAction.replyingtoid)
  6153.                 {
  6154.                     $(c).hide()
  6155.                 }
  6156.             }
  6157.             socialAction.makeElement("div", false, "clear", b)
  6158.         }
  6159.         var z = 0;
  6160.         if (h && socialAction.allusers[h])
  6161.         {
  6162.             if (g == "mysnip" && !H)
  6163.             {
  6164.                 z = socialAction.allusers[h].numsnips
  6165.             }
  6166.         }
  6167.         if (z < n.length)
  6168.         {
  6169.             z = n.length
  6170.         }
  6171.         if (g == "search" && (n.length % socialAction.loadEachTime == 0))
  6172.         {
  6173.             z += "+"
  6174.         }
  6175.         u.siblings().children("span.unbold").html(": " + z);
  6176.         u.siblings().children("span.bold").html(z);
  6177.         u.siblings("h3").attr("title", z + " snips");
  6178.         if (m)
  6179.         {
  6180.             u.find("li.recent").removeClass("recent", 5000)
  6181.         }
  6182.         if (!n.length)
  6183.         {
  6184.             socialAction.makeElement("li", false, "nothingtoshow", u, "no snips yet!")
  6185.         }
  6186.         return n.length
  6187.     },
  6188.     makeUserSnipDetails: function(b, t, E, H, v, h, s)
  6189.     {
  6190.         var f = socialAction.makeElement("div", false, "followrateforms", b);
  6191.         if (H && t && !t.isstats)
  6192.         {
  6193.             var A = socialAction.user.id;
  6194.             var c = t["following" + A];
  6195.             var i = socialAction.makeElement("form", false, false, f, false, c ? "unfollow" : "follow");
  6196.             var g = t.id == A;
  6197.             socialAction.makeElement("input", false, false, i, false,
  6198.             {
  6199.                 name: "followingid",
  6200.                 type: "hidden",
  6201.                 value: t.id
  6202.             });
  6203.             var q = c ? "following" : (g ? "this is me" : "follow");
  6204.             if (!socialAction.isSignedIn())
  6205.             {
  6206.                 socialAction.makeElement("input", false, "signintofollow", i, false,
  6207.                 {
  6208.                     type: "button",
  6209.                     value: "sign in to follow"
  6210.                 })
  6211.             }
  6212.             else
  6213.             {
  6214.                 var n = socialAction.makeElement("input", false, "followornot" + (g ? " thisisme" : "") + (c ? " following" : ""), i, false,
  6215.                 {
  6216.                     type: "submit",
  6217.                     value: q
  6218.                 });
  6219.                 if (c)
  6220.                 {
  6221.                     $(n).hover(function()
  6222.                     {
  6223.                         if ($(this).val() == "following")
  6224.                         {
  6225.                             $(this).addClass("unfollow");
  6226.                             $(this).val("unfollow")
  6227.                         }
  6228.                     }, function()
  6229.                     {
  6230.                         if ($(this).val() == "unfollow")
  6231.                         {
  6232.                             $(this).removeClass("unfollow");
  6233.                             $(this).val("following")
  6234.                         }
  6235.                     })
  6236.                 }
  6237.             }
  6238.             if (h)
  6239.             {
  6240.                 var l = encodeURIComponent("I want to report the user " + t.username + " because...");
  6241.                 var I = encodeURIComponent("userid=" + (socialAction.isSignedIn() ? socialAction.user.id : "not signed in") + ", reporting user=" + t.id + " " + t.username);
  6242.                 var G = "http://www.cleverbot.com/contact?extra=" + I + "&pre=" + l;
  6243.                 if (socialAction.isSignedIn())
  6244.                 {
  6245.                     G += "&email=" + socialAction.user.email
  6246.                 }
  6247.                 var x = socialAction.makeElement("a", false, "reportuser", f, "report this user",
  6248.                 {
  6249.                     href: G,
  6250.                     target: "_blank"
  6251.                 });
  6252.                 if (!socialAction.makeCache)
  6253.                 {
  6254.                     $(x).click(function()
  6255.                     {
  6256.                         socialAction.socialCall("reportuser",
  6257.                         {
  6258.                             userid: t.id
  6259.                         })
  6260.                     })
  6261.                 }
  6262.             }
  6263.         }
  6264.         if (v && E && !t.isstats)
  6265.         {
  6266.             var D = socialAction.makeElement("form", false, false, f, false, "rate");
  6267.             socialAction.makeElement("input", false, false, D, false,
  6268.             {
  6269.                 name: "snipid",
  6270.                 type: "hidden",
  6271.                 value: E.id
  6272.             });
  6273.             socialAction.makeElement("input", false, false, D, false,
  6274.             {
  6275.                 name: "rating",
  6276.                 type: "hidden",
  6277.                 value: 0
  6278.             });
  6279.             for (var B = 1; B <= 3; B++)
  6280.             {
  6281.                 socialAction.makeElement("img", false, "star", D)
  6282.             }
  6283.             $(D).each(socialAction.setSnipRating)
  6284.         }
  6285.         var d = t.username ? t.username : "";
  6286.         if (d.length > 25)
  6287.         {
  6288.             d = d.substring(0, 24) + "..."
  6289.         }
  6290.         var o = "www.cleverbot.com/me/" + t.username;
  6291.         var m = "www.cleverbot.com/me/" + d;
  6292.         var u = {};
  6293.         if (!socialAction.fromCache)
  6294.         {
  6295.             u.onclick = "socialAction.getUserData(" + (t ? t.id : E.userid) + ");return false;"
  6296.         }
  6297.         u.href = "http://" + o;
  6298.         var J = socialAction.makeElement("a", false, false, b, false, u);
  6299.         socialAction.makeElement("img", false, false, J, false,
  6300.         {
  6301.             src: t.photolocation
  6302.         });
  6303.         var w = socialAction.makeElement("p", false, false, b);
  6304.         var z = !t.isstats && socialAction.canAdminister() ? "*" : "";
  6305.         var C = socialAction.makeElement("span", false, "fullname", w, t.fullname + z);
  6306.         if (z)
  6307.         {
  6308.             $(C).click(new Function("socialAction.administerUserSnip(" + (t ? t.id : E.userid) + ",0);"))
  6309.         }
  6310.         else
  6311.         {
  6312.             if (!h && !socialAction.makeCache)
  6313.             {
  6314.                 $(C).click(new Function("socialAction.getUserData(" + (t ? t.id : E.userid) + ");"))
  6315.             }
  6316.         }
  6317.         if (!h && t && t.fullname && t.username && t.fullname.length + t.username.length > 30)
  6318.         {
  6319.             socialAction.makeElement("br", false, false, w)
  6320.         }
  6321.         socialAction.makeElement("a", false, "username", w, "@" + d, u);
  6322.         if (E && !t.isstats)
  6323.         {
  6324.             C = socialAction.makeElement("span", false, "timesince", w, socialAction.computeTimeSince(E.sniptimeoriginal) + z,
  6325.             {
  6326.                 title: "snipped " + socialAction.getFullDate(E.createddate, 1)
  6327.             });
  6328.             if (E.id && z)
  6329.             {
  6330.                 $(C).click(new Function("socialAction.administerUserSnip(0," + E.id + ");"))
  6331.             }
  6332.             var e = socialAction.makeElement("p", false, false, b, socialAction.addLinksToText(E.sniptext));
  6333.             if (!socialAction.makeCache)
  6334.             {
  6335.                 $(e).click(function()
  6336.                 {
  6337.                     socialAction.displaySnipView(E)
  6338.                 })
  6339.             }
  6340.             if (E.userid == socialAction.user.id)
  6341.             {
  6342.                 var k = socialAction.makeElement("form", false, false, e, false, "savesnip");
  6343.                 socialAction.makeElement("input", false, false, k, false,
  6344.                 {
  6345.                     type: "hidden",
  6346.                     name: "id",
  6347.                     value: E.id
  6348.                 });
  6349.                 socialAction.makeElement("input", false, false, k, false,
  6350.                 {
  6351.                     type: "hidden",
  6352.                     name: "userid",
  6353.                     value: E.userid
  6354.                 });
  6355.                 socialAction.makeElement("input", false, false, k, false,
  6356.                 {
  6357.                     type: "hidden",
  6358.                     name: "onlyifme",
  6359.                     value: "yes"
  6360.                 });
  6361.                 socialAction.addDeleteButtonToForm(k, "delete", "delete this snip")
  6362.             }
  6363.         }
  6364.         else
  6365.         {
  6366.             if (!h && s && t[s])
  6367.             {
  6368.                 socialAction.makeElement("span", false, "timesince", w, socialAction.computeTimeSince(t[s.replace("date", "time")]),
  6369.                 {
  6370.                     title: "since " + socialAction.getFullDate(t[s], 1)
  6371.                 })
  6372.             }
  6373.             if (h)
  6374.             {
  6375.                 socialAction.makeElement("a", false, false, b, m + "<br/>" + t.location,
  6376.                 {
  6377.                     href: "http://" + o,
  6378.                     target: "_blank"
  6379.                 })
  6380.             }
  6381.             socialAction.makeElement("p", false, false, b, t.biography)
  6382.         }
  6383.     },
  6384.     addLinksToText: function(c)
  6385.     {
  6386.         if (!c)
  6387.         {
  6388.             return ""
  6389.         }
  6390.         var b = /\b(?:https?|ftp):\/\/[a-z0-9-+&@#\/%?=~_|!:,.;]*[a-z0-9-+&@#\/%=~_|]/gim;
  6391.         var d = /(^|[^\/])(www\.[\S]+(\b|$))/gim;
  6392.         return c.replace(b, '<a href="$&" target="_blank">$&</a>').replace(d, '$1<a href="http://$2" target="_blank">$2</a>')
  6393.     },
  6394.     administerUserSnip: function(h, k)
  6395.     {
  6396.         var d = h ? socialAction.allusers[h] : null;
  6397.         var f = k ? socialAction.allsnips[k] : null;
  6398.         if (!d && !f)
  6399.         {
  6400.             return
  6401.         }
  6402.         var l = f ? "snip" : "person";
  6403.         var e = $("#cbsocial .admin");
  6404.         e.empty();
  6405.         socialAction.makeElement("h3", false, false, e, "Administer a " + l);
  6406.         var b = "";
  6407.         if (d)
  6408.         {
  6409.             b += "User ID: " + d.id + "<br/>";
  6410.             b += "Signed up: " + socialAction.getFullDate(d.createddate) + "<br/>";
  6411.             b += "Verified: " + socialAction.getFullDate(d.verificationdate) + "<br/>";
  6412.             b += "Last login: " + socialAction.getFullDate(d.logindate) + "<br/>";
  6413.             b += "Num logins: " + d.logintimes + "<br/>";
  6414.             b += "Num reports: " + d.reporttimes + "<br/>";
  6415.             if (d["followingdate" + socialAction.user.id])
  6416.             {
  6417.                 b += "I'm following since: " + socialAction.getFullDate(d["followingdate" + socialAction.user.id]) + "<br/>"
  6418.             }
  6419.             if (d["followerdate" + socialAction.user.id])
  6420.             {
  6421.                 b += "Follower of me since: " + socialAction.getFullDate(d["followerdate" + socialAction.user.id]) + "<br/>"
  6422.             }
  6423.         }
  6424.         else
  6425.         {
  6426.             b += "Snip ID: " + f.id + "<br/>";
  6427.             if (f.parentid)
  6428.             {
  6429.                 b += "In reply to ID: " + f.parentid + "<br/>"
  6430.             }
  6431.             b += "Snipped: " + socialAction.getFullDate(f.sniptimeoriginal, true) + "<br/>";
  6432.             b += "By: @" + f.username + " (" + f.fullname + ")<br/>";
  6433.             b += "Rated: " + f.ratingstars + " from " + f.ratingscount + " ratings<br/>";
  6434.             b += "Rating score: " + f.ratingorder + " = " + f.ratingexplanation + "<br/>"
  6435.         }
  6436.         socialAction.makeElement("p", false, false, e, b);
  6437.         var j = socialAction.makeElement("form", false, false, e, false, (l == "person" ? "saveuser" : "savesnip"));
  6438.         socialAction.makeElement("input", false, false, j, false,
  6439.         {
  6440.             name: "id",
  6441.             type: "hidden",
  6442.             value: d ? d.id : f.id
  6443.         });
  6444.         socialAction.makeElement("input", false, false, j, false,
  6445.         {
  6446.             name: "table",
  6447.             type: "hidden",
  6448.             value: d ? "users" : "snips"
  6449.         });
  6450.         if (d)
  6451.         {
  6452.             socialAction.makeElement("label", false, false, j, "User name");
  6453.             socialAction.makeElement("input", false, false, j, false,
  6454.             {
  6455.                 name: "username",
  6456.                 type: "text",
  6457.                 value: d.username
  6458.             });
  6459.             socialAction.makeElement("label", false, false, j, "Full name");
  6460.             socialAction.makeElement("input", false, false, j, false,
  6461.             {
  6462.                 name: "fullname",
  6463.                 type: "text",
  6464.                 value: d.fullname
  6465.             });
  6466.             if (!d.verificationdate)
  6467.             {
  6468.                 socialAction.makeElement("label", false, false, j, "Verification?");
  6469.                 socialAction.makeElement("select", false, false, j, ["no", "resend", "verify"],
  6470.                 {
  6471.                     name: "resendverification"
  6472.                 })
  6473.             }
  6474.             socialAction.makeElement("label", false, false, j, "Email");
  6475.             socialAction.makeElement("input", false, false, j, false,
  6476.             {
  6477.                 name: "email",
  6478.                 type: "text",
  6479.                 value: d.email
  6480.             });
  6481.             socialAction.makeElement("label", false, false, j, "Suggested user");
  6482.             var m = new Array("no");
  6483.             for (var g = 1; g < 20; g++)
  6484.             {
  6485.                 m.push(g)
  6486.             }
  6487.             socialAction.makeElement("select", false, false, j, m,
  6488.             {
  6489.                 name: "suggested",
  6490.                 value: d.suggested > 0 ? d.suggested : "no"
  6491.             });
  6492.             socialAction.makeElement("br", false, false, j);
  6493.             socialAction.makeElement("label", false, false, j, "Biography");
  6494.             socialAction.makeElement("textarea", false, false, j, d.biography,
  6495.             {
  6496.                 name: "biography"
  6497.             })
  6498.         }
  6499.         else
  6500.         {
  6501.             socialAction.makeElement("input", false, false, j, false,
  6502.             {
  6503.                 name: "id",
  6504.                 type: "hidden",
  6505.                 value: f.id
  6506.             });
  6507.             socialAction.makeElement("input", false, false, j, false,
  6508.             {
  6509.                 name: "userid",
  6510.                 type: "hidden",
  6511.                 value: f.userid
  6512.             });
  6513.             socialAction.makeElement("input", false, false, j, false,
  6514.             {
  6515.                 name: "parentid",
  6516.                 type: "hidden",
  6517.                 value: f.parentid
  6518.             });
  6519.             socialAction.makeElement("label", false, false, j, "Banned from stars?");
  6520.             socialAction.makeElement("select", false, false, j, ["no", "yes"],
  6521.             {
  6522.                 name: "unstar",
  6523.                 value: (f.unstar > 0 ? "yes" : "no")
  6524.             });
  6525.             socialAction.makeElement("br", false, false, j);
  6526.             socialAction.makeElement("label", false, false, j, "Snip");
  6527.             socialAction.makeElement("textarea", false, false, j, f.sniptext,
  6528.             {
  6529.                 name: "sniptext"
  6530.             })
  6531.         }
  6532.         socialAction.makeElement("input", false, false, j, false,
  6533.         {
  6534.             type: "submit",
  6535.             value: "save " + l
  6536.         });
  6537.         var c = socialAction.makeElement("input", false, false, j, false,
  6538.         {
  6539.             type: "button",
  6540.             value: "cancel"
  6541.         });
  6542.         $(c).click(function()
  6543.         {
  6544.             $("#cbsocial .admin").removeClass("show")
  6545.         });
  6546.         socialAction.addDeleteButtonToForm(j, "delete", "delete this " + l);
  6547.         e.addClass("show")
  6548.     },
  6549.     sortUsersByFollowDate: function(f, c)
  6550.     {
  6551.         var i = socialAction.allusers[f].lookuporder;
  6552.         var h = socialAction.allusers[c].lookuporder;
  6553.         if (i > 0 && h > 0)
  6554.         {
  6555.             return i - h
  6556.         }
  6557.         if (socialAction.sortFieldTemp)
  6558.         {
  6559.             var j = socialAction.allusers[c][socialAction.sortFieldTemp] - socialAction.allusers[f][socialAction.sortFieldTemp];
  6560.             if (j)
  6561.             {
  6562.                 return j
  6563.             }
  6564.         }
  6565.         var e = socialAction.allusers[f].username;
  6566.         var g = socialAction.allusers[c].username;
  6567.         return e && g ? e.localeCompare(g) : 0
  6568.     },
  6569.     sortUsersBySuggested: function(e, c)
  6570.     {
  6571.         var d = socialAction.allusers[e].suggested;
  6572.         var f = socialAction.allusers[c].suggested;
  6573.         return d - f
  6574.     },
  6575.     makeUserList: function(g, j, o, m)
  6576.     {
  6577.         var q = $("#" + g).children("ul");
  6578.         q.children().remove();
  6579.         var b = socialAction.user && socialAction.user.userdidsuggestions ? "suggestedpersonal" : "suggested";
  6580.         var f = new Array();
  6581.         for (var l in socialAction.allusers)
  6582.         {
  6583.             var e = socialAction.allusers[l];
  6584.             if (e.location == "prereg")
  6585.             {
  6586.                 continue
  6587.             }
  6588.             if (o == "follower" && !e["followerdate" + j])
  6589.             {
  6590.                 continue
  6591.             }
  6592.             if (o == "following" && !e["followingdate" + j])
  6593.             {
  6594.                 continue
  6595.             }
  6596.             if (o == "suggested" && (!e[b] || e[b] == 0 || e["following" + j]))
  6597.             {
  6598.                 continue
  6599.             }
  6600.             if (o == "search" && e.usersearch != socialAction.lastSearch)
  6601.             {
  6602.                 continue
  6603.             }
  6604.             if (o == "follower" && e["followerdate" + j])
  6605.             {
  6606.                 e["followertime" + j] = socialAction.convertDateToSeconds(e["followerdate" + j])
  6607.             }
  6608.             if (o == "following" && e["followingdate" + j])
  6609.             {
  6610.                 e["followingtime" + j] = socialAction.convertDateToSeconds(e["followingdate" + j])
  6611.             }
  6612.             f.push(l)
  6613.         }
  6614.         var h = (o == "follower" || o == "following") ? (o + "date" + j) : "";
  6615.         socialAction.sortFieldTemp = h.replace("date", "time");
  6616.         f.sort(o == "suggested" ? socialAction.sortUsersBySuggested : socialAction.sortUsersByFollowDate);
  6617.         socialAction.sortFieldTemp = "";
  6618.         var n = 0;
  6619.         for (var k = 0; k < f.length; k++)
  6620.         {
  6621.             var e = socialAction.allusers[f[k]];
  6622.             if (!e)
  6623.             {
  6624.                 continue
  6625.             }
  6626.             if (o == "follower" && !e["follower" + j])
  6627.             {
  6628.                 continue
  6629.             }
  6630.             if (o == "following" && !e["following" + j])
  6631.             {
  6632.                 continue
  6633.             }
  6634.             if (o == "suggested" && (e.suggested == 0 || e["following" + j]))
  6635.             {
  6636.                 continue
  6637.             }
  6638.             if (o == "search" && e.usersearch != socialAction.lastSearch)
  6639.             {
  6640.                 continue
  6641.             }
  6642.             var c = "socialdata";
  6643.             if (o == "follower" && e.followertime > m && !e["recentshown" + g])
  6644.             {
  6645.                 n++;
  6646.                 c += " recent";
  6647.                 e["recentshown" + g] = 1
  6648.             }
  6649.             if (o == "following" && e.followingtime > m)
  6650.             {
  6651.                 n++;
  6652.                 c += " recent"
  6653.             }
  6654.             var d = socialAction.makeElement("li", false, c, q);
  6655.             socialAction.makeUserSnipDetails(d, e, null, true, false, false, h);
  6656.             socialAction.makeElement("div", false, "clear", d)
  6657.         }
  6658.         var p = 0;
  6659.         if (j && socialAction.allusers[j])
  6660.         {
  6661.             if (o == "follower")
  6662.             {
  6663.                 p = socialAction.allusers[j].numfollowers
  6664.             }
  6665.             if (o == "following")
  6666.             {
  6667.                 p = socialAction.allusers[j].numfollowing
  6668.             }
  6669.         }
  6670.         if (p < f.length)
  6671.         {
  6672.             p = f.length
  6673.         }
  6674.         if (o == "search" && (f.length % socialAction.loadEachTime == 0))
  6675.         {
  6676.             p += "+"
  6677.         }
  6678.         q.siblings().children("span.unbold").html(": " + p);
  6679.         q.siblings().children("span.bold").html(p);
  6680.         q.siblings("h3").attr("title", p + " people");
  6681.         if (!f.length)
  6682.         {
  6683.             socialAction.makeElement("li", false, "nothingtoshow", q, "no users found")
  6684.         }
  6685.         if (o == "suggested")
  6686.         {
  6687.             if (f.length)
  6688.             {
  6689.                 q.parent().show()
  6690.             }
  6691.             else
  6692.             {
  6693.                 q.parent().hide();
  6694.                 if ($("#cbsocialusersmenu").hasClass("show"))
  6695.                 {
  6696.                     $("#cbsocialusersfollowing h3").click()
  6697.                 }
  6698.             }
  6699.         }
  6700.         if (n)
  6701.         {
  6702.             q.children("li.recent").removeClass("recent", 5000)
  6703.         }
  6704.         return f.length
  6705.     },
  6706.     getCookieValue: function(c)
  6707.     {
  6708.         var d = document.cookie.indexOf(c + "=");
  6709.         if (d < 0)
  6710.         {
  6711.             return ""
  6712.         }
  6713.         d += c.length + 1;
  6714.         var b = document.cookie.indexOf(";", d);
  6715.         return b < 0 ? document.cookie.substr(d) : document.cookie.substr(d, b - d)
  6716.     },
  6717.     setCookieValue: function(b, d, c)
  6718.     {
  6719.         var e = new Date();
  6720.         e.setDate(e.getDate() + c);
  6721.         var f = escape(d) + ((c == null) ? "" : ";expires=" + e.toUTCString());
  6722.         document.cookie = b + "=" + f
  6723.     },
  6724.     onRespReplacement: function()
  6725.     {
  6726.         socialAction.onRespBeforeSocial();
  6727.         if ((typeof iC == "undefined") || (typeof sID == "undefined") || (typeof stimulus == "undefined") || (typeof reply == "undefined"))
  6728.         {
  6729.             return
  6730.         }
  6731.         var b = socialAction.getCookieValue("AIS");
  6732.         socialAction.addToConversationLog(b, iC, sID, stimulus, reply)
  6733.     },
  6734.     startOrContinueConversation: function(g, d)
  6735.     {
  6736.         socialAction.hideAllDropDowns(2);
  6737.         if (typeof dispResp == "undefined" || typeof sID == "undefined")
  6738.         {
  6739.             return
  6740.         }
  6741.         if (socialAction.hassnips)
  6742.         {
  6743.             snipAction.closeSnipBox()
  6744.         }
  6745.         if (d && sID.length > 2)
  6746.         {
  6747.             return
  6748.         }
  6749.         socialAction.conversationCurrentId = g;
  6750.         if (g > 0)
  6751.         {
  6752.             socialAction.remakeConversationList(g)
  6753.         }
  6754.         var h = g ? socialAction.allconversations[g] : "";
  6755.         var c = new Array();
  6756.         if (h && h.text)
  6757.         {
  6758.             var b = h.text.split("\n");
  6759.             for (var e = b.length - 1; e >= 0; e--)
  6760.             {
  6761.                 var f = b[e].split("\t");
  6762.                 if (f.length >= 2)
  6763.                 {
  6764.                     c.push(f[1]);
  6765.                     c.push(f[0])
  6766.                 }
  6767.             }
  6768.         }
  6769.         for (var e = 1; e <= 8; e++)
  6770.         {
  6771.             window["m" + e] = c.length > e - 1 ? c[e - 1] : ""
  6772.         }
  6773.         if (h)
  6774.         {
  6775.             socialAction.setCookieValue("ais", h.ais, 3);
  6776.             replyPrev = m1;
  6777.             sID = h.sessionid;
  6778.             if (typeof iC != "undefined")
  6779.             {
  6780.                 socialAction.conversationLastInteraction = iC
  6781.             }
  6782.             socialAction.trackInGoogle(d ? "conversation_continue_auto" : "continue_conversation_manual")
  6783.         }
  6784.         else
  6785.         {
  6786.             socialAction.setCookieValue("cleverbotref", "", -1);
  6787.             socialAction.setCookieValue("ais", "", -1);
  6788.             replyPrev = "";
  6789.             sID = "";
  6790.             socialAction.trackInGoogle("conversation_new")
  6791.         }
  6792.         typData = "";
  6793.         reply = m1;
  6794.         R = 3;
  6795.         script = F;
  6796.         dispResp();
  6797.         stimFocus()
  6798.     },
  6799.     setTweaksInPage: function(d, c, b)
  6800.     {
  6801.         window.tweak1 = d;
  6802.         window.tweak2 = c;
  6803.         window.tweak3 = b
  6804.     },
  6805.     addToConversationLog: function(d, b, f, c, h)
  6806.     {
  6807.         if (!socialAction.signedin)
  6808.         {
  6809.             return
  6810.         }
  6811.         if (socialAction.user.logconvs < 1)
  6812.         {
  6813.             return
  6814.         }
  6815.         if (!f || !c || !h)
  6816.         {
  6817.             return
  6818.         }
  6819.         if (b == socialAction.conversationLastInteraction)
  6820.         {
  6821.             return
  6822.         }
  6823.         if (!socialAction.conversationCurrentId)
  6824.         {
  6825.             for (var g in socialAction.allconversations)
  6826.             {
  6827.                 if (socialAction.allconversations[g].sessionid == f)
  6828.                 {
  6829.                     socialAction.conversationCurrentId = g
  6830.                 }
  6831.             }
  6832.         }
  6833.         c = c.replace(/&amp;/g, "&");
  6834.         h = h.replace(/&amp;/g, "&");
  6835.         var e = {
  6836.             ais: d,
  6837.             conversationid: socialAction.conversationCurrentId,
  6838.             user: socialAction.unicodeConvert(c),
  6839.             bot: socialAction.unicodeConvert(h),
  6840.             numinteractions: b,
  6841.             source: window.location.hostname,
  6842.             tweak1: socialAction.user.tweak1,
  6843.             tweak2: socialAction.user.tweak2,
  6844.             tweak3: socialAction.user.tweak3
  6845.         };
  6846.         if (socialAction.conversationLastSessionId != f)
  6847.         {
  6848.             e.sessionid = f
  6849.         }
  6850.         if (socialAction.voteDistance == 0)
  6851.         {
  6852.             e.vote = socialAction.vote
  6853.         }
  6854.         if (h.substr(h.length - 1) == "." && h.substr(h.length - 2) != ".")
  6855.         {
  6856.             h = h.substr(0, h.length - 1)
  6857.         }
  6858.         if (!socialAction.conversationCurrentId)
  6859.         {
  6860.             e.title = h
  6861.         }
  6862.         socialAction.conversationLastSessionId = f;
  6863.         socialAction.conversationLastInteraction = b;
  6864.         socialAction.socialCall("addtolog", e, true);
  6865.         if (socialAction.conversationCurrentId)
  6866.         {
  6867.             $("li.conversation" + socialAction.conversationCurrentId).addClass("current");
  6868.             if (socialAction.voteDistance == 0 && socialAction.vote > 0 && socialAction.allconversations[socialAction.conversationCurrentId])
  6869.             {
  6870.                 socialAction.allconversations[socialAction.conversationCurrentId]["vote" + socialAction.vote] ++
  6871.             }
  6872.             socialAction.voteDistance++
  6873.         }
  6874.     },
  6875.     unicodeConvert: function(d)
  6876.     {
  6877.         var c = "";
  6878.         for (var b = 0; b <= d.length; b++)
  6879.         {
  6880.             if (d.charAt(b) == "|")
  6881.             {
  6882.                 var e = parseInt(d.substring(b + 1, b + 5), 16);
  6883.                 if (e > 0)
  6884.                 {
  6885.                     c += String.fromCharCode(e);
  6886.                     b += 4
  6887.                 }
  6888.                 else
  6889.                 {
  6890.                     c += d.charAt(b)
  6891.                 }
  6892.             }
  6893.             else
  6894.             {
  6895.                 c += d.charAt(b)
  6896.             }
  6897.         }
  6898.         return c
  6899.     },
  6900.     formatConversationLine: function(c, f, e)
  6901.     {
  6902.         if (f === false)
  6903.         {
  6904.             var d = c.split("\t");
  6905.             if (d.length >= 2)
  6906.             {
  6907.                 c = d[0];
  6908.                 f = d[1]
  6909.             }
  6910.         }
  6911.         if (!c || !f)
  6912.         {
  6913.             return ""
  6914.         }
  6915.         var b = socialAction.user ? socialAction.user.username : "";
  6916.         r = "";
  6917.         if (c != "{pass}")
  6918.         {
  6919.             r += '<tr class="user' + (e ? " early" : "") + '"><td>' + b + ": <span>" + socialAction.unicodeConvert(c) + "</span><br/></td></tr>"
  6920.         }
  6921.         r += '<tr class="bot' + (e ? " early" : "") + '"><td>Cleverbot: <span> ' + socialAction.unicodeConvert(f) + "</span><br/></td></tr>";
  6922.         return r
  6923.     },
  6924.     getConversationLineVote: function(b)
  6925.     {
  6926.         var c = b.split("\t");
  6927.         return c.length >= 3 ? parseInt(c[2]) : 0
  6928.     },
  6929.     sortConversationsByReverseTime: function(d, c)
  6930.     {
  6931.         return c - d
  6932.     },
  6933.     remakeConversationList: function(j, q)
  6934.     {
  6935.         elid = "cbsocialconversations";
  6936.         var m = $("#" + elid).children("ul");
  6937.         m.children().remove();
  6938.         var w = new Array();
  6939.         for (var u in socialAction.allconversations)
  6940.         {
  6941.             if (u > 0)
  6942.             {
  6943.                 w.push(u)
  6944.             }
  6945.         }
  6946.         w.sort(socialAction.sortConversationsByReverseTime);
  6947.         var s = socialAction.makeElement("li", false, "conversation", m);
  6948.         if (socialAction.user.logconvs < 1)
  6949.         {
  6950.             var h = socialAction.makeElement("span", false, "newconversation", s, "conversation logging is off");
  6951.             socialAction.makeElement("p", false, false, s, "Your conversations are not currently being logged. Turn on logging in your account settings, available from the top right corner of the screen.")
  6952.         }
  6953.         else
  6954.         {
  6955.             var h = socialAction.makeElement("span", false, "newconversation", s, "new conversation");
  6956.             var f = socialAction.makeElement("p", false, false, s, "Start chatting to Cleverbot. Your conversation will appear below.");
  6957.             $(f).hide();
  6958.             $(h).click(function()
  6959.             {
  6960.                 $(this).siblings("p").show();
  6961.                 socialAction.loadingLoop(500, function()
  6962.                 {
  6963.                     socialAction.startOrContinueConversation(0)
  6964.                 })
  6965.             })
  6966.         }
  6967.         for (var t = 0; t < w.length; t++)
  6968.         {
  6969.             var n = socialAction.allconversations[w[t]];
  6970.             if (!n)
  6971.             {
  6972.                 continue
  6973.             }
  6974.             if (!n.createddate)
  6975.             {
  6976.                 continue
  6977.             }
  6978.             var A = "conversation conversation" + n.id;
  6979.             if (n.id == socialAction.conversationCurrentId)
  6980.             {
  6981.                 A += " current"
  6982.             }
  6983.             var s = socialAction.makeElement("li", false, A, m);
  6984.             var d = socialAction.makeElement("form", false, false, s, false, "saveconversation");
  6985.             $(d).submit(function(D)
  6986.             {
  6987.                 var v = $(this).children("input.editbutton");
  6988.                 v.attr("value", "edit");
  6989.                 v.removeClass("savebutton");
  6990.                 var B = $(this).children("input.title");
  6991.                 B.attr("readonly", "readonly");
  6992.                 B.removeClass("editable");
  6993.                 var C = B.attr("value") != B.val();
  6994.                 B.attr("value", B.val());
  6995.                 $(this).prop("stopsubmit", C ? 0 : 1);
  6996.                 return C
  6997.             });
  6998.             socialAction.makeElement("input", false, false, d, false,
  6999.             {
  7000.                 name: "id",
  7001.                 type: "hidden",
  7002.                 value: n.id
  7003.             });
  7004.             var h = socialAction.makeElement("input", false, "title", d, false,
  7005.             {
  7006.                 name: "title",
  7007.                 value: n.title ? socialAction.unicodeConvert(n.title) : "untitled",
  7008.                 readonly: "readonly"
  7009.             });
  7010.             var p = socialAction.makeElement("input", false, "editbutton", d, false,
  7011.             {
  7012.                 type: "button",
  7013.                 value: "edit"
  7014.             });
  7015.             $(p).click(function()
  7016.             {
  7017.                 var v = $(this).siblings("input.title");
  7018.                 var B = v.prop("conversationid");
  7019.                 if (!v.attr("readonly"))
  7020.                 {
  7021.                     if (B)
  7022.                     {
  7023.                         socialAction.allconversations[B].isedit = 0
  7024.                     }
  7025.                     v.parent().submit()
  7026.                 }
  7027.                 else
  7028.                 {
  7029.                     if (B)
  7030.                     {
  7031.                         socialAction.allconversations[B].isedit = 1
  7032.                     }
  7033.                     if (B && !socialAction.allconversations[B].isopen)
  7034.                     {
  7035.                         v.click()
  7036.                     }
  7037.                     $(this).addClass("savebutton");
  7038.                     $(this).attr("value", "save");
  7039.                     v.addClass("editable");
  7040.                     v.removeAttr("readonly");
  7041.                     v.focus()
  7042.                 }
  7043.             });
  7044.             if (n.isedit)
  7045.             {
  7046.                 $(p).click()
  7047.             }
  7048.             socialAction.makeElement("span", false, false, s, "Started " + socialAction.getFullDate(n.createddate, 1));
  7049.             if (socialAction.canAdminister())
  7050.             {
  7051.                 socialAction.makeElement("span", false, false, s, "Conversation ID: " + n.id);
  7052.                 socialAction.makeElement("span", false, false, s, "Session ID: " + n.sessionid);
  7053.                 socialAction.makeElement("span", false, false, s, "AIS: " + n.ais)
  7054.             }
  7055.             var o = socialAction.makeElement("div", false, false, s);
  7056.             if (n.id != j && n.isopen)
  7057.             {
  7058.                 $(o).show()
  7059.             }
  7060.             if (n.textshow)
  7061.             {
  7062.                 var x = n.numlines > socialAction.conversationShowInteractions;
  7063.                 if (x)
  7064.                 {
  7065.                     var g = socialAction.makeElement("span", false, false, o, "show whole conversation");
  7066.                     $(g).click(function()
  7067.                     {
  7068.                         $(this).html($(this).html() == "show whole conversation" ? "hide early part" : "show whole conversation");
  7069.                         $(this).siblings("table").find("tr.early").toggle(500)
  7070.                     })
  7071.                 }
  7072.                 var f = socialAction.makeElement("table", "snipTextContainer" + n.id, false, o, n.textshow);
  7073.                 if (socialAction.hassnips)
  7074.                 {
  7075.                     if (x)
  7076.                     {
  7077.                         socialAction.makeElement("div", "snipTextIconTop" + n.id, "snipTextIcon sniptop", f);
  7078.                         snipAction.connectNewIcon("#snipTextIconTop" + n.id, "#snipTextContainer" + n.id + " > tbody > tr", true)
  7079.                     }
  7080.                     socialAction.makeElement("div", "snipTextIconBottom" + n.id, "snipTextIcon snipbottom", f);
  7081.                     snipAction.connectNewIcon("#snipTextIconBottom" + n.id, "#snipTextContainer" + n.id + " > tbody > tr", true)
  7082.                 }
  7083.             }
  7084.             $(h).prop("conversationid", n.id);
  7085.             $(h).click(function(v)
  7086.             {
  7087.                 if (!$(this).attr("readonly"))
  7088.                 {
  7089.                     return
  7090.                 }
  7091.                 var B = $(this).prop("conversationid");
  7092.                 var i = $(this).parent().siblings("div");
  7093.                 socialAction.allconversations[B].isopen = socialAction.allconversations[B].isopen ? 0 : 1;
  7094.                 if (i.children("table").html())
  7095.                 {
  7096.                     i.toggle(500, socialAction.resizeExtenders)
  7097.                 }
  7098.                 else
  7099.                 {
  7100.                     socialAction.socialCall("getconversation",
  7101.                     {
  7102.                         conversationid: B
  7103.                     })
  7104.                 }
  7105.             });
  7106.             var d = socialAction.makeElement("form", false, false, o, false, "saveconversation");
  7107.             socialAction.makeElement("input", false, false, d, false,
  7108.             {
  7109.                 name: "id",
  7110.                 type: "hidden",
  7111.                 value: n.id
  7112.             });
  7113.             socialAction.makeElement("label", false, false, d, "Why are you here? ",
  7114.             {
  7115.                 "for": "cbconversationtype"
  7116.             });
  7117.             var l = socialAction.makeElement("select", "cbconversationtype", false, d, socialAction.conversationTypes,
  7118.             {
  7119.                 name: "conversationtype",
  7120.                 value: n.conversationtype
  7121.             });
  7122.             $(l).change(function()
  7123.             {
  7124.                 var i = $(this).siblings("input[type=text]");
  7125.                 if ($(this).val() == "other")
  7126.                 {
  7127.                     i.show()
  7128.                 }
  7129.                 else
  7130.                 {
  7131.                     i.hide()
  7132.                 }
  7133.                 $(this).parent().submit()
  7134.             });
  7135.             var b = socialAction.makeElement("input", "cbconversationtypeother", false, d, null,
  7136.             {
  7137.                 name: "conversationtypeother",
  7138.                 type: "text",
  7139.                 value: n.conversationtypeother
  7140.             });
  7141.             $(b).change(function()
  7142.             {
  7143.                 $(this).parent().submit()
  7144.             });
  7145.             if ($(l).val() != "other")
  7146.             {
  7147.                 $(b).hide()
  7148.             }
  7149.             socialAction.makeElement("br", false, false, d);
  7150.             socialAction.makeElement("label", false, false, d, "How human is Cleverbot? ",
  7151.             {
  7152.                 "for": "cbconversationhuman"
  7153.             });
  7154.             var b = socialAction.makeElement("select", "cbconversationhuman", false, d, socialAction.conversationHowHuman,
  7155.             {
  7156.                 name: "conversationhuman",
  7157.                 value: n.conversationhuman,
  7158.                 byindex: 1
  7159.             });
  7160.             $(b).change(function()
  7161.             {
  7162.                 $(this).parent().submit()
  7163.             });
  7164.             socialAction.makeElement("br", false, false, d);
  7165.             socialAction.makeElement("label", false, false, d, "How satisfied are you? ",
  7166.             {
  7167.                 "for": "cbconversationsatisfaction"
  7168.             });
  7169.             var b = socialAction.makeElement("select", "cbconversationsatisfaction", false, d, socialAction.conversationHowSatisfied,
  7170.             {
  7171.                 name: "conversationsatisfaction",
  7172.                 value: n.conversationsatisfaction,
  7173.                 byindex: 1
  7174.             });
  7175.             $(b).change(function()
  7176.             {
  7177.                 $(this).parent().submit()
  7178.             });
  7179.             var c = 0;
  7180.             for (var k = 1; k <= socialAction.voteLabels.length; k++)
  7181.             {
  7182.                 c += n["vote" + k]
  7183.             }
  7184.             if (c > 0)
  7185.             {
  7186.                 socialAction.makeElement("br", false, false, d);
  7187.                 var e = socialAction.makeElement("span", false, false, d, "How you voted:");
  7188.                 for (var k = 1; k <= socialAction.voteLabels.length; k++)
  7189.                 {
  7190.                     if (n["vote" + k] > 0)
  7191.                     {
  7192.                         socialAction.makeElement("span", false, "vote" + k, e, socialAction.voteLabels[k - 1] + " " + n["vote" + k])
  7193.                     }
  7194.                 }
  7195.             }
  7196.             var z = socialAction.makeElement("input", false, "continuebutton", d, false,
  7197.             {
  7198.                 type: "button",
  7199.                 value: "continue conversation"
  7200.             });
  7201.             $(z).click(new Function("socialAction.startOrContinueConversation(" + n.id + ");"));
  7202.             socialAction.addDeleteButtonToForm(d, "delete", "delete this conversation");
  7203.             socialAction.makeElement("div", false, "clear", d)
  7204.         }
  7205.         if (!w)
  7206.         {
  7207.             socialAction.makeElement("li", false, "nothingtoshow", m, "no previous conversations found")
  7208.         }
  7209.         if (j)
  7210.         {
  7211.             $("li.conversation" + j + " div").show(500, socialAction.resizeExtenders)
  7212.         }
  7213.         if (q)
  7214.         {
  7215.             socialAction.resizeExtenders()
  7216.         }
  7217.     },
  7218.     setVoteColourClass: function(b, e)
  7219.     {
  7220.         for (var c = 1; c <= b.length; c++)
  7221.         {
  7222.             var d = $(b[c - 1]);
  7223.             if (c <= e)
  7224.             {
  7225.                 d.removeClass(d.prop("startclass"))
  7226.             }
  7227.             else
  7228.             {
  7229.                 d.addClass(d.prop("startclass"))
  7230.             }
  7231.         }
  7232.     },
  7233.     addVotingButtons: function(h)
  7234.     {
  7235.         var f = "show10";
  7236.         if (socialAction.voteDistance == 1)
  7237.         {
  7238.             f = "show75"
  7239.         }
  7240.         else
  7241.         {
  7242.             if (socialAction.voteDistance == 2)
  7243.             {
  7244.                 f = "show50"
  7245.             }
  7246.             else
  7247.             {
  7248.                 if (socialAction.voteDistance == 3)
  7249.                 {
  7250.                     f = "show40"
  7251.                 }
  7252.                 else
  7253.                 {
  7254.                     if (socialAction.voteDistance == 4)
  7255.                     {
  7256.                         f = "show30"
  7257.                     }
  7258.                     else
  7259.                     {
  7260.                         if (socialAction.voteDistance == 5)
  7261.                         {
  7262.                             f = "show20"
  7263.                         }
  7264.                     }
  7265.                 }
  7266.             }
  7267.         }
  7268.         var j = $(h);
  7269.         var l = socialAction.makeElement("div", "cbvoting");
  7270.         var d = socialAction.makeElement("div", false, false, l);
  7271.         $(d).mouseleave(function()
  7272.         {
  7273.             socialAction.setVoteColourClass($(this).children("div.colour"), 0);
  7274.             $(this).children("div.text").hide()
  7275.         });
  7276.         for (var g = 1; g <= socialAction.voteLabels.length; g++)
  7277.         {
  7278.             var k = socialAction.vote == g ? f : "show0";
  7279.             var e = socialAction.makeElement("div", false, "text text" + g, d, socialAction.voteLabels[g - 1]);
  7280.             var b = socialAction.makeElement("div", false, k + " colour colour" + g, d);
  7281.             var c = socialAction.makeElement("div", false, "circle circle" + g, d);
  7282.             $(b).prop("vote", g);
  7283.             $(b).prop("startclass", k);
  7284.             $(c).prop("vote", g);
  7285.             $(c).mouseenter(function()
  7286.             {
  7287.                 var i = $(this).prop("vote");
  7288.                 socialAction.setVoteColourClass($(this).siblings("div.colour").andSelf(), i);
  7289.                 $(this).siblings("div.text").hide();
  7290.                 $(this).siblings("div.text" + i).show()
  7291.             });
  7292.             $(c).click(function()
  7293.             {
  7294.                 socialAction.vote = $(this).prop("vote");
  7295.                 $(this).siblings("div.colour").prop("startclass", "show0");
  7296.                 $(this).prev("div.colour").prop("startclass", "show100");
  7297.                 socialAction.voteDistance = 0
  7298.             })
  7299.         }
  7300.         j.before(l)
  7301.     },
  7302.     loadingLoop: function(b, c)
  7303.     {
  7304.         $("#cbsocial .loading").show();
  7305.         setTimeout(function()
  7306.         {
  7307.             c();
  7308.             $("#cbsocial .loading").hide()
  7309.         }, b)
  7310.     },
  7311.     socialCall: function(d, g, f, h)
  7312.     {
  7313.         if (!f)
  7314.         {
  7315.             $("#cbsocial .loading").show()
  7316.         }
  7317.         $("#cbsocialmessage" + d).hide();
  7318.         var b = socialAction.jsonurl + "?";
  7319.         if (d)
  7320.         {
  7321.             b += "action=" + d + "&"
  7322.         }
  7323.         if (typeof g == "object")
  7324.         {
  7325.             for (var e in g)
  7326.             {
  7327.                 b += e + "=" + encodeURIComponent(g[e]) + "&"
  7328.             }
  7329.         }
  7330.         if (!g.howmany)
  7331.         {
  7332.             b += "howmany=" + socialAction.loadEachTime + "&"
  7333.         }
  7334.         if (!h)
  7335.         {
  7336.             h = "processAction"
  7337.         }
  7338.         b += "callback=socialAction." + h;
  7339.         var c = document.createElement("script");
  7340.         if (socialAction.debugMode >= 1)
  7341.         {
  7342.             socialAction.debug("About to call " + b, null, 1)
  7343.         }
  7344.         c.setAttribute("action", "text/javascript");
  7345.         c.setAttribute("src", b);
  7346.         if (document.body)
  7347.         {
  7348.             document.body.appendChild(c)
  7349.         }
  7350.         else
  7351.         {
  7352.             if (document.head)
  7353.             {
  7354.                 document.head.appendChild(c)
  7355.             }
  7356.         }
  7357.     },
  7358.     showObject: function(g, h, e)
  7359.     {
  7360.         if (!h)
  7361.         {
  7362.             h = 0
  7363.         }
  7364.         if (h > 5)
  7365.         {
  7366.             return ""
  7367.         }
  7368.         var d = "";
  7369.         var b = "";
  7370.         for (var c = 0; c < h; c++)
  7371.         {
  7372.             b += "  "
  7373.         }
  7374.         for (var f in g)
  7375.         {
  7376.             if (typeof g[f] == "object")
  7377.             {
  7378.                 d += f + ":\n" + socialAction.showObject(g[f], h + 1)
  7379.             }
  7380.             else
  7381.             {
  7382.                 d += b + f + ": " + g[f] + "\n"
  7383.             }
  7384.         }
  7385.         if (e && h == 0)
  7386.         {
  7387.             alert(d)
  7388.         }
  7389.         return d
  7390.     }
  7391. };
  7392. var Base64 = {
  7393.     _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  7394.     encode: function(j)
  7395.     {
  7396.         var m = "";
  7397.         var d, b, g, p, c, l, k;
  7398.         var h = 0;
  7399.         j = Base64._utf8_encode(j);
  7400.         while (h < j.length)
  7401.         {
  7402.             d = j.charCodeAt(h++);
  7403.             b = j.charCodeAt(h++);
  7404.             g = j.charCodeAt(h++);
  7405.             p = d >> 2;
  7406.             c = (d & 3) << 4 | b >> 4;
  7407.             l = (b & 15) << 2 | g >> 6;
  7408.             k = g & 63;
  7409.             if (isNaN(b))
  7410.             {
  7411.                 l = k = 64
  7412.             }
  7413.             else
  7414.             {
  7415.                 if (isNaN(g))
  7416.                 {
  7417.                     k = 64
  7418.                 }
  7419.             }
  7420.             m = m + this._keyStr.charAt(p) + this._keyStr.charAt(c) + this._keyStr.charAt(l) + this._keyStr.charAt(k)
  7421.         }
  7422.         return m
  7423.     },
  7424.     decode: function(j)
  7425.     {
  7426.         var m = "";
  7427.         var d, b, g;
  7428.         var p, c, l, k;
  7429.         var h = 0;
  7430.         j = j.replace(/[^A-Za-z0-9\+\/\=]/g, "");
  7431.         while (h < j.length)
  7432.         {
  7433.             p = this._keyStr.indexOf(j.charAt(h++));
  7434.             c = this._keyStr.indexOf(j.charAt(h++));
  7435.             l = this._keyStr.indexOf(j.charAt(h++));
  7436.             k = this._keyStr.indexOf(j.charAt(h++));
  7437.             d = p << 2 | c >> 4;
  7438.             b = (c & 15) << 4 | l >> 2;
  7439.             g = (l & 3) << 6 | k;
  7440.             m = m + String.fromCharCode(d);
  7441.             if (l != 64)
  7442.             {
  7443.                 m = m + String.fromCharCode(b)
  7444.             }
  7445.             if (k != 64)
  7446.             {
  7447.                 m = m + String.fromCharCode(g)
  7448.             }
  7449.         }
  7450.         m = Base64._utf8_decode(m);
  7451.         return m
  7452.     },
  7453.     _utf8_encode: function(d)
  7454.     {
  7455.         d = d.replace(/\r\n/g, "\n");
  7456.         var b = "";
  7457.         for (var f = 0; f < d.length; f++)
  7458.         {
  7459.             var c = d.charCodeAt(f);
  7460.             if (c < 128)
  7461.             {
  7462.                 b += String.fromCharCode(c)
  7463.             }
  7464.             else
  7465.             {
  7466.                 if (c > 127 && c < 2048)
  7467.                 {
  7468.                     b += String.fromCharCode(c >> 6 | 192);
  7469.                     b += String.fromCharCode(c & 63 | 128)
  7470.                 }
  7471.                 else
  7472.                 {
  7473.                     b += String.fromCharCode(c >> 12 | 224);
  7474.                     b += String.fromCharCode(c >> 6 & 63 | 128);
  7475.                     b += String.fromCharCode(c & 63 | 128)
  7476.                 }
  7477.             }
  7478.         }
  7479.         return b
  7480.     },
  7481.     _utf8_decode: function(d)
  7482.     {
  7483.         var b = "";
  7484.         var f = 0;
  7485.         var c = c1 = c2 = 0;
  7486.         while (f < d.length)
  7487.         {
  7488.             c = d.charCodeAt(f);
  7489.             if (c < 128)
  7490.             {
  7491.                 b += String.fromCharCode(c);
  7492.                 f++
  7493.             }
  7494.             else
  7495.             {
  7496.                 if (c > 191 && c < 224)
  7497.                 {
  7498.                     c2 = d.charCodeAt(f + 1);
  7499.                     b += String.fromCharCode((c & 31) << 6 | c2 & 63);
  7500.                     f += 2
  7501.                 }
  7502.                 else
  7503.                 {
  7504.                     c2 = d.charCodeAt(f + 1);
  7505.                     c3 = d.charCodeAt(f + 2);
  7506.                     b += String.fromCharCode((c & 15) << 12 | (c2 & 63) << 6 | c3 & 63);
  7507.                     f += 3
  7508.                 }
  7509.             }
  7510.         }
  7511.         return b
  7512.     }
  7513. };
  7514.  
  7515. function upclick(e)
  7516. {
  7517.     var f = {
  7518.         element: null,
  7519.         action: "about:blank",
  7520.         action_params:
  7521.         {},
  7522.         maxsize: 0,
  7523.         onstart: null,
  7524.         oncomplete: null,
  7525.         dataname: "Filedata",
  7526.         target: null,
  7527.         zindex: "auto"
  7528.     };
  7529.     for (var o in f)
  7530.     {
  7531.         e[o] = e[o] ? e[o] : f[o]
  7532.     }
  7533.     var h = e.element;
  7534.     if (typeof h == "string")
  7535.     {
  7536.         h = document.getElementById(h)
  7537.     }
  7538.     var n = h.ownerDocument;
  7539.     var m;
  7540.     var b = n.createElement("div");
  7541.     var l = "frame" + new Date().getTime().toString().substr(8);
  7542.     b.innerHTML = '<iframe name="' + l + '" src="about:blank" onload="this.onload_callback()"></iframe>';
  7543.     var c = b.childNodes[0];
  7544.     c.onload_callback = function()
  7545.     {
  7546.         var t = n.createElement("form");
  7547.         b.appendChild(t);
  7548.         t.method = "post";
  7549.         t.enctype = "multipart/form-data";
  7550.         t.encoding = "multipart/form-data";
  7551.         if (e.target)
  7552.         {
  7553.             t.target = e.target;
  7554.             t.setAttribute("target", e.target)
  7555.         }
  7556.         else
  7557.         {
  7558.             t.target = l;
  7559.             t.setAttribute("target", l)
  7560.         }
  7561.         t.action = e.action;
  7562.         t.setAttribute("action", e.action);
  7563.         t.style.margin = 0;
  7564.         t.style.padding = 0;
  7565.         t.style.height = "80px";
  7566.         t.style.width = "40px";
  7567.         t.runat = "server";
  7568.         var w = e.action_params;
  7569.         for (var s in w)
  7570.         {
  7571.             var v = n.createElement("input");
  7572.             v.type = "hidden";
  7573.             v.name = s;
  7574.             v.value = String(w[s]);
  7575.             t.appendChild(v)
  7576.         }
  7577.         if (e.maxsize)
  7578.         {
  7579.             var u = n.createElement("input");
  7580.             u.type = "hidden";
  7581.             u.name = "MAX_FILE_SIZE";
  7582.             u.value = String(e.maxsize);
  7583.             t.appendChild(u)
  7584.         }
  7585.         m = n.createElement("input");
  7586.         m.name = e.dataname;
  7587.         m.type = "file";
  7588.         m.size = "1";
  7589.         m.id = "fileInput";
  7590.         m.runat = "server";
  7591.         t.appendChild(m);
  7592.         m.style.position = "absolute";
  7593.         m.style.display = "block";
  7594.         m.style.top = 0;
  7595.         m.style.left = 0;
  7596.         m.style.height = t.style.height;
  7597.         m.style.width = "80px";
  7598.         m.style.opacity = 0;
  7599.         m.style.filter = "alpha(opacity=0)";
  7600.         m.style.fontSize = 8;
  7601.         m.style.zIndex = 1;
  7602.         m.style.visiblity = "hidden";
  7603.         m.style.marginLeft = "-40px";
  7604.         var q = function(z)
  7605.         {
  7606.             if (!m.value)
  7607.             {
  7608.                 return
  7609.             }
  7610.             var x = e.onstart;
  7611.             if (x)
  7612.             {
  7613.                 x(m.value)
  7614.             }
  7615.             if (this.files && this.files[0] && this.files[0].size > 0 && e.maxsize > 0 && this.files[0].size > e.maxsize && e.oncomplete)
  7616.             {
  7617.                 e.oncomplete(
  7618.                 {
  7619.                     error: "file is too big, maximum is " + e.maxsize
  7620.                 })
  7621.             }
  7622.             else
  7623.             {
  7624.                 t.submit()
  7625.             }
  7626.         };
  7627.         if (m.addEventListener)
  7628.         {
  7629.             m.addEventListener("change", q, false)
  7630.         }
  7631.         else
  7632.         {
  7633.             if (m.attachEvent)
  7634.             {
  7635.                 m.attachEvent("onpropertychange", function(x)
  7636.                 {
  7637.                     if (!x)
  7638.                     {
  7639.                         x = window.event
  7640.                     }
  7641.                     if (x.propertyName == "value")
  7642.                     {
  7643.                         q()
  7644.                     }
  7645.                 })
  7646.             }
  7647.             else
  7648.             {
  7649.                 m.onpropertychange = q
  7650.             }
  7651.         }
  7652.         c.onload_callback = function()
  7653.         {
  7654.             var x = null;
  7655.             if (c.contentWindow)
  7656.             {
  7657.                 x = c.contentWindow
  7658.             }
  7659.             else
  7660.             {
  7661.                 if (c.contentDocument)
  7662.                 {
  7663.                     x = c.contentDocument.defaultView
  7664.                 }
  7665.             }
  7666.             var A = "";
  7667.             var z = e.oncomplete;
  7668.             if (z)
  7669.             {
  7670.                 z(A)
  7671.             }
  7672.             t.reset()
  7673.         }
  7674.     };
  7675.     c.style.display = "none";
  7676.     c.width = 0;
  7677.     c.height = 0;
  7678.     c.marginHeight = 0;
  7679.     c.marginWidth = 0;
  7680.     n.body.insertBefore(b, n.body.firstChild);
  7681.     b.style.position = "absolute";
  7682.     b.style.overflow = "hidden";
  7683.     b.style.padding = 0;
  7684.     b.style.margin = 0;
  7685.     b.style.visiblity = "hidden";
  7686.     b.style.width = "0px";
  7687.     b.style.height = "0px";
  7688.     if (e.zindex == "auto")
  7689.     {
  7690.         var p = 0,
  7691.             k;
  7692.         var g = h;
  7693.         var j;
  7694.         while (g.tagName != "BODY")
  7695.         {
  7696.             j = g.currentStyle ? g.currentStyle : getComputedStyle(g, null);
  7697.             k = parseInt(j.zIndex);
  7698.             k = isNaN(k) ? 0 : k;
  7699.             p += k + 1;
  7700.             g = g.parentNode
  7701.         }
  7702.         b.style.zIndex = p
  7703.     }
  7704.     else
  7705.     {
  7706.         b.style.zIndex = e.zindex
  7707.     }
  7708.     var d = function(s)
  7709.     {
  7710.         if (!s)
  7711.         {
  7712.             s = window.event
  7713.         }
  7714.         b.style.width = "0px";
  7715.         b.style.height = "0px";
  7716.         var q = n.elementFromPoint(s.clientX, s.clientY);
  7717.         if (q === h)
  7718.         {
  7719.             b.style.width = "40px";
  7720.             b.style.height = "80px"
  7721.         }
  7722.     };
  7723.     if (b.addEventListener)
  7724.     {
  7725.         b.addEventListener("mousemove", d, false)
  7726.     }
  7727.     else
  7728.     {
  7729.         if (b.attachEvent)
  7730.         {
  7731.             b.attachEvent("onmousemove", d)
  7732.         }
  7733.     }
  7734.     var i = function(s)
  7735.     {
  7736.         if (!s)
  7737.         {
  7738.             s = window.event
  7739.         }
  7740.         var q = y = 0;
  7741.         if (s.pageX)
  7742.         {
  7743.             q = s.pageX
  7744.         }
  7745.         else
  7746.         {
  7747.             if (s.clientX)
  7748.             {
  7749.                 q = s.clientX + (n.documentElement.scrollLeft ? n.documentElement.scrollLeft : n.body.scrollLeft)
  7750.             }
  7751.         }
  7752.         if (s.pageY)
  7753.         {
  7754.             y = s.pageY
  7755.         }
  7756.         else
  7757.         {
  7758.             if (s.clientY)
  7759.             {
  7760.                 y = s.clientY + (n.documentElement.scrollTop ? n.documentElement.scrollTop : n.body.scrollTop)
  7761.             }
  7762.         }
  7763.         b.style.left = q - 20 + "px";
  7764.         b.style.top = y - 40 + "px";
  7765.         b.style.width = "40px";
  7766.         b.style.height = "80px"
  7767.     };
  7768.     if (h.addEventListener)
  7769.     {
  7770.         h.addEventListener("mousemove", i, false)
  7771.     }
  7772.     else
  7773.     {
  7774.         if (h.attachEvent)
  7775.         {
  7776.             h.attachEvent("onmousemove", i)
  7777.         }
  7778.     }
  7779. }
  7780. if (typeof module == "object")
  7781. {
  7782.     module.exports = {
  7783.         socialActionObject: socialAction,
  7784.         Base64Object: Base64
  7785.     }
  7786. }
  7787. else
  7788. {
  7789.     if (typeof SOCIALINITDATA == "string")
  7790.     {
  7791.         socialAction.socialPreInit(SOCIALINITDATA)
  7792.     }
  7793.     else
  7794.     {
  7795.         socialAction.socialPreInit("")
  7796.     }
  7797. };
Add Comment
Please, Sign In to add comment