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