Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2010
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Function.prototype.bind = function (a)
  2. {
  3.     var b = this;
  4.     return function ()
  5.     {
  6.         return b.apply(a, arguments);
  7.     }
  8. };
  9. (function ($)
  10. {
  11.     $.toJSON = function (o)
  12.     {
  13.         if (typeof (JSON) == "object" && JSON.stringify) {
  14.             return JSON.stringify(o)
  15.         }
  16.         var type = typeof (o);
  17.         if (o === null) {
  18.             return "null"
  19.         }
  20.         if (type == "undefined") {
  21.             return undefined
  22.         }
  23.         if (type == "number" || type == "boolean") {
  24.             return o + ""
  25.         }
  26.         if (type == "string") {
  27.             return $.quoteString(o)
  28.         }
  29.         if (type == "object")
  30.         {
  31.             if (typeof o.toJSON == "function")
  32.             {
  33.                 return $.toJSON(o.toJSON())
  34.             }
  35.             if (o.constructor === Date)
  36.             {
  37.                 var month = o.getUTCMonth() + 1;
  38.                 if (month < 10) {
  39.                     month = "0" + month
  40.                 }
  41.                 var day = o.getUTCDate();
  42.                 if (day < 10) {
  43.                     day = "0" + day
  44.                 }
  45.                 var year = o.getUTCFullYear();
  46.                 var hours = o.getUTCHours();
  47.                 if (hours < 10) {
  48.                     hours = "0" + hours
  49.                 }
  50.                 var minutes = o.getUTCMinutes();
  51.                 if (minutes < 10) {
  52.                     minutes = "0" + minutes
  53.                 }
  54.                 var seconds = o.getUTCSeconds();
  55.                 if (seconds < 10) {
  56.                     seconds = "0" + seconds
  57.                 }
  58.                 var milli = o.getUTCMilliseconds();
  59.                 if (milli < 100) {
  60.                     milli = "0" + milli
  61.                 }
  62.                 if (milli < 10) {
  63.                     milli = "0" + milli
  64.                 }
  65.                 return '"' + year + "-" + month + "-" + day + "T" + hours + ":" + minutes + ":" + seconds + "." + milli + 'Z"'
  66.             }
  67.             if (o.constructor === Array)
  68.             {
  69.                 var ret = [];
  70.                 for (var i = 0; i < o.length; i++) {
  71.                     ret.push($.toJSON(o[i]) || "null")
  72.                 }
  73.                 return "[" + ret.join(",") + "]"
  74.             }
  75.             var pairs = [];
  76.             for (var k in o)
  77.             {
  78.                 var name;
  79.                 var type = typeof k;
  80.                 if (type == "number") {
  81.                     name = '"' + k + '"'
  82.                 }
  83.                 else {
  84.                     if (type == "string") {
  85.                         name = $.quoteString(k)
  86.                     }
  87.                     else {
  88.                         continue
  89.                     }
  90.                 }
  91.                 if (typeof o[k] == "function")
  92.                 {
  93.                     continue
  94.                 }
  95.                 var val = $.toJSON(o[k]);
  96.                 pairs.push(name + ":" + val)
  97.             }
  98.             return "{" + pairs.join(", ") + "}";
  99.         }
  100.     };
  101.     $.evalJSON = function (src)
  102.     {
  103.         if (typeof (JSON) == "object" && JSON.parse) {
  104.             return JSON.parse(src)
  105.         }
  106.         return eval("(" + src + ")");
  107.     };
  108.     $.secureEvalJSON = function (src)
  109.     {
  110.         if (typeof (JSON) == "object" && JSON.parse) {
  111.             return JSON.parse(src)
  112.         }
  113.         var filtered = src;
  114.         filtered = filtered.replace(/\\["\\\/bfnrtu]/g, "@");
  115.         filtered = filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
  116.         "]");
  117.         filtered = filtered.replace(/(?:^|:|,)(?:\s*\[)+/g, "");
  118.         if (/^[\],:{}\s]*$/.test(filtered)) {
  119.             return eval("(" + src + ")")
  120.         }
  121.         else {
  122.             throw new SyntaxError("Error parsing JSON, source is not valid.")
  123.         }
  124.     };
  125.     $.quoteString = function (string)
  126.     {
  127.         if (string.match(_escapeable))
  128.         {
  129.             return '"' + string.replace(_escapeable, function (a) {
  130.                 var c = _meta[a];
  131.                 if (typeof c === "string") {
  132.                     return c
  133.                 }
  134.                 c = a.charCodeAt();
  135.                 return "\\u00" + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
  136.             }) + '"'
  137.         }
  138.         return '"' + string + '"';
  139.     };
  140.     var _escapeable = /["\\\x00-\x1f\x7f-\x9f]/g;
  141.     var _meta = {
  142.         "\b" : "\\b", "\t" : "\\t", "\n" : "\\n", "\f" : "\\f", "\r" : "\\r", '"' : '\\"', "\\" : "\\\\"
  143.     }
  144. })(jQuery);
  145. (function (b)
  146. {
  147.     jQuery.cookie = function (k, j, o)
  148.     {
  149.         if (arguments.length > 1 && (j === null || typeof j !== "object"))
  150.         {
  151.             o = jQuery.extend({}, o);
  152.             if (j === null) {
  153.                 o.expires =- 1
  154.             }
  155.             if (typeof o.expires === "number") {
  156.                 var l = o.expires, n = o.expires = new Date();
  157.                 n.setDate(n.getDate() + l)
  158.             }
  159.             return (document.cookie = [encodeURIComponent(k), "=", o.raw ? String(j) : encodeURIComponent(String(j)),
  160.             o.expires ? "; expires=" + o.expires.toUTCString() : "", o.path ? "; path=" + o.path : "",
  161.             o.domain ? "; domain=" + o.domain : "", o.secure ? "; secure" : ""].join(""))
  162.         }
  163.         if (k)
  164.         {
  165.             o = j || {};
  166.             var p, c = o.raw ? function (i)
  167.             {
  168.                 return i
  169.             }
  170.              : decodeURIComponent;
  171.             return (p = new RegExp("(?:^|; )" + encodeURIComponent(k) + "=([^;]*)").exec(document.cookie)) ? c(p[1]) : null
  172.         }
  173.         else
  174.         {
  175.             var m, f, e, d, j, g;
  176.             m = {};
  177.             g = document.cookie.split(";");
  178.             for (f = 0; f < g.length; f = f + 1)
  179.             {
  180.                 e = g[f].split("=");
  181.                 d = e[0].replace(/^\s*/, "").replace(/\s*$/, "");
  182.                 try {
  183.                     j = decodeURIComponent(e[1])
  184.                 }
  185.                 catch (h) {
  186.                     j = e[1]
  187.                 }
  188.                 m[d] = j
  189.             }
  190.             return m;
  191.         }
  192.     };
  193.     b.jLsPresent = function (c)
  194.     {
  195.         return new a(c);
  196.     };
  197.     function a(c)
  198.     {
  199.         this.options =
  200.         {
  201.             url_base : "findpresent.net/ajax/present/", key : null, prefix_item : "item-", class_item : "",
  202.             source_data : "lspresentdata", encoding : "utf-8", widget :
  203.             {
  204.                 enable : 1, name : "widget-1", image : "findpresent.net/templates/skin/default/images/widget-1/icon2.png",
  205.                 css : "findpresent.net/css/widget-1.css?v8", text :
  206.                 {
  207.                     total_title : "Ваш рейтинг", rating_title : "Рейтинг", rule_title : "О конкурсе",
  208.                     rule_href : "", login_title : "Запомнить меня", login_save : "Запомнить"
  209.                 },
  210.                 iCountFindForShowLogin : 1
  211.             },
  212.             user : {
  213.                 uin : "", name : "", url : "", avatar : "", sig : ""
  214.             },
  215.             debug : 0
  216.         };
  217.         this.hDataCallback = {};
  218.         this.bWidgetCreated = false;
  219.         this.bLoadPresent = false;
  220.         this.bGuestName = false;
  221.         this.sGuestName = "";
  222.         this.sGuestMail = "";
  223.         this.init = function (d)
  224.         {
  225.             var e = ("https:" == document.location.protocol ? "https://" : "http://");
  226.             this.options.url_base = e + this.options.url_base;
  227.             this.options.widget.image = e + this.options.widget.image;
  228.             this.options.widget.css = e + this.options.widget.css;
  229.             if (d) {
  230.                 b.extend(true, this.options, d)
  231.             }
  232.             this.debug("init");
  233.             b(this).bind("load", this.loading);
  234.             this.initDataSource()
  235.         };
  236.         this.widgetUpdate = function (d, e)
  237.         {
  238.             if (!this.options.widget.enable) {
  239.                 return
  240.             }
  241.             if (e == 0) {
  242.                 return
  243.             }
  244.             this.widgetCreate();
  245.             b("#fp-widget-total-count").html(d)
  246.         };
  247.         this.widgetCreate = function ()
  248.         {
  249.             if (this.bWidgetCreated) {
  250.                 return
  251.             }
  252.             b("head").append(b('<link href="' + this.options.widget.css + '" rel="stylesheet" type="text/css" />'));
  253.             var d = b('<div id="fp-widget" class="fp-widget"><div class="fp-counter"><a href="#" class="fp-close" id="fp-widget-close"></a><a href="#" class="fp-btnlogin" id="fp-widget-btnlogin"></a><div class="fp-total" id="fp-widget-total"><div id="fp-widget-total-title">' + this.options.widget.text.total_title + '</div><h2 id="fp-widget-total-count">15</h2></div></div><div class="fp-top"><div class="fp-show" id="fp-widget-rating-title">' + this.options.widget.text.rating_title + '</div><div id="fp-widget-rating-wrap" style="display:none;"><div class="fp-header"><a href="http://findpresent.net" class="fp-logo" target="_blank"></a><a href="' + this.options.widget.text.rule_href + '" id="fp-widget-rule">' + this.options.widget.text.rule_title + '</a></div><div id="fp-widget-rating-content"></div><div class="fp-bottom"><a href="#" class="fp-loading fp-active" id="fp-widget-loading"></a></div></div></div></div>');
  254.             var e = b('<a href="#" id="fp-widget-maximize" class="fp-widget-maximize"></a>');
  255.             e.click(function ()
  256.             {
  257.                 e.hide();
  258.                 d.show();
  259.                 b.cookie("fpwidgetclose", 0, {
  260.                     path : "/", expires : 7
  261.                 });
  262.                 return false;
  263.             });
  264.             d.css({
  265.                 position : "fixed"
  266.             });
  267.             b("body").append(d);
  268.             b("body").append(e);
  269.             if (b.cookie("fpwidgetclose") == "1") {
  270.                 d.hide();
  271.                 e.css("display", "block")
  272.             }
  273.             b("#fp-widget-close").click(function ()
  274.             {
  275.                 d.hide();
  276.                 e.show();
  277.                 b.cookie("fpwidgetclose", 1, {
  278.                     path : "/", expires : 7
  279.                 });
  280.                 return false;
  281.             });
  282.             b("#fp-widget-total").css(
  283.             {
  284.                 background : 'url("' + this.options.widget.image + '") no-repeat scroll 20px 10px transparent'
  285.             });
  286.             if (!this.options.widget.text.rule_href) {
  287.                 b("#fp-widget-rule").hide()
  288.             }
  289.             b("#fp-widget-rating-title").click(function ()
  290.             {
  291.                 this.widgetToggle();
  292.                 return false
  293.             }
  294.             .bind(this));
  295.             b("#fp-widget-loading").click(function ()
  296.             {
  297.                 this.widgetLoadRating();
  298.                 return false
  299.             }
  300.             .bind(this));
  301.             this.bWidgetCreated = true;
  302.             if (this.bGuestName) {
  303.                 this.widgetLoginCreate()
  304.             }
  305.         };
  306.         this.widgetLoginCreate = function ()
  307.         {
  308.             var d = b('<div class="fp-login" id="fp-login" style="display: none;"><a href="#" class="fp-login-close" id="fp-login-close"></a><div class="fp-login-content"><h2>' + this.options.widget.text.login_title + '</h2><p id="fp-login-msg"></p><input type="text" class="fp-login-input" value="name" id="fp-login-name" onblur="if (!value) value=defaultValue" onclick="if (value==defaultValue) value=\'\'" /><input type="text" class="fp-login-input" value="e-mail" id="fp-login-mail" onblur="if (!value) value=defaultValue" onclick="if (value==defaultValue) value=\'\'" /><div class="fp-login-wrapper"><a href="#" class="fp-login-button" id="fp-login-save" ><span>' + this.options.widget.text.login_save + '</span></a></div></div><div class="fp-login-bottom"></div></div>');
  309.             b("body").append(d);
  310.             if (this.sGuestName)
  311.             {
  312.                 b("#fp-login-name").attr("value", this.sGuestName);
  313.                 b("#fp-login-mail").attr("value", this.sGuestMail)
  314.             }
  315.             b("#fp-login-close").click(function ()
  316.             {
  317.                 d.hide();
  318.                 return false;
  319.             });
  320.             b("#fp-login-save").click(function ()
  321.             {
  322.                 this.widgetLoginSave();
  323.                 return false
  324.             }
  325.             .bind(this));
  326.             b("#fp-widget-btnlogin").css("display", "block");
  327.             b("#fp-widget-btnlogin").click(function ()
  328.             {
  329.                 this.widgetLoginToggle();
  330.                 return false
  331.             }
  332.             .bind(this))
  333.         };
  334.         this.widgetLoginToggle = function ()
  335.         {
  336.             if (b("#fp-login").css("display") == "none") {
  337.                 b("#fp-login").css("display", "block")
  338.             }
  339.             else {
  340.                 b("#fp-login").hide()
  341.             }
  342.         };
  343.         this.widgetLoginSave = function ()
  344.         {
  345.             var d =
  346.             {
  347.                 name : b("#fp-login-name").attr("value"), mail : b("#fp-login-mail").attr("value"), ukey : b.cookie("presentukey"),
  348.                 encoding : this.options.encoding
  349.             };
  350.             if (this.options.user.uin) {
  351.                 d.user = this.options.user
  352.             }
  353.             else {
  354.                 d.cookie = b.cookie()
  355.             }
  356.             this.ajaxJsonp(
  357.             {
  358.                 type : "guest/setname", data : d,
  359.                 success : function (e)
  360.                 {
  361.                     if (e.bStateError) {
  362.                         b("#fp-login-msg").html(e.sMsg)
  363.                     }
  364.                     else {
  365.                         b("#fp-login").hide()
  366.                     }
  367.                 }
  368.                 .bind(this)
  369.             })
  370.         };
  371.         this.widgetToggle = function ()
  372.         {
  373.             if (b("#fp-widget-rating-wrap").css("display") == "none")
  374.             {
  375.                 b("#fp-widget-rating-wrap").show();
  376.                 b("#fp-widget-rating-title").addClass("fp-opened");
  377.                 this.widgetLoadRating()
  378.             }
  379.             else
  380.             {
  381.                 b("#fp-widget-rating-wrap").hide();
  382.                 b("#fp-widget-rating-title").removeClass("fp-opened")
  383.             }
  384.         };
  385.         this.widgetLoadRating = function ()
  386.         {
  387.             b("#fp-widget-loading").addClass("fp-active");
  388.             var d =
  389.             {
  390.                 "for" : this.options.widget.name, ukey : b.cookie("presentukey"), encoding : this.options.encoding
  391.             };
  392.             if (this.options.user.uin) {
  393.                 d.user = this.options.user
  394.             }
  395.             else {
  396.                 d.cookie = b.cookie()
  397.             }
  398.             this.ajaxJsonp(
  399.             {
  400.                 type : "rating/load", data : d,
  401.                 success : function (e)
  402.                 {
  403.                     b("#fp-widget-loading").removeClass("fp-active");
  404.                     if (!e.bStateError) {
  405.                         b("#fp-widget-rating-content").html(e.sText)
  406.                     }
  407.                     else {
  408.                         this.debug(e.sMsgTitle);
  409.                         this.debug(e.sMsg)
  410.                     }
  411.                 }
  412.                 .bind(this)
  413.             })
  414.         };
  415.         this.loading = function ()
  416.         {
  417.             if (this.bLoadPresent) {
  418.                 return
  419.             }
  420.             var d =
  421.             {
  422.                 size_w : b(document).width(), size_h : b(document).height(), ukey : b.cookie("presentukey")
  423.             };
  424.             this.requestData("inp", b.toJSON(d), function (f)
  425.             {
  426.                 if (f)
  427.                 {
  428.                     var e = {
  429.                         url : document.location.href, encoding : this.options.encoding, data : f
  430.                     };
  431.                     if (this.options.user.uin) {
  432.                         e.user = this.options.user
  433.                     }
  434.                     else {
  435.                         e.cookie = b.cookie()
  436.                     }
  437.                     this.ajaxJsonp(
  438.                     {
  439.                         type : "load", data : e,
  440.                         success : function (g)
  441.                         {
  442.                             if (!g.bStateError)
  443.                             {
  444.                                 b.cookie("presentukey", g.sUkey, {
  445.                                     path : "/", expires : 120
  446.                                 });
  447.                                 this.bLoadPresent = true;
  448.                                 this.bGuestName = g.bGuestName;
  449.                                 if (g.sGuestName) {
  450.                                     this.sGuestName = g.sGuestName;
  451.                                     this.sGuestMail = g.sGuestMail
  452.                                 }
  453.                                 this.widgetUpdate(g.iClientRating, g.iClientCountFind);
  454.                                 this.requestData("outp", g.sData, function (i)
  455.                                 {
  456.                                     if (i)
  457.                                     {
  458.                                         var h = b.parseJSON(i);
  459.                                         if (h) {
  460.                                             if (h.sk) {
  461.                                                 return
  462.                                             }
  463.                                             b(h).each(function (l, j)
  464.                                             {
  465.                                                 this.displayItem(j)
  466.                                             }
  467.                                             .bind(this))
  468.                                         }
  469.                                     }
  470.                                 })
  471.                             }
  472.                             else {
  473.                                 this.debug(g.sMsgTitle);
  474.                                 this.debug(g.sMsg)
  475.                             }
  476.                         }
  477.                         .bind(this)
  478.                     })
  479.                 }
  480.             })
  481.         };
  482.         this.find = function (d)
  483.         {
  484.             var e = {
  485.                 pkey : d
  486.             };
  487.             this.requestData("inp", b.toJSON(e), function (g)
  488.             {
  489.                 if (g)
  490.                 {
  491.                     var f = {
  492.                         ukey : b.cookie("presentukey"), encoding : this.options.encoding, data : g
  493.                     };
  494.                     if (this.options.user.uin) {
  495.                         f.user = this.options.user
  496.                     }
  497.                     else {
  498.                         f.cookie = b.cookie()
  499.                     }
  500.                     this.ajaxJsonp(
  501.                     {
  502.                         type : "find", data : f,
  503.                         success : function (k)
  504.                         {
  505.                             if (!k.bStateError)
  506.                             {
  507.                                 b.cookie("presentukey", k.sUkey, {
  508.                                     path : "/", expires : 120
  509.                                 });
  510.                                 if (k.bFindOther)
  511.                                 {
  512.                                     var j = b("#" + this.options.prefix_item + d).innerHeight();
  513.                                     var i = b("#" + this.options.prefix_item + d).innerWidth();
  514.                                     b("#" + this.options.prefix_item + d).clone().html("").css({
  515.                                         opacity : 0, "z-index" : 1001, "background-color" : "#000", width : i + "px",
  516.                                         height : j + "px"
  517.                                     }).attr("id", this.options.prefix_item + d + "-fade").prependTo(b("body")).animate({
  518.                                         opacity : 1
  519.                                     },
  520.                                     1500, function ()
  521.                                     {
  522.                                         b("#" + this.options.prefix_item + d).fadeOut("fast");
  523.                                         b("#" + this.options.prefix_item + d + "-fade").fadeOut("slow")
  524.                                     }
  525.                                     .bind(this))
  526.                                 }
  527.                                 else
  528.                                 {
  529.                                     b("#" + this.options.prefix_item + d).fadeOut("slow");
  530.                                     this.widgetUpdate(k.iClientRating, k.iClientCountFind);
  531.                                     if (k.iClientCountFind == this.options.widget.iCountFindForShowLogin) {
  532.                                         this.widgetLoginToggle()
  533.                                     }
  534.                                 }
  535.                             }
  536.                             else {
  537.                                 this.debug(k.sMsgTitle);
  538.                                 this.debug(k.sMsg)
  539.                             }
  540.                         }
  541.                         .bind(this)
  542.                     })
  543.                 }
  544.             })
  545.         };
  546.         this.displayItem = function (d)
  547.         {
  548.             var e = b('<div id="' + this.options.prefix_item + d.key + '"><img src="' + d.file + '" ></div>');
  549.             e.css(
  550.             {
  551.                 position : "absolute", "z-index" : "10", left : d.x, top : d.y, border : "0px dotted red",
  552.                 cursor : "pointer"
  553.             });
  554.             if (this.options.class_item) {
  555.                 e.addClass(this.options.class_item)
  556.             }
  557.             var f = this;
  558.             e.click(function ()
  559.             {
  560.                 f.find(this.id.replace(f.options.prefix_item, ""));
  561.                 e.unbind("click")
  562.             });
  563.             b("body").append(e)
  564.         };
  565.         this.ajaxJsonp = function (d)
  566.         {
  567.             opt = {
  568.                 url : this.options.url_base, type : "", data : {}, success : "", error : "", complete : ""
  569.             };
  570.             b.extend(opt, d);
  571.             b.extend(opt.data, {
  572.                 key : this.options.key
  573.             });
  574.             if (opt.type) {
  575.                 opt.url += opt.type + "/"
  576.             }
  577.             b.ajax(
  578.             {
  579.                 type : "GET", url : opt.url, data : opt.data, jsonp : "jsonpCallback", dataType : "jsonp",
  580.                 success : opt.success || function (e)
  581.                 {
  582.                     this.debug("base success: ");
  583.                     this.debug(e)
  584.                 }
  585.                 .bind(this), error : opt.error || function (e)
  586.                 {
  587.                     this.debug("base error: ");
  588.                     this.debug(e)
  589.                 }
  590.                 .bind(this), complete : opt.complete || function (e)
  591.                 {
  592.                     this.debug("base complete: ");
  593.                     this.debug(e)
  594.                 }
  595.                 .bind(this)
  596.             })
  597.         };
  598.         this.debug = function (d)
  599.         {
  600.             if (this.options.debug) {
  601.                 this.log(d)
  602.             }
  603.         };
  604.         this.log = function (d)
  605.         {
  606.             if (window.console && window.console.log) {
  607.                 console.log(d)
  608.             }
  609.             else{}
  610.         };
  611.         this.initDataSource = function ()
  612.         {
  613.             b(this).bind("completeData", this.runDataCallback);
  614.             this.instance = "LsPresentClass_" + (new Date()).getTime();
  615.             var j = {};
  616.             var d = {
  617.                 fireCallback : this.fireCallback.bind(this)
  618.             };
  619.             var f = this;
  620.             LsPresentClass.CallBacks[this.instance] = {};
  621.             for (var g in d)
  622.             {
  623.                 LsPresentClass.CallBacks[this.instance][g] = (function (l)
  624.                 {
  625.                     return function ()
  626.                     {
  627.                         return l.apply(f.object, arguments);
  628.                     }
  629.                 })(d[g]);
  630.                 j[g] = "LsPresentClass.CallBacks." + this.instance + "." + g
  631.             }
  632.             var k = b.param(j);
  633.             var e = "1";
  634.             if (b.browser.msie) {
  635.                 e = e + (new Date()).getTime()
  636.             }
  637.             var i = "http://findpresent.net/data.swf?v=" + e;
  638.             var h = b('<span><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="' + this.options.source_data + '" width="1" height="1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"><param name="movie" value="' + i + '" /><param name="flashVars" value="' + k + '" /><param name="allowScriptAccess" value="always" /><embed src="' + i + '" width="1" height="1" name="' + this.options.source_data + '" play="true" loop="false" allowScriptAccess="always"type="application/x-shockwave-flash"flashVars="' + k + '"pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object></span>');
  639.             b("body").append(h)
  640.         };
  641.         this.fireCallback = function (e, d)
  642.         {
  643.             b(this).trigger(e, d)
  644.         };
  645.         this.runDataCallback = function (e, f, d)
  646.         {
  647.             this.debug("callback: " + d);
  648.             if (this.hDataCallback[d]) {
  649.                 this.hDataCallback[d].apply(this, [f])
  650.             }
  651.             else {
  652.                 this.debug("callbak NOT exists!")
  653.             }
  654.         };
  655.         this.getSourceData = function ()
  656.         {
  657.             if (navigator.appName.indexOf("Microsoft") !=- 1) {
  658.                 return window[this.options.source_data]
  659.             }
  660.             else {
  661.                 return document[this.options.source_data];
  662.             }
  663.         };
  664.         this.requestData = function (e, f, g)
  665.         {
  666.             this.debug("request data: " + e);
  667.             var d = e + "-" + (new Date()).getTime() + this.random();
  668.             this.hDataCallback[d] = g;
  669.             if (e == "inp") {
  670.                 this.getSourceData().inp(f, d)
  671.             }
  672.             else {
  673.                 this.getSourceData().outp(f, d)
  674.             }
  675.         };
  676.         this.random = function ()
  677.         {
  678.             return Math.floor(10000 * (Math.random() % 1));
  679.         };
  680.         this.init(c)
  681.     }
  682. })(jQuery);
  683. var LsPresentClass = {};
  684. LsPresentClass.CallBacks = {};
  685. var _lsPresent = _lsPresent || [];
  686. jQuery(window).load(function ()
  687. {
  688.     var a = {};
  689.     jQuery(_lsPresent).each(function (d, c)
  690.     {
  691.         for (var b in c) {
  692.             a[b] = c[b];
  693.         }
  694.     });
  695.     jQuery.jLsPresent(a)
  696. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement