Advertisement
RandallKent

Untitled

Feb 27th, 2012
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* EDIT LINKS HERE */
  2. var links = {
  3.               "SINGLE TICKET CALENDAR" : { dev: "http://devtest.thephil.org/buytickets/calendar.aspx",
  4.                                            staging: "http://staging.thephil.org/buytickets/calendar.aspx",
  5.                                            production: "http://www.thephil.org/buytickets/calendar.aspx"},
  6.   "PRE-SEASON & SUBSCRIPTION PACKAGES" : { dev: "http://tickets.thephil.org/_QA_/subscription/packages.aspx?promo=1961",
  7.                                            staging: "http://tickets.thephil.org/_QA_/subscription/packages.aspx?promo=1961",
  8.                                            production: "http://tickets.thephil.org/subscription/packages.aspx?promo=1961"},
  9.                      "MUSIC EDUCATION" : { dev: "http://devtest.thephil.org/buytickets/tix/sourceselect.aspx",
  10.                                            staging: "http://staging.thephil.org/buytickets/tix/sourceselect.aspx",
  11.                                            production: "http://www.thephil.org/buytickets/tix/sourceselect.aspx"}
  12. }
  13.  
  14. /****************************************
  15.  *                                      *
  16.  *   DON'T EDIT ANYTHING BELOW THIS     *
  17.  *                                      *
  18.  ****************************************/
  19. var timeout = 800;
  20. var closetimer = 0;
  21. var ddmenuitem = 0;
  22.  
  23. // open hidden layer
  24. function mopen(id) {
  25.   // cancel close timer
  26.   mcancelclosetime();
  27.  
  28.   // close old layer
  29.   if (ddmenuitem) ddmenuitem.style.visibility = 'hidden';
  30.  
  31.   // get new layer and show it
  32.   ddmenuitem = document.getElementById(id);
  33.   ddmenuitem.style.visibility = 'visible';
  34.  
  35. }
  36. // close showed layer
  37. function mclose() {
  38.   if (ddmenuitem) ddmenuitem.style.visibility = 'hidden';
  39. }
  40.  
  41. // go close timer
  42. function mclosetime() {
  43.   closetimer = window.setTimeout(mclose, timeout);
  44. }
  45.  
  46. // cancel close timer
  47. function mcancelclosetime() {
  48.   if (closetimer) {
  49.     window.clearTimeout(closetimer);
  50.     closetimer = null;
  51.   }
  52. }
  53.  
  54. function generateLinks(environment)
  55. {
  56.   var ahrefs = ''
  57.   for(link in links) {
  58.     ahrefs += "<a href=\"" + links[link][environment] + "\">" + link + "</a>";
  59.   }
  60.   return ahrefs;
  61. }
  62.  
  63. function changeBuyTicketsMenubar2() {
  64.   document.getElementById('BuyTicketsMenubar').innerHTML = '<ul id="sddm"> \
  65.    <li><a href="#" \
  66.      onmouseover="mopen(\'m1\')" \
  67.      onmouseout="mclosetime()">BUY TICKETS</a> \
  68.      <div id="m1" \
  69.        onmouseover="mcancelclosetime()" \
  70.        onmouseout="mclosetime()">\
  71.       ' +
  72.            (function(){switch (document.location.host)
  73.             {
  74.               case 'devtest.thephil.org':
  75.                 return generateLinks('dev');
  76.               case 'staging.thephil.org':
  77.                 return generateLinks('staging');
  78.               case 'thephil.org':
  79.               case 'www.thephil.org':
  80.                 return generateLinks('production');
  81.               default:
  82.                 return '';
  83.             };}())
  84.         + ' \
  85.      </div> \
  86.    </li> \
  87.    </ul>';
  88. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement