
var galleryLoader;
var selectedGallery = 0;
var showGallery_234 = false;
var requestUri_234 = location.href;
var re = /[\?&](ghash=(.*))/gi;
requestUri_234 = requestUri_234.replace(re, '');
if(requestUri_234.indexOf('?') < 0) {
    requestUri_234 = requestUri_234 + '?';
} else {
    requestUri_234 = requestUri_234 + '&';
}
if (galleryLoader == undefined || selectedGallery == 1) {
    showGallery_234 = true;
}
var imageGalleryLeftPos_234       = 31;
var previewImgContainerHeight_234 = 365;
var imageGalleryWidth_234         = 507;
var maxGalleryXPos_234            = 31;
var minGalleryXPos_234            = -918;
var thumbnailsPosition_234        = 'H';
var scrollingSpeed_234            = 60;
var slideShowDelay_234            = 5000;
var ihost_234                     = 'http://images.sonoranseacondo.com/';
var ipath_234                     = ihost_234 + '68/';
var Photos_234                    = new Array();
Photos_234[0] = new Array( ipath_234 + '5671.jpg', ipath_234 + 'thumbnail_5671.jpg', "1.jpg", "", "", "540", "358");
Photos_234[1] = new Array( ipath_234 + '5672.jpg', ipath_234 + 'thumbnail_5672.jpg', "2.jpg", "", "", "540", "358");
Photos_234[2] = new Array( ipath_234 + '5673.jpg', ipath_234 + 'thumbnail_5673.jpg', "3.jpg", "", "", "540", "358");
Photos_234[3] = new Array( ipath_234 + '5674.jpg', ipath_234 + 'thumbnail_5674.jpg', "4.jpg", "", "", "540", "358");
Photos_234[4] = new Array( ipath_234 + '5675.jpg', ipath_234 + 'thumbnail_5675.jpg', "5.jpg", "", "", "540", "358");
Photos_234[5] = new Array( ipath_234 + '5676.jpg', ipath_234 + 'thumbnail_5676.jpg', "6.jpg", "", "", "540", "358");
Photos_234[6] = new Array( ipath_234 + '5677.jpg', ipath_234 + 'thumbnail_5677.jpg', "7.jpg", "", "", "540", "358");
Photos_234[7] = new Array( ipath_234 + '5678.jpg', ipath_234 + 'thumbnail_5678.jpg', "8.jpg", "", "", "540", "358");
Photos_234[8] = new Array( ipath_234 + '5679.jpg', ipath_234 + 'thumbnail_5679.jpg', "9.jpg", "", "", "540", "358");
Photos_234[9] = new Array( ipath_234 + '5680.jpg', ipath_234 + 'thumbnail_5680.jpg', "10.jpg", "", "", "540", "358");
Photos_234[10] = new Array( ipath_234 + '5681.jpg', ipath_234 + 'thumbnail_5681.jpg', "11.jpg", "", "", "540", "358");
Photos_234[11] = new Array( ipath_234 + '5682.jpg', ipath_234 + 'thumbnail_5682.jpg', "12.jpg", "", "", "540", "358");
Photos_234[12] = new Array( ipath_234 + '5683.jpg', ipath_234 + 'thumbnail_5683.jpg', "13.jpg", "", "", "540", "358");
Photos_234[13] = new Array( ipath_234 + '5684.jpg', ipath_234 + 'thumbnail_5684.jpg', "14.jpg", "", "", "540", "358");
Photos_234[14] = new Array( ipath_234 + '5670.jpg', ipath_234 + 'thumbnail_5670.jpg', "15.jpg", "", "", "540", "358");
if (showGallery_234) {
    var preloadPhotos_234 = new Array('' + ihost_234 + 'b_next.gif', '' + ihost_234 + 'b_next_over.gif', '' + ihost_234 + 'b_pause.gif', '' + ihost_234 + 'b_pause_over.gif', '' + ihost_234 + 'b_play.gif', '' + ihost_234 + 'b_play_over.gif', '' + ihost_234 + 'b_previous.gif', '' + ihost_234 + 'b_previous_over.gif', '' + ihost_234 + 'b_scroll_down.gif', '' + ihost_234 + 'b_scroll_down_over.gif', '' + ihost_234 + 'b_scroll_up.gif', '' + ihost_234 + 'b_scroll_up_over.gif', '' + ihost_234 + 'title_bg.gif', '' + ihost_234 + 'show_rental_details.gif', '' + ihost_234 + 'show_rental_details_over.gif', '' + ipath_234 + '5671.jpg', '' + ipath_234 + 'thumbnail_5671.jpg', '' + ipath_234 + 'thumbnail_5672.jpg');
    var preloadPhotos = new Array('' + ihost_234 + 'b_next.gif', '' + ihost_234 + 'b_next_over.gif', '' + ihost_234 + 'b_pause.gif', '' + ihost_234 + 'b_pause_over.gif', '' + ihost_234 + 'b_play.gif', '' + ihost_234 + 'b_play_over.gif', '' + ihost_234 + 'b_previous.gif', '' + ihost_234 + 'b_previous_over.gif', '' + ihost_234 + 'b_scroll_down.gif', '' + ihost_234 + 'b_scroll_down_over.gif', '' + ihost_234 + 'b_scroll_up.gif', '' + ihost_234 + 'b_scroll_up_over.gif', '' + ihost_234 + 'title_bg.gif', '' + ihost_234 + 'show_rental_details.gif', '' + ihost_234 + 'show_rental_details_over.gif', '' + ipath_234 + '5671.jpg', '' + ipath_234 + 'thumbnail_5671.jpg', '' + ipath_234 + 'thumbnail_5672.jpg');
    var preloadPhotosAfter_234 = new Array('' + ipath_234 + '5672.jpg', '' + ipath_234 + '5673.jpg', '' + ipath_234 + 'thumbnail_5673.jpg', '' + ipath_234 + '5674.jpg', '' + ipath_234 + 'thumbnail_5674.jpg', '' + ipath_234 + '5675.jpg', '' + ipath_234 + 'thumbnail_5675.jpg', '' + ipath_234 + '5676.jpg', '' + ipath_234 + 'thumbnail_5676.jpg', '' + ipath_234 + '5677.jpg', '' + ipath_234 + 'thumbnail_5677.jpg', '' + ipath_234 + '5678.jpg', '' + ipath_234 + 'thumbnail_5678.jpg', '' + ipath_234 + '5679.jpg', '' + ipath_234 + 'thumbnail_5679.jpg', '' + ipath_234 + '5680.jpg', '' + ipath_234 + 'thumbnail_5680.jpg', '' + ipath_234 + '5681.jpg', '' + ipath_234 + 'thumbnail_5681.jpg', '' + ipath_234 + '5682.jpg', '' + ipath_234 + 'thumbnail_5682.jpg', '' + ipath_234 + '5683.jpg', '' + ipath_234 + 'thumbnail_5683.jpg', '' + ipath_234 + '5684.jpg', '' + ipath_234 + 'thumbnail_5684.jpg', '' + ipath_234 + '5670.jpg', '' + ipath_234 + 'thumbnail_5670.jpg');
} else {
    var preloadPhotos_234 = new Array(ihost_234 + 'title_bg.gif');
    var preloadPhotos = new Array(ihost_234 + 'title_bg.gif');
}
function drawGallery_234()
{
    if (document.getElementById("gallery_slideshow_234") != null ) {
    igallery_234 = document.getElementById("gallery_slideshow_234");
    } else {
    igallery_234 = document.getElementById("gallery_slideshow");
    }
    if (galleryLoader != undefined) {
        gltcontainer_234 = document.createElement('div');
        gltcontainer_234.setAttribute('id', "galleriesListTop_234");
        gl_a_234 = document.createElement('a');
        gl_a_234.setAttribute('href', requestUri_234 + 'ghash=289dff07669d7a23de0ef88d2f7129e7');
        glName_234 = document.createTextNode( "El Mirador Hotel Gallery" );
        gl_a_234.appendChild(glName_234);
        gltcontainer_234.appendChild(gl_a_234);
        igallery_234.appendChild(gltcontainer_234);
    }
    if (showGallery_234) {
    preview_pane_234 = document.createElement('div');
    preview_pane_234.setAttribute('id', "previewPane_234");
    gncontainer_234 = document.createElement('div');
    gncontainer_234.setAttribute('id', "galleryTitle_234");
    gnscontainer_234 = document.createElement('div');
    gnTitle_234 = document.createTextNode( "El Mirador Hotel Gallery" );
    gnscontainer_234.appendChild(gnTitle_234);
    gncontainer_234.appendChild(gnscontainer_234);
    preview_pane_234.appendChild(gncontainer_234);
    preview_pane_img_div_234 = document.createElement('div');
    preview_pane_img_div_234.setAttribute('id', 'gPreviewImgContainer_234');
    preview_pane_img_234 = document.createElement('img');
    preview_pane_img_234.setAttribute('id', 'gPreviewImg_234');
    if (Photos_234.length > 0) {
        var margin_top = roundnumber_234( (previewImgContainerHeight_234/2 - 4) - (Photos_234[0][6]/2), 0);
        preview_pane_img_234.setAttribute('src', Photos_234[0][0]);
        preview_pane_img_234.setAttribute('width', Photos_234[0][5]);
        preview_pane_img_234.setAttribute('height', Photos_234[0][6]);
        preview_pane_img_234.setAttribute('style', 'margin-top: ' + margin_top + 'px;');
    }
    preview_pane_img_div_234.appendChild(preview_pane_img_234);
    preview_pane_234.appendChild(preview_pane_img_div_234);
    itext_234 = document.createElement('div');
    itext_234.setAttribute('id', "imgTextContainer_234");
    if (Photos_234.length > 0 && Photos_234[0][3] != '') {
        itext_234.innerHTML = Photos_234[0][3];
    }
    preview_pane_234.appendChild(itext_234);
    sscontainer_234 = document.createElement('div');
    sscontainer_234.setAttribute('id', "slideShowContainer_234");
    prev_img_a_234 = document.createElement('a');
    prev_img_a_234.setAttribute('onclick', "prevPhoto_234();return false");
    prev_img_a_234.setAttribute('href', "javascript:prevPhoto_234();");
    prev_img_a_234.setAttribute('onfocus', "this.blur()");
    prev_img_234 = document.createElement('img');
    prev_img_234.setAttribute('id', 'prevSlideCtrl_234');
    prev_img_234.setAttribute('src', ihost_234 + 'b_previous.gif');
    prev_img_234.setAttribute('alt', 'Previous');
    prev_img_234.setAttribute('title', 'Previous');
    prev_img_a_234.appendChild(prev_img_234);
    sscontainer_234.appendChild(prev_img_a_234);
    stop_img_a_234 = document.createElement('a');
    stop_img_a_234.setAttribute('onclick', "stopSlideShow_234();return false");
    stop_img_a_234.setAttribute('href', "javascript:stopSlideShow_234();");
    stop_img_a_234.setAttribute('id', "stopSlideCtrlA_234");
    stop_img_a_234.setAttribute('onfocus', "this.blur()");
    stop_img_234 = document.createElement('img');
    stop_img_234.setAttribute('id', 'stopSlideCtrl_234');
    stop_img_234.setAttribute('src', ihost_234 + 'b_pause.gif');
    stop_img_234.setAttribute('alt', 'Pause');
    stop_img_234.setAttribute('title', 'Pause');
    stop_img_a_234.appendChild(stop_img_234);
    sscontainer_234.appendChild(stop_img_a_234);
    start_img_a_234 = document.createElement('a');
    start_img_a_234.setAttribute('onclick', "startSlideShow_234();return false");
    start_img_a_234.setAttribute('href', "javascript:startSlideShow_234();");
    start_img_a_234.setAttribute('id', "startSlideCtrlA_234");
    start_img_a_234.setAttribute('onfocus', "this.blur()");
    start_img_234 = document.createElement('img');
    start_img_234.setAttribute('id', 'startSlideCtrl_234');
    start_img_234.setAttribute('src', ihost_234 + 'b_play.gif');
    start_img_234.setAttribute('alt', 'Play');
    start_img_234.setAttribute('title', 'Play');
    start_img_a_234.appendChild(start_img_234);
    sscontainer_234.appendChild(start_img_a_234);
    next_img_a_234 = document.createElement('a');
    next_img_a_234.setAttribute('onclick', "nextPhoto_234();return false");
    next_img_a_234.setAttribute('href', "javascript:nextPhoto_234();");
    next_img_a_234.setAttribute('onfocus', "this.blur()");
    next_img_a_234.setAttribute('class', "none_234");
    next_img_a_234.setAttribute('className', "none_234");
    next_img_234 = document.createElement('img');
    next_img_234.setAttribute('id', 'nextSlideCtrl_234');
    next_img_234.setAttribute('src', ihost_234 + 'b_next.gif');
    next_img_234.setAttribute('alt', 'Next');
    next_img_234.setAttribute('title', 'Next');
    next_img_a_234.appendChild(next_img_234);
    sscontainer_234.appendChild(next_img_a_234);
    preview_pane_234.appendChild(sscontainer_234);
    icontainer_234 = document.createElement('div');
    icontainer_234.setAttribute('id', "galleryContainer_234");
    arr_left_img_div_234 = document.createElement('div');
    arr_left_img_div_234.setAttribute('id', "arrow_left_234");
    arr_left_img_234 = document.createElement('img');
    arr_left_img_234.setAttribute('src', ihost_234 + "b_scroll_left.gif");
    arr_left_img_234.setAttribute('id', "arrow_left_image_234");
    arr_left_img_234.setAttribute('width', "31");
    arr_left_img_234.setAttribute('height', "60");
    arr_left_img_div_234.appendChild(arr_left_img_234);
    icontainer_234.appendChild(arr_left_img_div_234);
    arr_right_img_div_234 = document.createElement('div');
    arr_right_img_div_234.setAttribute('id', "arrow_right_234");
    arr_right_img_234 = document.createElement('img');
    arr_right_img_234.setAttribute('src', ihost_234 + "b_scroll_right.gif");
    arr_right_img_234.setAttribute('id', "arrow_right_image_234");
    arr_right_img_234.setAttribute('width', "33");
    arr_right_img_234.setAttribute('height', "60");
    arr_right_img_div_234.appendChild(arr_right_img_234);
    icontainer_234.appendChild(arr_right_img_div_234);
    the_img_div_234 = document.createElement('div');
    the_img_div_234.setAttribute('id', "theImages_234");
    the_img_div_container_234 = document.createElement('div');
    the_img_div_container_234.setAttribute('style', "left: 31px;");
    for (var i=0; i<Photos_234.length; i++) {
        prev_img_a_234 = document.createElement('a');
        prev_img_a_234.setAttribute('onclick', "showPreview_234(Photos_234[" + i + "][0], " + i +", Photos_234[" + i + "][3], Photos_234[" + i + "][5], Photos_234[" + i + "][6]);return false");
        prev_img_a_234.setAttribute('href', "javascript:showPreview_234(Photos_234[" + i + "][0], " + i +", Photos_234[" + i + "][3], Photos_234[" + i + "][5], Photos_234[" + i + "][6]);");
        prev_img_234 = document.createElement('img');
        prev_img_234.setAttribute('src', Photos_234[i][1]);
        prev_img_234.setAttribute('alt', Photos_234[i][4]);
        if (i == Photos_234.length) {
            prev_img_234.setAttribute('style', 'margin: 0px;');
        }
        prev_img_a_234.appendChild(prev_img_234);
        the_img_div_container_234.appendChild(prev_img_a_234);
    }
    slide_end_div_234 = document.createElement('div');
    slide_end_div_234.setAttribute('id', "slideEnd_234");
    the_img_div_container_234.appendChild(slide_end_div_234);
    the_img_div_234.appendChild(the_img_div_container_234);
    icontainer_234.appendChild(the_img_div_234);
    igallery_234.appendChild(preview_pane_234);
    igallery_234.appendChild(icontainer_234);
}
    if (galleryLoader != undefined && showGallery_234) {
        glbcontainer_234 = document.createElement('div');
        glbcontainer_234.setAttribute('id', "galleriesListBottom_234");
        gl_a_234 = document.createElement('a');
        gl_a_234.setAttribute('href', requestUri_234 + 'ghash=289dff07669d7a23de0ef88d2f7129e7');
        glName_234 = document.createTextNode( "El Mirador Hotel Gallery" );
        gl_a_234.appendChild(glName_234);
        glbcontainer_234.appendChild(gl_a_234);
        igallery_234.appendChild(glbcontainer_234);
    }
}
window.ua = navigator.userAgent.toLowerCase();
var Safari = (ua.indexOf('safari') != -1)?true:false;

var slideShowInterval_234;
var currentPhoto_234           = 0;
var arrowImageHeight_234       = 31;	// Height of arrow image in pixels;
var previewImage_234           = false;
var previewImageParent_234     = false;
var slideSpeed_234             = 0;
var previewImagePane_234       = false;
var slideEndMarker_234         = false;
var galleryContainer_234       = false;
var disablePlay_234            = false;

function getTopPos_234(inputObj)
{
    var returnValue = inputObj.offsetTop;
    while((inputObj = inputObj.offsetParent) != null) {
        returnValue += inputObj.offsetTop;
    }
    return returnValue;
}

function getLeftPos_234(inputObj)
{
    var returnValue = inputObj.offsetLeft;
    while((inputObj = inputObj.offsetParent) != null) {
        returnValue += inputObj.offsetLeft;
    }
    return returnValue;
}

function roundnumber_234(n, d)
{
    n = n - 0;
    if (d == null) d = 2;
    var f = Math.pow(10, d);
    n += Math.pow(10, - (d + 1));
    n = Math.round(n * f) / f;
    n += Math.pow(10, - (d + 1));
    n += '';
    return d == 0 ? n.substring(0, n.indexOf('.')) :  n.substring(0, n.indexOf('.') + d + 1);
}

function showPreview_234(newSrc, idx, imageText, width, height)
{
    currentPhoto_234 = idx;
    var previewImage_234 = document.getElementById('gPreviewImg_234');
    var margin_top_234 = roundnumber_234( (previewImgContainerHeight_234/2 - 4) - (height/2), 0);
    previewImage_234.src = newSrc;
    previewImage_234.width = width;
    previewImage_234.height = height;
    previewImage_234.setAttribute('style', 'margin-top: ' + margin_top_234 + 'px;');
    if (imageText == 'undefined') {
        imageText = '';
    }
    var imgTextContainer_234 = document.getElementById('imgTextContainer_234');
    if (imageText != '') {

    }
    imgTextContainer_234.innerHTML = imageText;
}

function initSlide_234(e)
{
    if(document.all) {
        e = event;
    }
    var id = this.id;

    if(this.src.indexOf('over') < 0) {
        this.src = this.src.replace('.gif','_over.gif');
    }

    if (Safari) {
      slideSpeed_234 = 10;
    } else {
        if (thumbnailsPosition_234 == 'V') {
            slideSpeed_234 = e.clientY + Math.max(document.body.scrollTop, document.documentElement.scrollTop) - getTopPos_234(this);
            if(this.src.indexOf('down') >= 0) {
                slideSpeed_234 = (slideSpeed_234) * -1;
            } else {
                slideSpeed_234 = arrowImageHeight_234 - slideSpeed_234;
            }
            slideSpeed_234 = Math.round(slideSpeed_234 * 15 / arrowImageHeight_234);
        } else {
            if(this.id=='arrow_right_image_234') {
                slideSpeedMultiply_234 = Math.floor((e.clientX - this.offsetLeft) / 5);
                slideSpeed_234 = -1 * slideSpeedMultiply_234;
                slideSpeed_234 = Math.max(-10, slideSpeed_234);
            } else {
                slideSpeedMultiply_234 = 10 - Math.floor((e.clientX - this.offsetLeft) / 5);
                slideSpeed_234 = 1 * slideSpeedMultiply_234;
                slideSpeed_234 = Math.min(10, slideSpeed_234);
                if(slideSpeed_234 < 0) { slideSpeed_234 = 10; }
            }
        }
    }
}

function stopSlide_234()
{
    slideSpeed_234 = 0;
    this.src = this.src.replace('_over', '');
}

function slidePreviewPane_234()
{
    if(slideSpeed_234 != 0) {
        if (thumbnailsPosition_234 == 'V') {
            var topPos_234 = previewImagePane_234.style.top.replace(/[^\-0-9]/g,'')/1;

            if(slideSpeed_234 < 0 && slideEndMarker_234.offsetTop < (previewImageParent_234.offsetHeight - topPos_234)) {
                slideSpeed_234 = 0;
            }
            topPos_234 = topPos_234 + slideSpeed_234;
            if(topPos_234 > 0) {
                topPos_234 = 0;
            }
            previewImagePane_234.style.top = topPos_234 + 'px';
        } else {
            var leftPos_234 = previewImageParent_234.offsetLeft;
            leftPos_234 = leftPos_234/1 + slideSpeed_234;
            if(leftPos_234 > maxGalleryXPos_234) {
                leftPos_234 = maxGalleryXPos_234;
                slideSpeed_234 = 0;
            }
            if(leftPos_234 < minGalleryXPos_234){
                leftPos_234 = minGalleryXPos_234;
                slideSpeed_234 = 0;
            }
			previewImageParent_234.style.left = leftPos_234 + 'px';
        }
    }
    setTimeout('slidePreviewPane_234()', scrollingSpeed_234);
}

function revealThumbnail_234()
{
    this.style.filter = 'alpha(opacity=100)';
    this.style.opacity = 1;
}

function hideThumbnail_234()
{
    this.style.filter = 'alpha(opacity=50)';
    this.style.opacity = 0.5;
}

function initGalleryScript_234()
{
    drawGallery_234();

    previewImageParent_234 = document.getElementById('theImages_234');
    if( previewImageParent_234 != null ) {
        galleryContainer_234  = document.getElementById('galleryContainer_234');

        previewImagePane_234 = document.getElementById('theImages_234').getElementsByTagName('DIV')[0];
        previewImagePane_234.style.top = '0px';

        var images_234 = previewImagePane_234.getElementsByTagName('IMG');
        for(var no=0; no<images_234.length; no++) {
            images_234[no].onmouseover = revealThumbnail_234;
            images_234[no].onmouseout = hideThumbnail_234;
        }
        slideEndMarker_234 = document.getElementById('slideEnd_234');

        if (thumbnailsPosition_234 == 'V') {
            document.getElementById('arrow_up_image_234').onmousemove = initSlide_234;
            document.getElementById('arrow_up_image_234').onmouseout = stopSlide_234;

            document.getElementById('arrow_down_image_234').onmousemove = initSlide_234;
            document.getElementById('arrow_down_image_234').onmouseout = stopSlide_234;
        } else {
            document.getElementById('arrow_left_image_234').onmousemove = initSlide_234;
            document.getElementById('arrow_left_image_234').onmouseout = stopSlide_234;

            document.getElementById('arrow_right_image_234').onmousemove = initSlide_234;
            document.getElementById('arrow_right_image_234').onmouseout = stopSlide_234;
        }

        document.getElementById('prevSlideCtrl_234').onmousemove = initCtrlBtn_234;
        document.getElementById('prevSlideCtrl_234').onmouseout = stopCtrlBtn_234;

        document.getElementById('startSlideCtrl_234').onmousemove = initCtrlBtn_234;
        document.getElementById('startSlideCtrl_234').onmouseout = stopCtrlBtn_234;

        document.getElementById('stopSlideCtrl_234').onmousemove = initCtrlBtn_234;
        document.getElementById('stopSlideCtrl_234').onmouseout = stopCtrlBtn_234;

        document.getElementById('nextSlideCtrl_234').onmousemove = initCtrlBtn_234;
        document.getElementById('nextSlideCtrl_234').onmouseout = stopCtrlBtn_234;

        slidePreviewPane_234();
    }
}

function rprentals_button_234(rpr_el)
{
    if(rpr_el.src.indexOf('over') < 0) {
        rpr_el.src = rpr_el.src.replace('.gif', '_over.gif');
    } else {
        rpr_el.src = rpr_el.src.replace('_over.gif', '.gif');
    }
}

/*** Slide show functions ***/
function initCtrlBtn_234()
{
    if (this.id != 'startSlideCtrl_234' || disablePlay_234 == false) {
        if(this.src.indexOf('over') < 0) {
            this.src = this.src.replace('.gif', '_over.gif');
        }
    }
}
function stopCtrlBtn_234()
{
    if (this.id != 'startSlideCtrl_234' || disablePlay_234 == false) {
        if(this.src.indexOf('over') >= 0) {
            this.src = this.src.replace('_over', '');
        }
    }
}
function nextPhoto_234()
{
    currentPhoto_234++;
    if (currentPhoto_234 >= Photos_234.length) { currentPhoto_234 = 0; }
    showPreview_234(Photos_234[currentPhoto_234][0], currentPhoto_234, Photos_234[currentPhoto_234][3], Photos_234[currentPhoto_234][5], Photos_234[currentPhoto_234][6]);
}

function prevPhoto_234()
{
    currentPhoto_234--;
    if (currentPhoto_234 >= Photos_234.length || currentPhoto_234 < 0) { currentPhoto_234 = Photos_234.length-1; }
    showPreview_234(Photos_234[currentPhoto_234][0], currentPhoto_234, Photos_234[currentPhoto_234][3], Photos_234[currentPhoto_234][5], Photos_234[currentPhoto_234][6]);
}

function doSlideshow_234()
{
    nextPhoto_234( );
    slideShowInterval_234 = setTimeout("doSlideshow_234()", slideShowDelay_234);
}

function startSlideShow_234(initpic)
{
    slideShowInterval_234 = setTimeout("doSlideshow_234()", slideShowDelay_234);
    var elm = document.getElementById('startSlideCtrl_234');
    var elm_ctrl = document.getElementById('startSlideCtrlA_234');
    disablePlay_234 = true;
    if(elm.src.indexOf('over') < 0) {
        elm.src = elm.src.replace('.gif', '_over.gif');
    }
}

function stopSlideShow_234()
{
    clearTimeout(slideShowInterval_234);
    var elm = document.getElementById('startSlideCtrl_234');
    var elm_ctrl = document.getElementById('startSlideCtrlA_234');
    disablePlay_234 = false;
    if(elm.src.indexOf('over') >= 0) {
        elm.src = elm.src.replace('_over', '');
    }
}

function initGalleryScript()
{
    initGalleryScript_234();
}

function viodAction_234()
{

}

// Image Preloader
function ImagePreloader_234(images, callback)
{
	// store the callback
	this.callback = callback;

	// initialize internal state.
	this.nLoaded = 0;
	this.nProcessed = 0;
	this.aImages = new Array;

	// record the number of images.
	this.nImages = images.length;

	// for each image, call preload()
	for ( var i = 0; i < images.length; i++ )
		this.preload_234(images[i]);
}
ImagePreloader_234.prototype.preload_234 = function(image)
{
	// create new Image object and add to array
	var oImage = new Image;
	this.aImages.push(oImage);

	// set up event handlers for the Image object
	oImage.onload = ImagePreloader_234.prototype.onload_234;
	oImage.onerror = ImagePreloader_234.prototype.onerror_234;
	oImage.onabort = ImagePreloader_234.prototype.onabort_234;

	// assign pointer back to this.
	oImage.oImagePreloader = this;
	oImage.bLoaded = false;
	oImage.source = image;

	// assign the .src property of the Image object
	oImage.src = image;
}
ImagePreloader_234.prototype.onComplete_234 = function()
{
	this.nProcessed++;
	if ( this.nProcessed == this.nImages )
		this.callback(this.aImages);
}
ImagePreloader_234.prototype.onload_234 = function()
{
	this.bLoaded = true;
	this.oImagePreloader.nLoaded++;
	this.oImagePreloader.onComplete_234();
}
ImagePreloader_234.prototype.onerror_234 = function()
{
	this.bError = true;
	this.oImagePreloader.onComplete_234();
}
ImagePreloader_234.prototype.onabort_234 = function()
{
	this.bAbort = true;
	this.oImagePreloader.onComplete_234();
}

// Image Preloader
function ImagePreloader(images,callback)
{
	// store the callback
	this.callback = callback;

	// initialize internal state.
	this.nLoaded = 0;
	this.nProcessed = 0;
	this.aImages = new Array;

	// record the number of images.
	this.nImages = images.length;

	// for each image, call preload()
	for ( var i = 0; i < images.length; i++ )
		this.preload(images[i]);
}
ImagePreloader.prototype.preload = function(image)
{
	// create new Image object and add to array
	var oImage = new Image;
	this.aImages.push(oImage);

	// set up event handlers for the Image object
	oImage.onload = ImagePreloader.prototype.onload;
	oImage.onerror = ImagePreloader.prototype.onerror;
	oImage.onabort = ImagePreloader.prototype.onabort;

	// assign pointer back to this.
	oImage.oImagePreloader = this;
	oImage.bLoaded = false;
	oImage.source = image;

	// assign the .src property of the Image object
	oImage.src = image;
}
ImagePreloader.prototype.onComplete = function()
{
	this.nProcessed++;
	if ( this.nProcessed == this.nImages )
		this.callback(this.aImages);
}
ImagePreloader.prototype.onload = function()
{
	this.bLoaded = true;
	this.oImagePreloader.nLoaded++;
	this.oImagePreloader.onComplete();
}
ImagePreloader.prototype.onerror = function()
{
	this.bError = true;
	this.oImagePreloader.onComplete();
}
ImagePreloader.prototype.onabort = function()
{
	this.bAbort = true;
	this.oImagePreloader.onComplete();
}

/**** invalid preloader ****
// Image Preloader
function ImagePreloader(images,callback)
{
	// store the callback
	this.callback = callback;

  for ( var i = 0; i < images.length; i++ ) { preLdImg(images[i]); }
  this.callback(images);
}

//this part special for safari only
function preLdImg(oHref) {
  if( typeof( oHref ) != 'string' ) { return; }
  if( window.imgLdAr ) { for( var x = 2; x < window.imgLdAr.length; x++ ){ imgLdAr[x].onerror = null; imgLdAr[x].onload = null; } }
  window.imgLdAr = new Array(); window.imgCount = 0; window.hasLoadedImg = new Array();
  for( var x = 2; x < arguments.length; x++ ) {
    if( typeof( arguments[x] ) != 'string' || !document.images ) { self.location.href = oHref; }
    imgLdAr[x] = new Image();
    imgLdAr[x].onload = new Function( //write the function as a string. Allows me to put in the number of images
      'if( hasLoadedImg[imgLdAr['+x+'].src] ){ return; } hasLoadedImg[imgLdAr['+x+'].src] = true; window.imgCount++;'+
      ( arguments[1] ? ( arguments[1] + '( window.imgCount / ' + ( arguments.length - 2 ) + ' );' ) : '' )+
      "if( imgCount == " + ( arguments.length - 2 ) + " ) { self.location.href = '"+oHref+"'; }" );
    imgLdAr[x].onerror = new Function( "for(var x = 2;x<window.imgLdAr.length;x++){imgLdAr[x].onerror=null;imgLdAr[x].onload=null;}if( window.confirm( 'Pre-load error:\\n\\nThe following image failed to load:\\n'+this.src+'\\n\\nDo you want to jump to the next page without pre-loading images?' ) ) { self.location.href = '"+oHref+"'; }" );
    imgLdAr[x].src = arguments[x];
    if( imgLdAr[x].complete ) { imgLdAr[x].onload(); }
  }
}
*******/


if (galleryLoader == undefined) {
    document.write('<div id="gallery_slideshow_234"><\/div>');
    var giv = new ImagePreloader_234(preloadPhotos_234, initGalleryScript_234);
    var aiv = new ImagePreloader_234(preloadPhotosAfter_234, viodAction_234);
}
