
var galleryLoader;
var selectedGallery = 0;
var showGallery_223 = false;
var requestUri_223 = location.href;
var re = /[\?&](ghash=(.*))/gi;
requestUri_223 = requestUri_223.replace(re, '');
if(requestUri_223.indexOf('?') < 0) {
    requestUri_223 = requestUri_223 + '?';
} else {
    requestUri_223 = requestUri_223 + '&';
}
if (galleryLoader == undefined || selectedGallery == 1) {
    showGallery_223 = true;
}
 showGallery_223 = true;
var imageGalleryLeftPos_223       = 31;
var previewImgContainerHeight_223 = 357;
var imageGalleryWidth_223         = 367;
var maxGalleryXPos_223            = 31;
var minGalleryXPos_223            = -646;
var thumbnailsPosition_223        = 'H';
var scrollingSpeed_223            = 60;
var slideShowDelay_223            = 5000;
var ihost_223                     = 'http://images.sonoranseacondo.com/';
var ipath_223                     = ihost_223 + '57/';
var Photos_223                    = new Array();
Photos_223[0] = new Array( ipath_223 + '5544.jpg', ipath_223 + 'thumbnail_5544.jpg', "Ariel from ocean", "Las Palmas is located on Sandy Beach, just outside of town.", "", "400", "309");
Photos_223[1] = new Array( ipath_223 + '5554.jpg', ipath_223 + 'thumbnail_5554.jpg', "Las Palmas Entance", "Las Palmas is a gated-community featuring beach front homes and  condos.  Our property offers 24 hour security along with all the amenities required for couples, and families to enjoy a stay at the beach.", "", "400", "265");
Photos_223[2] = new Array( ipath_223 + '5555.jpg', ipath_223 + 'thumbnail_5555.jpg', "Pool and Ocean", "The resort has 3 pools surrounded by lushes well-maintained grounds. The architecture is very suited to the relaxing ocean view.", "", "400", "300");
Photos_223[3] = new Array( ipath_223 + '5546.jpg', ipath_223 + 'thumbnail_5546.jpg', "Clubhouse", "Our main pool is situated in the middle of the resort.  It has 2 slides for kids, a wading pool for kiddies, and swim-up bar for adults.   Next the pool is the clubhouse, where we have the Las Palmas Bar & Grill, a fitness room, billiards, internet room and meeting room.", "", "400", "267");
Photos_223[4] = new Array( ipath_223 + '5545.jpg', ipath_223 + 'thumbnail_5545.jpg', "Water slide", "Las Palmas features Rocky Point\\\'s only water slide for kids young and old.", "", "400", "267");
Photos_223[5] = new Array( ipath_223 + '5550.jpg', ipath_223 + 'thumbnail_5550.jpg', "Master Bedroom of our Casas", "Las Palmas has 20 beachfront homes.  Each home has a spacious master bedroom offering a gorgeous view.", "", "400", "267");
Photos_223[6] = new Array( ipath_223 + '5557.jpg', ipath_223 + 'thumbnail_5557.jpg', "Landscape", "Las Palmas is one of Sandy Beach\\\'s smallest resort yet the grounds are spacious and well maintained.", "", "400", "268");
Photos_223[7] = new Array( ipath_223 + '5556.jpg', ipath_223 + 'thumbnail_5556.jpg', "Condo Tower", "Las Palmas has just over 100 fully-furnished condos.  There are four towers which all face the ocean.  Each condo has a balcony looking towards the beach. All our bedrooms have ocean views and balcony access.", "", "400", "268");
Photos_223[8] = new Array( ipath_223 + '5548.jpg', ipath_223 + 'thumbnail_5548.jpg', "Condo Balcony", "Condos at Las Palmas offer a relaxing view of the Sea of Cortez.  Each condo is privately owner and decorated in a unique style.  Guests are free to select the unit of their choice based on location, size, decor and availability.", "", "400", "265");
Photos_223[9] = new Array( ipath_223 + '5549.jpg', ipath_223 + 'thumbnail_5549.jpg', "Balcony View", "Condos at Las Palmas offer large balconies with scenic views of the ocean and beach.", "", "400", "268");
Photos_223[10] = new Array( ipath_223 + '5552.jpg', ipath_223 + 'thumbnail_5552.jpg', "High Tide at Las Palmas", "The Sea of Cortez has a very large tide shift.  With high tide comes playful waves that splash up on the resort\\\\\\\'s sandy beach.", "", "400", "265");
Photos_223[11] = new Array( ipath_223 + '5551.jpg', ipath_223 + 'thumbnail_5551.jpg', "Low Tide at Las Palmas", "Sandy Beach at low tide offers you a great opportunity to explore the exposed rocks and relax in the tranquil pools.", "", "400", "266");
Photos_223[12] = new Array( ipath_223 + '5547.jpg', ipath_223 + 'thumbnail_5547.jpg', "Sunset", "We hope you will come and enjoy Las Palmas.  Hasta luego!", "", "400", "267");
if (showGallery_223) {
    var preloadPhotos_223 = new Array('' + ihost_223 + 'b_next.gif', '' + ihost_223 + 'b_next_over.gif', '' + ihost_223 + 'b_pause.gif', '' + ihost_223 + 'b_pause_over.gif', '' + ihost_223 + 'b_play.gif', '' + ihost_223 + 'b_play_over.gif', '' + ihost_223 + 'b_previous.gif', '' + ihost_223 + 'b_previous_over.gif', '' + ihost_223 + 'b_scroll_down.gif', '' + ihost_223 + 'b_scroll_down_over.gif', '' + ihost_223 + 'b_scroll_up.gif', '' + ihost_223 + 'b_scroll_up_over.gif', '' + ihost_223 + 'title_bg.gif', '' + ihost_223 + 'show_rental_details.gif', '' + ihost_223 + 'show_rental_details_over.gif', '' + ipath_223 + '5544.jpg', '' + ipath_223 + 'thumbnail_5544.jpg', '' + ipath_223 + 'thumbnail_5554.jpg');
    var preloadPhotos = new Array('' + ihost_223 + 'b_next.gif', '' + ihost_223 + 'b_next_over.gif', '' + ihost_223 + 'b_pause.gif', '' + ihost_223 + 'b_pause_over.gif', '' + ihost_223 + 'b_play.gif', '' + ihost_223 + 'b_play_over.gif', '' + ihost_223 + 'b_previous.gif', '' + ihost_223 + 'b_previous_over.gif', '' + ihost_223 + 'b_scroll_down.gif', '' + ihost_223 + 'b_scroll_down_over.gif', '' + ihost_223 + 'b_scroll_up.gif', '' + ihost_223 + 'b_scroll_up_over.gif', '' + ihost_223 + 'title_bg.gif', '' + ihost_223 + 'show_rental_details.gif', '' + ihost_223 + 'show_rental_details_over.gif', '' + ipath_223 + '5544.jpg', '' + ipath_223 + 'thumbnail_5544.jpg', '' + ipath_223 + 'thumbnail_5554.jpg');
    var preloadPhotosAfter_223 = new Array('' + ipath_223 + '5554.jpg', '' + ipath_223 + '5555.jpg', '' + ipath_223 + 'thumbnail_5555.jpg', '' + ipath_223 + '5546.jpg', '' + ipath_223 + 'thumbnail_5546.jpg', '' + ipath_223 + '5545.jpg', '' + ipath_223 + 'thumbnail_5545.jpg', '' + ipath_223 + '5550.jpg', '' + ipath_223 + 'thumbnail_5550.jpg', '' + ipath_223 + '5557.jpg', '' + ipath_223 + 'thumbnail_5557.jpg', '' + ipath_223 + '5556.jpg', '' + ipath_223 + 'thumbnail_5556.jpg', '' + ipath_223 + '5548.jpg', '' + ipath_223 + 'thumbnail_5548.jpg', '' + ipath_223 + '5549.jpg', '' + ipath_223 + 'thumbnail_5549.jpg', '' + ipath_223 + '5552.jpg', '' + ipath_223 + 'thumbnail_5552.jpg', '' + ipath_223 + '5551.jpg', '' + ipath_223 + 'thumbnail_5551.jpg', '' + ipath_223 + '5547.jpg', '' + ipath_223 + 'thumbnail_5547.jpg');
} else {
    var preloadPhotos_223 = new Array(ihost_223 + 'title_bg.gif');
    var preloadPhotos = new Array(ihost_223 + 'title_bg.gif');
}
function drawGallery_223()
{
    if (document.getElementById("gallery_slideshow_223") != null ) {
    igallery_223 = document.getElementById("gallery_slideshow_223");
    } else {
    igallery_223 = document.getElementById("gallery_slideshow");
    }
    if (showGallery_223) {
    preview_pane_223 = document.createElement('div');
    preview_pane_223.setAttribute('id', "previewPane_223");
    gncontainer_223 = document.createElement('div');
    gncontainer_223.setAttribute('id', "galleryTitle_223");
    gnscontainer_223 = document.createElement('div');
    gnTitle_223 = document.createTextNode( "Las Palmas Resort" );
    gnscontainer_223.appendChild(gnTitle_223);
    gncontainer_223.appendChild(gnscontainer_223);
    preview_pane_223.appendChild(gncontainer_223);
    preview_pane_img_div_223 = document.createElement('div');
    preview_pane_img_div_223.setAttribute('id', 'gPreviewImgContainer_223');
    preview_pane_img_223 = document.createElement('img');
    preview_pane_img_223.setAttribute('id', 'gPreviewImg_223');
    if (Photos_223.length > 0) {
        var margin_top = roundnumber_223( (previewImgContainerHeight_223/2 - 4) - (Photos_223[0][6]/2), 0);
        preview_pane_img_223.setAttribute('src', Photos_223[0][0]);
        preview_pane_img_223.setAttribute('width', Photos_223[0][5]);
        preview_pane_img_223.setAttribute('height', Photos_223[0][6]);
        preview_pane_img_223.setAttribute('style', 'margin-top: ' + margin_top + 'px;');
    }
    preview_pane_img_div_223.appendChild(preview_pane_img_223);
    preview_pane_223.appendChild(preview_pane_img_div_223);
    itext_223 = document.createElement('div');
    itext_223.setAttribute('id', "imgTextContainer_223");
    if (Photos_223.length > 0 && Photos_223[0][3] != '') {
        itext_223.innerHTML = Photos_223[0][3];
    }
    preview_pane_223.appendChild(itext_223);
    sscontainer_223 = document.createElement('div');
    sscontainer_223.setAttribute('id', "slideShowContainer_223");
    prev_img_a_223 = document.createElement('a');
    prev_img_a_223.setAttribute('onclick', "prevPhoto_223();return false");
    prev_img_a_223.setAttribute('href', "javascript:prevPhoto_223();");
    prev_img_a_223.setAttribute('onfocus', "this.blur()");
    prev_img_223 = document.createElement('img');
    prev_img_223.setAttribute('id', 'prevSlideCtrl_223');
    prev_img_223.setAttribute('src', ihost_223 + 'b_previous.gif');
    prev_img_223.setAttribute('alt', 'Previous');
    prev_img_223.setAttribute('title', 'Previous');
    prev_img_a_223.appendChild(prev_img_223);
    sscontainer_223.appendChild(prev_img_a_223);
    stop_img_a_223 = document.createElement('a');
    stop_img_a_223.setAttribute('onclick', "stopSlideShow_223();return false");
    stop_img_a_223.setAttribute('href', "javascript:stopSlideShow_223();");
    stop_img_a_223.setAttribute('id', "stopSlideCtrlA_223");
    stop_img_a_223.setAttribute('onfocus', "this.blur()");
    stop_img_223 = document.createElement('img');
    stop_img_223.setAttribute('id', 'stopSlideCtrl_223');
    stop_img_223.setAttribute('src', ihost_223 + 'b_pause.gif');
    stop_img_223.setAttribute('alt', 'Pause');
    stop_img_223.setAttribute('title', 'Pause');
    stop_img_a_223.appendChild(stop_img_223);
    sscontainer_223.appendChild(stop_img_a_223);
    start_img_a_223 = document.createElement('a');
    start_img_a_223.setAttribute('onclick', "startSlideShow_223();return false");
    start_img_a_223.setAttribute('href', "javascript:startSlideShow_223();");
    start_img_a_223.setAttribute('id', "startSlideCtrlA_223");
    start_img_a_223.setAttribute('onfocus', "this.blur()");
    start_img_223 = document.createElement('img');
    start_img_223.setAttribute('id', 'startSlideCtrl_223');
    start_img_223.setAttribute('src', ihost_223 + 'b_play.gif');
    start_img_223.setAttribute('alt', 'Play');
    start_img_223.setAttribute('title', 'Play');
    start_img_a_223.appendChild(start_img_223);
    sscontainer_223.appendChild(start_img_a_223);
    next_img_a_223 = document.createElement('a');
    next_img_a_223.setAttribute('onclick', "nextPhoto_223();return false");
    next_img_a_223.setAttribute('href', "javascript:nextPhoto_223();");
    next_img_a_223.setAttribute('onfocus', "this.blur()");
    next_img_a_223.setAttribute('class', "none_223");
    next_img_a_223.setAttribute('className', "none_223");
    next_img_223 = document.createElement('img');
    next_img_223.setAttribute('id', 'nextSlideCtrl_223');
    next_img_223.setAttribute('src', ihost_223 + 'b_next.gif');
    next_img_223.setAttribute('alt', 'Next');
    next_img_223.setAttribute('title', 'Next');
    next_img_a_223.appendChild(next_img_223);
    sscontainer_223.appendChild(next_img_a_223);
    preview_pane_223.appendChild(sscontainer_223);
    icontainer_223 = document.createElement('div');
    icontainer_223.setAttribute('id', "galleryContainer_223");
    arr_left_img_div_223 = document.createElement('div');
    arr_left_img_div_223.setAttribute('id', "arrow_left_223");
    arr_left_img_223 = document.createElement('img');
    arr_left_img_223.setAttribute('src', ihost_223 + "b_scroll_left.gif");
    arr_left_img_223.setAttribute('id', "arrow_left_image_223");
    arr_left_img_223.setAttribute('width', "31");
    arr_left_img_223.setAttribute('height', "50");
    arr_left_img_div_223.appendChild(arr_left_img_223);
    icontainer_223.appendChild(arr_left_img_div_223);
    arr_right_img_div_223 = document.createElement('div');
    arr_right_img_div_223.setAttribute('id', "arrow_right_223");
    arr_right_img_223 = document.createElement('img');
    arr_right_img_223.setAttribute('src', ihost_223 + "b_scroll_right.gif");
    arr_right_img_223.setAttribute('id', "arrow_right_image_223");
    arr_right_img_223.setAttribute('width', "33");
    arr_right_img_223.setAttribute('height', "50");
    arr_right_img_div_223.appendChild(arr_right_img_223);
    icontainer_223.appendChild(arr_right_img_div_223);
    the_img_div_223 = document.createElement('div');
    the_img_div_223.setAttribute('id', "theImages_223");
    the_img_div_container_223 = document.createElement('div');
    the_img_div_container_223.setAttribute('style', "left: 31px;");
    for (var i=0; i<Photos_223.length; i++) {
        prev_img_a_223 = document.createElement('a');
        prev_img_a_223.setAttribute('onclick', "showPreview_223(Photos_223[" + i + "][0], " + i +", Photos_223[" + i + "][3], Photos_223[" + i + "][5], Photos_223[" + i + "][6]);return false");
        prev_img_a_223.setAttribute('href', "javascript:showPreview_223(Photos_223[" + i + "][0], " + i +", Photos_223[" + i + "][3], Photos_223[" + i + "][5], Photos_223[" + i + "][6]);");
        prev_img_223 = document.createElement('img');
        prev_img_223.setAttribute('src', Photos_223[i][1]);
        prev_img_223.setAttribute('alt', Photos_223[i][4]);
        if (i == Photos_223.length) {
            prev_img_223.setAttribute('style', 'margin: 0px;');
        }
        prev_img_a_223.appendChild(prev_img_223);
        the_img_div_container_223.appendChild(prev_img_a_223);
    }
    slide_end_div_223 = document.createElement('div');
    slide_end_div_223.setAttribute('id', "slideEnd_223");
    the_img_div_container_223.appendChild(slide_end_div_223);
    the_img_div_223.appendChild(the_img_div_container_223);
    icontainer_223.appendChild(the_img_div_223);
    igallery_223.appendChild(preview_pane_223);
    igallery_223.appendChild(icontainer_223);
}
}
window.ua = navigator.userAgent.toLowerCase();
var Safari = (ua.indexOf('safari') != -1)?true:false;

var slideShowInterval_223;
var currentPhoto_223           = 0;
var arrowImageHeight_223       = 31;	// Height of arrow image in pixels;
var previewImage_223           = false;
var previewImageParent_223     = false;
var slideSpeed_223             = 0;
var previewImagePane_223       = false;
var slideEndMarker_223         = false;
var galleryContainer_223       = false;
var disablePlay_223            = false;

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

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

function roundnumber_223(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_223(newSrc, idx, imageText, width, height)
{
    currentPhoto_223 = idx;
    var previewImage_223 = document.getElementById('gPreviewImg_223');
    var margin_top_223 = roundnumber_223( (previewImgContainerHeight_223/2 - 4) - (height/2), 0);
    previewImage_223.src = newSrc;
    previewImage_223.width = width;
    previewImage_223.height = height;
    previewImage_223.setAttribute('style', 'margin-top: ' + margin_top_223 + 'px;');
    if (imageText == 'undefined') {
        imageText = '';
    }
    var imgTextContainer_223 = document.getElementById('imgTextContainer_223');
    if (imageText != '') {

    }
    imgTextContainer_223.innerHTML = imageText;
}

function initSlide_223(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_223 = 10;
    } else {
        if (thumbnailsPosition_223 == 'V') {
            slideSpeed_223 = e.clientY + Math.max(document.body.scrollTop, document.documentElement.scrollTop) - getTopPos_223(this);
            if(this.src.indexOf('down') >= 0) {
                slideSpeed_223 = (slideSpeed_223) * -1;
            } else {
                slideSpeed_223 = arrowImageHeight_223 - slideSpeed_223;
            }
            slideSpeed_223 = Math.round(slideSpeed_223 * 15 / arrowImageHeight_223);
        } else {
            if(this.id=='arrow_right_image_223') {
                slideSpeedMultiply_223 = Math.floor((e.clientX - this.offsetLeft) / 5);
                slideSpeed_223 = -1 * slideSpeedMultiply_223;
                slideSpeed_223 = Math.max(-10, slideSpeed_223);
            } else {
                slideSpeedMultiply_223 = 10 - Math.floor((e.clientX - this.offsetLeft) / 5);
                slideSpeed_223 = 1 * slideSpeedMultiply_223;
                slideSpeed_223 = Math.min(10, slideSpeed_223);
                if(slideSpeed_223 < 0) { slideSpeed_223 = 10; }
            }
        }
    }
}

function stopSlide_223()
{
    slideSpeed_223 = 0;
    this.src = this.src.replace('_over', '');
}

function slidePreviewPane_223()
{
    if(slideSpeed_223 != 0) {
        if (thumbnailsPosition_223 == 'V') {
            var topPos_223 = previewImagePane_223.style.top.replace(/[^\-0-9]/g,'')/1;

            if(slideSpeed_223 < 0 && slideEndMarker_223.offsetTop < (previewImageParent_223.offsetHeight - topPos_223)) {
                slideSpeed_223 = 0;
            }
            topPos_223 = topPos_223 + slideSpeed_223;
            if(topPos_223 > 0) {
                topPos_223 = 0;
            }
            previewImagePane_223.style.top = topPos_223 + 'px';
        } else {
            var leftPos_223 = previewImageParent_223.offsetLeft;
            leftPos_223 = leftPos_223/1 + slideSpeed_223;
            if(leftPos_223 > maxGalleryXPos_223) {
                leftPos_223 = maxGalleryXPos_223;
                slideSpeed_223 = 0;
            }
            if(leftPos_223 < minGalleryXPos_223){
                leftPos_223 = minGalleryXPos_223;
                slideSpeed_223 = 0;
            }
			previewImageParent_223.style.left = leftPos_223 + 'px';
        }
    }
    setTimeout('slidePreviewPane_223()', scrollingSpeed_223);
}

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

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

function initGalleryScript_223()
{
    drawGallery_223();

    previewImageParent_223 = document.getElementById('theImages_223');
    if( previewImageParent_223 != null ) {
        galleryContainer_223  = document.getElementById('galleryContainer_223');

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

        var images_223 = previewImagePane_223.getElementsByTagName('IMG');
        for(var no=0; no<images_223.length; no++) {
            images_223[no].onmouseover = revealThumbnail_223;
            images_223[no].onmouseout = hideThumbnail_223;
        }
        slideEndMarker_223 = document.getElementById('slideEnd_223');

        if (thumbnailsPosition_223 == 'V') {
            document.getElementById('arrow_up_image_223').onmousemove = initSlide_223;
            document.getElementById('arrow_up_image_223').onmouseout = stopSlide_223;

            document.getElementById('arrow_down_image_223').onmousemove = initSlide_223;
            document.getElementById('arrow_down_image_223').onmouseout = stopSlide_223;
        } else {
            document.getElementById('arrow_left_image_223').onmousemove = initSlide_223;
            document.getElementById('arrow_left_image_223').onmouseout = stopSlide_223;

            document.getElementById('arrow_right_image_223').onmousemove = initSlide_223;
            document.getElementById('arrow_right_image_223').onmouseout = stopSlide_223;
        }

        document.getElementById('prevSlideCtrl_223').onmousemove = initCtrlBtn_223;
        document.getElementById('prevSlideCtrl_223').onmouseout = stopCtrlBtn_223;

        document.getElementById('startSlideCtrl_223').onmousemove = initCtrlBtn_223;
        document.getElementById('startSlideCtrl_223').onmouseout = stopCtrlBtn_223;

        document.getElementById('stopSlideCtrl_223').onmousemove = initCtrlBtn_223;
        document.getElementById('stopSlideCtrl_223').onmouseout = stopCtrlBtn_223;

        document.getElementById('nextSlideCtrl_223').onmousemove = initCtrlBtn_223;
        document.getElementById('nextSlideCtrl_223').onmouseout = stopCtrlBtn_223;

        slidePreviewPane_223();
    }
}

function rprentals_button_223(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_223()
{
    if (this.id != 'startSlideCtrl_223' || disablePlay_223 == false) {
        if(this.src.indexOf('over') < 0) {
            this.src = this.src.replace('.gif', '_over.gif');
        }
    }
}
function stopCtrlBtn_223()
{
    if (this.id != 'startSlideCtrl_223' || disablePlay_223 == false) {
        if(this.src.indexOf('over') >= 0) {
            this.src = this.src.replace('_over', '');
        }
    }
}
function nextPhoto_223()
{
    currentPhoto_223++;
    if (currentPhoto_223 >= Photos_223.length) { currentPhoto_223 = 0; }
    showPreview_223(Photos_223[currentPhoto_223][0], currentPhoto_223, Photos_223[currentPhoto_223][3], Photos_223[currentPhoto_223][5], Photos_223[currentPhoto_223][6]);
}

function prevPhoto_223()
{
    currentPhoto_223--;
    if (currentPhoto_223 >= Photos_223.length || currentPhoto_223 < 0) { currentPhoto_223 = Photos_223.length-1; }
    showPreview_223(Photos_223[currentPhoto_223][0], currentPhoto_223, Photos_223[currentPhoto_223][3], Photos_223[currentPhoto_223][5], Photos_223[currentPhoto_223][6]);
}

function doSlideshow_223()
{
    nextPhoto_223( );
    slideShowInterval_223 = setTimeout("doSlideshow_223()", slideShowDelay_223);
}

function startSlideShow_223(initpic)
{
    slideShowInterval_223 = setTimeout("doSlideshow_223()", slideShowDelay_223);
    var elm = document.getElementById('startSlideCtrl_223');
    var elm_ctrl = document.getElementById('startSlideCtrlA_223');
    disablePlay_223 = true;
    if(elm.src.indexOf('over') < 0) {
        elm.src = elm.src.replace('.gif', '_over.gif');
    }
}

function stopSlideShow_223()
{
    clearTimeout(slideShowInterval_223);
    var elm = document.getElementById('startSlideCtrl_223');
    var elm_ctrl = document.getElementById('startSlideCtrlA_223');
    disablePlay_223 = false;
    if(elm.src.indexOf('over') >= 0) {
        elm.src = elm.src.replace('_over', '');
    }
}

function initGalleryScript()
{
    initGalleryScript_223();
}

function viodAction_223()
{

}

// Image Preloader
function ImagePreloader_223(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_223(images[i]);
}
ImagePreloader_223.prototype.preload_223 = 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_223.prototype.onload_223;
	oImage.onerror = ImagePreloader_223.prototype.onerror_223;
	oImage.onabort = ImagePreloader_223.prototype.onabort_223;

	// 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_223.prototype.onComplete_223 = function()
{
	this.nProcessed++;
	if ( this.nProcessed == this.nImages )
		this.callback(this.aImages);
}
ImagePreloader_223.prototype.onload_223 = function()
{
	this.bLoaded = true;
	this.oImagePreloader.nLoaded++;
	this.oImagePreloader.onComplete_223();
}
ImagePreloader_223.prototype.onerror_223 = function()
{
	this.bError = true;
	this.oImagePreloader.onComplete_223();
}
ImagePreloader_223.prototype.onabort_223 = function()
{
	this.bAbort = true;
	this.oImagePreloader.onComplete_223();
}

// 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_223"><\/div>');
    var giv = new ImagePreloader_223(preloadPhotos_223, initGalleryScript_223);
    var aiv = new ImagePreloader_223(preloadPhotosAfter_223, viodAction_223);
}
