google.load("jquery", "1.3.2");
google.load("jqueryui", "1.7.2");
google.setOnLoadCallback(function() {
  jQuery('head').append('<link href="http://admin.revenuepwr.com/stylesheets/colorbox.css" media="screen" rel="stylesheet" type="text/css" />');
  
  $.getScript('http://admin.revenuepwr.com/javascripts/jquery.colorbox.js', function() {

    $("a#registration_widget").click(function() {
      $(this).colorbox({
        href: $(this).attr('href'), iframe: true, overlayClose: true, innerWidth: 590, innerHeight: 405, scrolling: false, opacity: 0.7,
        onLoad: function() {
          $('object').hide();
          $('embed').hide();
          $('#cboxClose').unbind();
          $('#cboxClose').click(function() {
          $.fn.colorbox.close();
          });
        }
      });
    });
    
      $("a#loyalty_balance").click(function() {
        $(this).colorbox({
        href: $(this).attr('href'), iframe: true, overlayClose: true, innerWidth: 590, innerHeight: 385, scrolling: false, opacity: 0.7,
        onLoad: function() {
          $('object').hide();
          $('embed').hide();
          $('#cboxClose').unbind();
          $('#cboxClose').click(function() {
          parent.$.fn.colorbox.close();
          });
        }
      });
    });
    
		$("#gt-res").click(function() {
		  $(this).colorbox({
		    href: $(this).attr('href'), innerWidth: 370, innerHeight: 500, scrolling: false, iframe: true, overlayClose: false, opacity: 0.7, 
		    onLoad:function(){
		      $("#olrFooter").show();
		      $('object').hide();
          $('embed').hide();
          $('#cboxClose').unbind();
          $('#cboxClose').click(function() {
          $.fn.colorbox.close();
          });
		    },
		    onClose:function(){
		      $("#olrFooter").hide();
		    }
		  });
		});
		
    $(".faux_button").css('visibility', 'visible');
			set_legal();
    if( $("#parking_link") ) {
      $("#parking_link").click(function() {
        $.colorbox({href: "#parking", inline: true, overlayClose: true, innerWidth: 520, height: 500, scrolling: false, opacity: 0.7, close: "",
          onLoad:        function() {
            $('#cboxClose').unbind();
            $('#cboxClose').click(function() {
              $.colorbox.close();
            });
          }
        });
      });
    }
  });
  var path = window.location.pathname.substring(1).split("/");
  if(path[0] == "online_reservations" && path[1].length == 6) {
    $.getScript('http://admin.revenuepwr.com/javascripts/jquery.colorbox.js', function() {
      set_legal();
      $.fn.colorbox({href:'/websites/olr/'+path[1], innerWidth:520, innerHeight:725, scrolling:false, iframe:true, overlayClose:false, opacity:0.7, close:'', onLoad:function(){$("#olrFooter").show();}, onClose:function(){$("#olrFooter").hide();} });
    });
  }
  function set_legal(){
    // var legal = $('<div id="olrFooter" style="display:none; z-index: 9999; font-size: .9em; margin-left: 20px; width: 540px; text-align: center; position: relative; top: 620px; color: #D3D3D3;">Patents (6,384,850) (6,871,325) (6,982,733)</div>');
    // $("#colorbox").append(legal);
    // $("#colorbox").css("padding-bottom","2px");
    // $("#colorbox").css("padding-bottom","2px");
  };
});

