Advertisement
Kalashnikov

Untitled

May 25th, 2012
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var f = null;
  2. function hideResults() {
  3.     $("#results").css("visibility", "hidden")
  4.     }
  5. function submitForm(A) {
  6.     if (window.event) {
  7.         window.event.returnValue = false
  8.     } else {
  9.         A.preventDefault()
  10.         }
  11.     hideResults();
  12.     f.submit()
  13.     }
  14. function showForm(C) {
  15.     var B = C.target;
  16.     var A = B.href.substring(B.href.indexOf("#"));
  17.     switch (A) {
  18.     case "#traditionalForm":
  19.         $("#inputForm").hide();
  20.         $("#outputForm").hide();
  21.         $("#toIForm").removeClass("current");
  22.         $("#toOForm").removeClass("current");
  23.         break;
  24.     case "#inputForm":
  25.         $("#traditionalForm").hide();
  26.         $("#outputForm").hide();
  27.         $("#toOForm").removeClass("current");
  28.         $("#toTForm").removeClass("current");
  29.         break;
  30.     case "#outputForm":
  31.         $("#traditionalForm").hide();
  32.         $("#inputForm").hide();
  33.         $("#toIForm").removeClass("current");
  34.         $("#toTForm").removeClass("current");
  35.         break
  36.     }
  37.     $(A).fadeIn(500);
  38.     $('a[href="' + A + '"]').addClass("current");
  39.     C.preventDefault();
  40.     return false
  41. }
  42. function showRand(A) {
  43.     f.expr.value = $.trim(decodeURIComponent(randomExample))
  44.     }
  45. var tagline_count = 5;
  46. var current_tagline = 0;
  47. function taglineRotate() {
  48.     current_tagline = ((current_tagline + 1) % tagline_count) + 1;
  49.     $("#adTagline").fadeOut(1000, function() {
  50.         $("#adTagline").attr("src", "images/tagline" + current_tagline + ".gif").fadeIn(1000)
  51.         })
  52.     }
  53. $(document).ready(function() {
  54.     $("#integrator").after('<a href="#" id="compute" title="Compute online with Mathematica" accesskey="c"></a>');
  55.     f = document.forms[0];
  56.     if (f.random && f.expr) {
  57.         f.expr.onchange = function() {
  58.             f.random.value = "false"
  59.         }
  60.     }
  61.     $("#dx").click(hideResults);
  62.     $("#compute").click(submitForm);
  63.     $("#toTForm").click(showForm);
  64.     $("#toOForm").click(showForm);
  65.     $("#toIForm").click(showForm);
  66.     $("#random").click(function(A) {
  67.         hideResults();
  68.         showRand()
  69.         });
  70.     $('#connect a[rel="external"]').click(function(A) {
  71.         $.get("/Integrator/utilities/Hello.jsp", {
  72.             url: $(this).attr("href")
  73.             })
  74.         });
  75.     $('a[rel="external"]').click(function(A) {
  76.         window.open($(this).attr("href"));
  77.         return false
  78.     });
  79.     $("#video").unbind().click(function(A) {
  80.         A.preventDefault();
  81.         window.open($(this).attr("href"), "video", "height=635, width=742, resizable=1");
  82.         return false
  83.     });
  84.     $("#toIForm,#toOForm").click(function(A) {
  85.         $.get("/Integrator/utilities/Hello.jsp", {
  86.             url: $(this).attr("href")
  87.             })
  88.         })
  89.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement