try {document.execCommand("BackgroundImageCache", false, true);} catch(err) {}
var Scriptaculous = {
  Version: '1.8.0_pre1',
  require: function(libraryName) {
    // inserting via DOM fails in Safari 2.0, so brute force approach
    document.write('<script type="text/javascript" src="'+libraryName+'"></script>');
  },
  REQUIRED_PROTOTYPE: '1.6.0',
  load: function() {
    function convertVersionString(versionString){
      var r = versionString.split('.');
      return parseInt(r[0])*100000 + parseInt(r[1])*1000 + parseInt(r[2]);
    }

    if((typeof Prototype=='undefined') ||
       (typeof Element == 'undefined') ||
       (typeof Element.Methods=='undefined') ||
       (convertVersionString(Prototype.Version) <
        convertVersionString(Scriptaculous.REQUIRED_PROTOTYPE)))
       throw("script.aculo.us requires the Prototype JavaScript framework >= " +
        Scriptaculous.REQUIRED_PROTOTYPE);

    $A(document.getElementsByTagName("script")).findAll( function(s) {
      return (s.src && s.src.match(/scriptaculous\.js(\?.*)?$/))
    }).each( function(s) {
      var path = s.src.replace(/scriptaculous\.js(\?.*)?$/,'');
      var includes = s.src.match(/\?.*load=([a-z,]*)/);
      (includes ? includes[1] : 'builder,effects,dragdrop,controls,slider').split(',').each(
       function(include) { Scriptaculous.require(path+include+'.js') });
    });
  }
}

Scriptaculous.load();

var gmarkers = new Array();
          var za_htmls = new Array();
          var to_htmls = new Array();
          var from_htmls = new Array();
          var points = new Array();
          var map = null;
      var geocoder = null;
      geocoder = new GClientGeocoder();
      var i = 0;
          var iconMC = new GIcon();
          iconMC.image = "http://www.q9web.com/marriottwest/images/googlemaps_icon.png";
          iconMC.shadow = "http://www.q9web.com/marriottwest/images/googlemaps_iconshadow.png";
          iconMC.iconSize = new GSize(20, 34);
          iconMC.shadowSize = new GSize(37, 34);
          iconMC.iconAnchor = new GPoint(9, 34);
          iconMC.infoWindowAnchor = new GPoint(9, 2);
          iconMC.infoShadowAnchor = new GPoint(18, 25);

          var iconJW = new GIcon();
          iconJW.image = "http://www.q9web.com/marriottwest/images/googlemaps_icon_jw.png";
          iconJW.shadow = "http://www.q9web.com/marriottwest/images/googlemaps_iconshadow.png";
          iconJW.iconSize = new GSize(20, 34);
          iconJW.shadowSize = new GSize(37, 34);
          iconJW.iconAnchor = new GPoint(9, 34);
          iconJW.infoWindowAnchor = new GPoint(9, 2);
          iconJW.infoShadowAnchor = new GPoint(18, 25);
      // A function to create the marker and set up the event window
      function createMarker(map, point,name,html, icon, szoom) {
        var marker = new GMarker(point, icon);
        // The info window version with the "to here" form open
        to_htmls[i] = html + '<div class="gdir">Get Directions: To here - <a href="javascript:fromhere(' + i + ')">From here<\/a>' +
           '<br>Start address:<form action="http://maps.google.com/maps" method="get" target="_blank">' +
           '<input type="text" size=18 maxlength=40 name="saddr" id="saddr" value="" \/> ' +
           '&nbsp;<input value="Go" TYPE="submit" \/>' +
           '<input type="hidden" name="daddr" value="' + point.lat() + ',' + point.lng() + '"\/><\/form><\/div><\/div>';
        // The info window version with the "to here" form open
        from_htmls[i] = html + '<div class="gdir">Get Directions: <a href="javascript:tohere(' + i + ')">To here<\/a> - From here' +
           '<br>End address:<form action="http://maps.google.com/maps" method="get"" target="_blank">' +
           '<input type="text" size=18 maxlength=40 name="daddr" id="daddr" value="" /> ' +
           '&nbsp;<input value="Go" TYPE="submit" \/>' +
           '<input type="hidden" name="saddr" value="' + point.lat() + ',' + point.lng() + '"\/><\/form><\/div><\/div>';
        // The inactive version of the direction info
        html = html + '<div class="gdir">Get Directions: <a href="javascript:tohere('+i+')">To here<\/a> - <a href="javascript:fromhere('+i+')">From here<\/a><\/div><\/div>';
        GEvent.addListener(marker, "click", function() {
          map.setCenter(point, szoom);
          marker.openInfoWindowHtml(html);
        });
        points[i] = point;
        gmarkers[i] = marker;
        za_htmls[i] = html;
        i++;
        return marker;
      }

      // functions that open the directions forms
      function tohere(i) {
        gmarkers[i].openInfoWindowHtml(to_htmls[i]);
      }
      function fromhere(i) {
        gmarkers[i].openInfoWindowHtml(from_htmls[i]);
      }
      function starthere(i) {
        gmarkers[i].openInfoWindowHtml(za_htmls[i]);
      }
        var start = 0;
        var scrollDir = 0;
        var speed = 3;
        function speedup(){
           speed = 5;
        }
        function scrollDiv () {
//                alert(document.getElementById("slhold").style.width)
//                mcont
                var mask = document.getElementById("mask");
                var content = document.getElementById("mcont");
                switch (scrollDir) {
                        case 1: {
                                if ((content.style.left.substring(0, content.style.left.length - 2) * 1) + speed < 0)
                                        content.style.left = ((content.style.left.substring(0, content.style.left.length - 2) * 1) + speed) + "px";
                                else content.style.left = "0px";
                        } break;
                        case 2: {
                                if ((content.style.left.substring(0, content.style.left.length - 2) * 1) - speed > (-content.offsetWidth + mask.offsetWidth))
                                        content.style.left = ((content.style.left.substring(0, content.style.left.length - 2) * 1) - speed) + "px";
                                else content.style.left = (-content.offsetWidth + mask.offsetWidth) + "px";
                        } break;
                }
                setTimeout("scrollDiv()", 20);
        }
